Retoques de lo anterior para ser un poco mas eficiente y ordenado
This commit is contained in:
@@ -43,6 +43,10 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, Input *
|
|||||||
#else
|
#else
|
||||||
showFps = false;
|
showFps = false;
|
||||||
#endif
|
#endif
|
||||||
|
SDL_DisplayMode DM;
|
||||||
|
SDL_GetCurrentDisplayMode(0, &DM);
|
||||||
|
displayWidth = DM.w;
|
||||||
|
displayHeight = DM.h;
|
||||||
|
|
||||||
// Crea los objetos
|
// Crea los objetos
|
||||||
notify = new Notify(renderer, asset->get("notify.png"), asset->get("8bithud.png"), asset->get("8bithud.txt"), asset->get("notify.wav"), options);
|
notify = new Notify(renderer, asset->get("notify.png"), asset->get("8bithud.png"), asset->get("8bithud.txt"), asset->get("notify.wav"), options);
|
||||||
@@ -103,9 +107,7 @@ void Screen::blit()
|
|||||||
dbg_print(0, 0, fpstext.c_str(), 255, 255, 255);
|
dbg_print(0, 0, fpstext.c_str(), 255, 255, 255);
|
||||||
|
|
||||||
// Resolution
|
// Resolution
|
||||||
SDL_DisplayMode DM;
|
const std::string resolution = std::to_string(displayWidth) + " X " + std::to_string(displayHeight);
|
||||||
SDL_GetCurrentDisplayMode(0, &DM);
|
|
||||||
const std::string resolution = std::to_string(DM.w) + " X " + std::to_string(DM.h);
|
|
||||||
dbg_print(0, 8, resolution.c_str(), 255, 255, 255);
|
dbg_print(0, 8, resolution.c_str(), 255, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ private:
|
|||||||
int fpsCounter; // Contador de frames por segundo
|
int fpsCounter; // Contador de frames por segundo
|
||||||
int fps; // Frames calculados en el último segundo
|
int fps; // Frames calculados en el último segundo
|
||||||
bool showFps; // Indica si ha de mostrar/ocultar la información de los frames por segundo en pantalla
|
bool showFps; // Indica si ha de mostrar/ocultar la información de los frames por segundo en pantalla
|
||||||
|
int displayWidth; // Anchura de la pantalla
|
||||||
|
int displayHeight; // Altura de la pantalla
|
||||||
|
|
||||||
struct effect_t
|
struct effect_t
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user