Initial commit
Basic SDL3 window Build script for windows Added SDL3 submodule Added stb submodule
This commit is contained in:
29
code/first.c
Normal file
29
code/first.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (!SDL_Init(SDL_INIT_VIDEO)) {
|
||||
printf("[Error] :: Failed to initialise SDL3 (%s)\n", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
SDL_Window *window = SDL_CreateWindow("Ludum", 1280, 720, SDL_WINDOW_HIGH_PIXEL_DENSITY);
|
||||
if (!window) {
|
||||
printf("[Error] :: Failed to create window (%s)\n", SDL_GetError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
bool running = true;
|
||||
while (running) {
|
||||
SDL_Event e;
|
||||
while (SDL_PollEvent(&e)) {
|
||||
if (e.type == SDL_EVENT_QUIT) { running = false; }
|
||||
}
|
||||
}
|
||||
|
||||
SDL_DestroyWindow(window);
|
||||
SDL_Quit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user