Files
aee/jgame.cpp
Raimon Zamora 7e5318c501 - S'ha llevat la carpeta ".vscode" i la merdeta que estava dins
- Afegit mòdul jshader.
- Afegit shader al arxiu de dades
- Actualitzat makefile per a la ocasió
- Afegit lo de afegir caràcter 0 al final si es vol en jfile
- Llevat el flag d'executable que tenien tots els arxius, jo que se perqué
2024-06-28 11:12:50 +02:00

44 lines
698 B
C++

#include "jgame.h"
bool eixir = false;
int updateTicks = 0;
Uint32 updateTime = 0;
Uint32 cycle_counter = 0;
void JG_Init() {
SDL_Init( SDL_INIT_EVERYTHING );
//SDL_WM_SetCaption( title, NULL );
updateTime = SDL_GetTicks();
}
void JG_Finalize() {
SDL_Quit();
}
void JG_QuitSignal() {
eixir = true;
}
bool JG_Quitting() {
return eixir;
}
void JG_SetUpdateTicks(Uint32 milliseconds) {
updateTicks = milliseconds;
}
bool JG_ShouldUpdate() {
if (SDL_GetTicks() - updateTime > updateTicks) {
updateTime = SDL_GetTicks();
cycle_counter++;
return true;
} else {
return false;
}
}
Uint32 JG_GetCycleCounter() {
return cycle_counter;
}