From 0cc02e94fef0d0a7dccdf400189d6af543a8f84b Mon Sep 17 00:00:00 2001 From: Sara Date: Thu, 14 Nov 2024 15:50:12 +0100 Subject: [PATCH] TEMPLATE --- .gitignore | 3 +++ .sconsign.dblite | Bin 0 -> 2228 bytes SConstruct | 6 ++++++ init-project.sh | 8 ++++++++ src/main.cpp | 35 +++++++++++++++++++++++++++++++++++ 5 files changed, 52 insertions(+) create mode 100644 .gitignore create mode 100644 .sconsign.dblite create mode 100644 SConstruct create mode 100755 init-project.sh create mode 100644 src/main.cpp diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef88a4b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# binaries +*.o +PROJECTNAME diff --git a/.sconsign.dblite b/.sconsign.dblite new file mode 100644 index 0000000000000000000000000000000000000000..82a4aa582599ac86dfddb17184ba0d4cbf128da4 GIT binary patch literal 2228 zcmd^AO>Y}T7)~3PxJg5ytq=ksZ4)1Ws?N^m&K_gqlsJh~IYw#^RWx7g-72vyuZ;u} zQn>F4rvHEo7sQn-;y1t*iNC>tnf)+M5rhj|y0UiWeaG|eJJ0*P&s@}Ad|O}1pD)b& z*|nx=soKiQMeW5?JGjTW*H7BxQ97H><;-NS=SDMsC&Q7+Hmhl8G@E{AzBV6xY22`43t*DCj>_{3L(^-lQ5!?xkwimzeP6E_rKp>M7o=KKBFw8B8UJ(L=nIP09;%1bGYC7Xun^rTPvTM_-$9S9ZQ#;;e!YE8wIZKR+za%Vx%OI zHZPz!!5|VoReGC_bDCvz79AI1E`UX zc*qe$fcrr}eU4;~=N-#~|FSYf0xYyt0kkEhkouToEJBJ24OkeWzo|@2{@0>7P<#oQ zVl+S?Pyzr-1F9sH8Zf3@QA(s|=>vih z)Kqc|1+wi82-66%fH<;87-K7JOS<%xRf +#include +#include +#include +#include + +int main(int argc, char* argv[]) { + // initialize SDL2 + assert(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_EVENTS) == 0 && "SDL Initialization failed"); + // open window and create renderer from window + SDL_Window *window{SDL_CreateWindow("new_window", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 1000, 1000, SDL_WINDOW_BORDERLESS)}; + assert(window != NULL && "SDL window failed to open"); + SDL_Renderer *render{SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED)}; + assert(render != NULL && "SDL Renderer failed to open"); + // start working + SDL_Event event{}; + bool keep_open{true}; + while(keep_open) { + SDL_PollEvent(&event); + switch(event.type) { + case SDL_QUIT: + keep_open = false; + break; + default: + break; + } + + SDL_RenderClear(render); + SDL_RenderPresent(render); + } + + SDL_DestroyRenderer(render); + SDL_DestroyWindow(window); + SDL_Quit(); +}