main_gui.c 717 B

12345678910111213141516171819202122232425
  1. #include <SDL3/SDL.h>
  2. #include <SDL3/SDL_main.h>
  3. int main(int argc, char *argv[])
  4. {
  5. SDL_Window *window = NULL;
  6. SDL_Surface *screenSurface = NULL;
  7. if (!SDL_Init(SDL_INIT_VIDEO)) {
  8. SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
  9. return 1;
  10. }
  11. window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
  12. if (!window) {
  13. SDL_Log("could not create window: %s\n", SDL_GetError());
  14. return 1;
  15. }
  16. screenSurface = SDL_GetWindowSurface(window);
  17. SDL_FillSurfaceRect(screenSurface, NULL, SDL_MapSurfaceRGB(screenSurface, 0xff, 0xff, 0xff));
  18. SDL_UpdateWindowSurface(window);
  19. SDL_Delay(100);
  20. SDL_DestroyWindow(window);
  21. SDL_Quit();
  22. return 0;
  23. }