Created
May 5, 2022 12:52
-
-
Save alexmaryin/7ffccc43ab1be1f46601fa2c10fcfb89 to your computer and use it in GitHub Desktop.
starfield C++ init SDL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SDL_Init(SDL_INIT_EVERYTHING); | |
SDL_Window *window = SDL_CreateWindow("C++ SDL window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, | |
WIDTH, HEIGHT, SDL_WINDOW_ALLOW_HIGHDPI); | |
if (window == NULL) | |
{ | |
std::cout << "Could not create window: " << SDL_GetError() << std::endl; | |
return 1; | |
} | |
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, 0); | |
if (renderer == NULL) | |
{ | |
std::cout << "Could not init renderer: " << SDL_GetError() << std::endl; | |
return 1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment