From 8cea7cf2986a36d51c1ce81d36d2d7c3dffa071c Mon Sep 17 00:00:00 2001 From: Juan Manuel Tomas Date: Wed, 12 Jan 2022 01:12:23 -0300 Subject: Initial Commit --- main.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 main.c (limited to 'main.c') diff --git a/main.c b/main.c new file mode 100644 index 0000000..0d14b64 --- /dev/null +++ b/main.c @@ -0,0 +1,31 @@ +#include +#include + +int main() { + SDL_Init(SDL_INIT_VIDEO); + + SDL_Window *window = SDL_CreateWindow("Cannons", + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + 1280, + 720, + 0); + + SDL_Renderer *context = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); + + SDL_SetRenderDrawColor(context, 40, 40, 40, 255); + SDL_RenderClear(context); + + SDL_Surface *map_surface = SDL_LoadBMP("test-map.bmp"); + SDL_Texture *map = SDL_CreateTextureFromSurface(context, map_surface); + SDL_RenderCopy(context, map, 0, 0); + + SDL_RenderPresent(context); + + SDL_Delay(1000); + + SDL_DestroyRenderer(context); + SDL_DestroyWindow(window); + SDL_Quit(); + return 0; +} -- cgit v1.2.3