Añadida información de la pantalla antes de crear la ventana
This commit is contained in:
@@ -45,10 +45,7 @@ Screen::Screen(SDL_Window *window, SDL_Renderer *renderer, Asset *asset, Input *
|
|||||||
#endif
|
#endif
|
||||||
SDL_DisplayMode DM;
|
SDL_DisplayMode DM;
|
||||||
SDL_GetCurrentDisplayMode(0, &DM);
|
SDL_GetCurrentDisplayMode(0, &DM);
|
||||||
displayWidth = DM.w;
|
infoResolution = std::to_string(DM.w) + " X " + std::to_string(DM.h) + " AT " + std::to_string(DM.refresh_rate) + " HZ";
|
||||||
displayHeight = DM.h;
|
|
||||||
displayRefreshRate = DM.refresh_rate;
|
|
||||||
infoResolution = std::to_string(displayWidth) + " X " + std::to_string(displayHeight) + " AT " + std::to_string(displayRefreshRate) + " HZ";
|
|
||||||
|
|
||||||
// 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);
|
||||||
@@ -144,7 +141,7 @@ void Screen::blit()
|
|||||||
void Screen::setVideoMode(int videoMode)
|
void Screen::setVideoMode(int videoMode)
|
||||||
{
|
{
|
||||||
#ifdef ARCADE
|
#ifdef ARCADE
|
||||||
videoMode = SCREEN_VIDEO_MODE_WINDOW;
|
//videoMode = SCREEN_VIDEO_MODE_WINDOW;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Si está activo el modo ventana quita el borde
|
// Si está activo el modo ventana quita el borde
|
||||||
|
|||||||
@@ -38,9 +38,6 @@ 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 showInfo; // Indica si ha de mostrar/ocultar la información de la pantalla
|
bool showInfo; // Indica si ha de mostrar/ocultar la información de la pantalla
|
||||||
int displayWidth; // Anchura de la pantalla
|
|
||||||
int displayHeight; // Altura de la pantalla
|
|
||||||
int displayRefreshRate; // Frecuencia de refresco de la pantalla
|
|
||||||
std::string infoResolution; // Texto con la informacion de la pantalla
|
std::string infoResolution; // Texto con la informacion de la pantalla
|
||||||
|
|
||||||
struct effect_t
|
struct effect_t
|
||||||
|
|||||||
@@ -207,6 +207,14 @@ bool Director::initSDL()
|
|||||||
// Inicia el generador de numeros aleatorios
|
// Inicia el generador de numeros aleatorios
|
||||||
std::srand(static_cast<unsigned int>(SDL_GetTicks()));
|
std::srand(static_cast<unsigned int>(SDL_GetTicks()));
|
||||||
|
|
||||||
|
// Muestra información de la pantalla
|
||||||
|
if (options->console)
|
||||||
|
{
|
||||||
|
SDL_DisplayMode DM;
|
||||||
|
SDL_GetCurrentDisplayMode(0, &DM);
|
||||||
|
std::cout << "\nDisplay info: " + std::to_string(DM.w) + "x" + std::to_string(DM.h) + " @ " + std::to_string(DM.refresh_rate) + "Hz" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Establece el filtro de la textura
|
// Establece el filtro de la textura
|
||||||
if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, std::to_string(options->video.filter).c_str()))
|
if (!SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, std::to_string(options->video.filter).c_str()))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user