2022-11-27 20:36:54 +03:00
|
|
|
#include <SDL3/SDL.h>
|
2022-12-15 07:58:20 +03:00
|
|
|
#include <SDL3/SDL_main.h>
|
2022-06-03 21:07:43 +03:00
|
|
|
|
2023-03-06 01:44:38 +03:00
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
2022-06-03 21:07:43 +03:00
|
|
|
SDL_Window *window = NULL;
|
|
|
|
SDL_Surface *screenSurface = NULL;
|
2024-08-23 03:33:49 +03:00
|
|
|
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
2023-03-06 01:44:38 +03:00
|
|
|
SDL_Log("Could not initialize SDL: %s\n", SDL_GetError());
|
2022-06-03 21:07:43 +03:00
|
|
|
return 1;
|
|
|
|
}
|
2023-03-06 01:44:38 +03:00
|
|
|
window = SDL_CreateWindow("Hello SDL", 640, 480, 0);
|
2023-11-10 00:29:15 +03:00
|
|
|
if (!window) {
|
2023-03-06 01:44:38 +03:00
|
|
|
SDL_Log("could not create window: %s\n", SDL_GetError());
|
2022-06-03 21:07:43 +03:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
screenSurface = SDL_GetWindowSurface(window);
|
2024-07-09 00:59:18 +03:00
|
|
|
SDL_FillSurfaceRect(screenSurface, NULL, SDL_MapSurfaceRGB(screenSurface, 0xff, 0xff, 0xff));
|
2022-06-03 21:07:43 +03:00
|
|
|
SDL_UpdateWindowSurface(window);
|
|
|
|
SDL_Delay(100);
|
|
|
|
SDL_DestroyWindow(window);
|
|
|
|
SDL_Quit();
|
|
|
|
return 0;
|
|
|
|
}
|