Add getblockat function
This commit is contained in:
parent
e678c68b66
commit
891d0f67a1
3 changed files with 95 additions and 21 deletions
51
main_sdl.c
Normal file
51
main_sdl.c
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#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,
|
||||
SDL_WINDOWPOS_UNDEFINED, SFG_SCREEN_RESOLUTION_X, SFG_SCREEN_RESOLUTION_Y,
|
||||
SDL_WINDOW_SHOWN);
|
||||
|
||||
renderer = SDL_CreateRenderer(window,-1,0);
|
||||
|
||||
texture =
|
||||
SDL_CreateTexture(renderer,SDL_PIXELFORMAT_RGB565,SDL_TEXTUREACCESS_STATIC,
|
||||
SFG_SCREEN_RESOLUTION_X,SFG_SCREEN_RESOLUTION_Y);
|
||||
|
||||
screenSurface = SDL_GetWindowSurface(window);
|
||||
|
||||
sdlKeyboardState = SDL_GetKeyboardState(NULL);
|
||||
|
||||
//SDL_ShowCursor(0);
|
||||
|
||||
SDL_PumpEvents();
|
||||
|
||||
while (running)
|
||||
{
|
||||
running = sdlKeyboardState[SDL_SCANCODE_Q];
|
||||
}
|
||||
|
||||
SDL_DestroyTexture(texture);
|
||||
SDL_DestroyRenderer(renderer);
|
||||
SDL_DestroyWindow(window);
|
||||
|
||||
LCR_gameEnd();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue