Ich versuche, eine Grafikpipeline zu initialisieren, um ein Dreieck zu rendern:
Code: Select all
#include
#include
#include
#include
#include
#include
class Game {
public:
void init(const char* title, int width, int height, bool fullscreen);
SDL_GPUShader* loadShader(const char* path, SDL_GPUShaderStage stage);
private:
SDL_Window* window;
SDL_GPUDevice* gpu_device;
SDL_GPUGraphicsPipeline* graphics_pipeline;
SDL_GPUShader* vertex_shader;
SDL_GPUShader* fragment_shader;
};
Game* game = nullptr;
int main() {
game = new Game();
game->init("Space Adventure", 800, 600, false);
return 0;
}
void Game::init(const char* title, int width, int height, bool fullscreen) {
if (SDL_Init(SDL_INIT_VIDEO) < 0) {
std::cerr
Mobile version