2023-08-08 20:34:21 +02:00
|
|
|
#include <stdio.h>
|
2023-08-08 20:39:29 +02:00
|
|
|
#include <SDL2/SDL.h>
|
2023-08-08 20:34:21 +02:00
|
|
|
|
|
|
|
#include "game.h"
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
SDL_Window *window;
|
|
|
|
SDL_Renderer *renderer;
|
|
|
|
SDL_Texture *texture;
|
|
|
|
SDL_Surface *screenSurface;
|
|
|
|
|
|
|
|
const uint8_t *sdlKeyboardState;
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
uint8_t running = 1;
|
|
|
|
LCR_gameInit();
|
|
|
|
|
|
|
|
SDL_Init(SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
|
|
|
|
|
|
|
|
window =
|
|
|
|
SDL_CreateWindow("Licar", SDL_WINDOWPOS_UNDEFINED,
|
2023-08-08 20:39:29 +02:00
|
|
|
SDL_WINDOWPOS_UNDEFINED, LCR_SETTING_RESOLUTION_X, LCR_SETTING_RESOLUTION_Y,
|
2023-08-08 20:34:21 +02:00
|
|
|
SDL_WINDOW_SHOWN);
|
|
|
|
|
|
|
|
renderer = SDL_CreateRenderer(window,-1,0);
|
|
|
|
|
|
|
|
texture =
|
|
|
|
SDL_CreateTexture(renderer,SDL_PIXELFORMAT_RGB565,SDL_TEXTUREACCESS_STATIC,
|
2023-08-08 20:39:29 +02:00
|
|
|
LCR_SETTING_RESOLUTION_X,LCR_SETTING_RESOLUTION_Y);
|
2023-08-08 20:34:21 +02:00
|
|
|
|
|
|
|
screenSurface = SDL_GetWindowSurface(window);
|
|
|
|
|
|
|
|
//SDL_ShowCursor(0);
|
|
|
|
|
|
|
|
SDL_PumpEvents();
|
2023-08-08 20:39:29 +02:00
|
|
|
sdlKeyboardState = SDL_GetKeyboardState(NULL);
|
2023-08-08 20:34:21 +02:00
|
|
|
|
|
|
|
while (running)
|
|
|
|
{
|
2023-08-08 20:39:29 +02:00
|
|
|
SDL_PumpEvents();
|
|
|
|
sdlKeyboardState = SDL_GetKeyboardState(NULL);
|
|
|
|
running = !sdlKeyboardState[SDL_SCANCODE_Q];
|
2023-08-08 20:34:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
SDL_DestroyTexture(texture);
|
|
|
|
SDL_DestroyRenderer(renderer);
|
|
|
|
SDL_DestroyWindow(window);
|
|
|
|
|
|
|
|
LCR_gameEnd();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|