Add logs and checks

This commit is contained in:
Miloslav Ciz 2024-09-27 00:08:52 +02:00
parent 28a1256a88
commit e9f919052c
5 changed files with 104 additions and 10 deletions

View file

@ -1,6 +1,8 @@
#include <stdio.h>
#include <SDL2/SDL.h>
#define LCR_SETTING_LOG_LEVEL 5
#include "game.h"
#include "debug.h"
@ -67,12 +69,30 @@ int main(int argc, char *argv[])
SDL_WINDOWPOS_UNDEFINED, LCR_SETTING_RESOLUTION_X, LCR_SETTING_RESOLUTION_Y,
SDL_WINDOW_SHOWN);
if (!window)
{
fputs("ERROR: couldn't create window",stderr);
return 1;
}
renderer = SDL_CreateRenderer(window,-1,0);
if (!renderer)
{
fputs("ERROR: couldn't create renderer",stderr);
return 1;
}
texture =
SDL_CreateTexture(renderer,SDL_PIXELFORMAT_RGB565,SDL_TEXTUREACCESS_STATIC,
LCR_SETTING_RESOLUTION_X,LCR_SETTING_RESOLUTION_Y);
if (!texture)
{
fputs("ERROR: couldn't create texture",stderr);
return 1;
}
screenSurface = SDL_GetWindowSurface(window);
SDL_ShowCursor(0);