Compare commits
2 Commits
83fb2f30ba
...
b114d75c69
| Author | SHA1 | Date | |
|---|---|---|---|
| b114d75c69 | |||
| 8465ee87fb |
@@ -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);
|
||||||
@@ -98,7 +102,13 @@ void Screen::blit()
|
|||||||
// Pinta en pantalla el contador de FPS
|
// Pinta en pantalla el contador de FPS
|
||||||
if (showFps)
|
if (showFps)
|
||||||
{
|
{
|
||||||
dbg_print(0, 0, std::to_string(fps).c_str(), 255, 255, 255);
|
// FPS
|
||||||
|
const std::string fpstext = std::to_string(fps) + " FPS";
|
||||||
|
dbg_print(0, 0, fpstext.c_str(), 255, 255, 255);
|
||||||
|
|
||||||
|
// Resolution
|
||||||
|
const std::string resolution = std::to_string(displayWidth) + " X " + std::to_string(displayHeight);
|
||||||
|
dbg_print(0, 8, resolution.c_str(), 255, 255, 255);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NO_SHADERS
|
#ifdef NO_SHADERS
|
||||||
|
|||||||
@@ -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