36 lines
679 B
C
36 lines
679 B
C
#include <stdio.h>
|
|
#include <stdbool.h>
|
|
#include <stdlib.h>
|
|
#include <stdWullie.h>
|
|
|
|
#include <SDL3/SDL.h>
|
|
#include <SDL3/SDL_main.h>
|
|
|
|
// sdl flags
|
|
#define SDL_FLAGS (SDL_INIT_VIDEO | SDL_INIT_AUDIO)
|
|
|
|
// window shit
|
|
#define WindowTitle "Tetris"
|
|
#define width 800
|
|
#define height 800
|
|
|
|
|
|
typedef struct GameInit {
|
|
SDL_Window *window;
|
|
SDL_Renderer *renderer;
|
|
SDL_AudioStream *stream;
|
|
|
|
SDL_Event event;
|
|
bool isRunning;
|
|
} GameInit;
|
|
|
|
//sdl shit
|
|
void sdlGameInit(GameInit *game);
|
|
void sdlGameFree(GameInit **gameInit);
|
|
|
|
// game shit
|
|
void gameLoop(GameInit *game);
|
|
void gameEventCheck(GameInit *game);
|
|
void gameDrawContext(GameInit *game);
|
|
void gameCreateContext(GameInit **gameInit);
|