Files
aee/jgame.cpp
Raimon Zamora 8805799f2e - [NEW] Passat a SDL3
- [NEW] Passat a de SDL_Mixer a JailAudio
- [NEW] Actualitzat a Respack2
- [NEW] Llevat el data.jrf i afegit el directori 'data' amb els arxius. Molt millor per a developar.
- [CHG] Músiques passades a OGG
- [NEW] Afegit lagueirtofile
2025-06-29 14:18:38 +02:00

44 lines
710 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_VIDEO | SDL_INIT_AUDIO );
//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;
}