Minor refactoring of gui window size

This commit is contained in:
Dimitris Panokostas 2020-06-29 08:13:45 +02:00
parent 86bc238c83
commit 33fa6ddcea
3 changed files with 8 additions and 9 deletions

View file

@ -50,7 +50,6 @@ const char* sdl_video_driver;
static int display_width;
static int display_height;
int window_width = 800, window_height = 600;
bool can_have_linedouble;
static unsigned long last_synctime;
@ -177,7 +176,7 @@ static int display_thread(void *unused)
}
if (!screen)
screen = SDL_CreateRGBSurface(0, display_width, display_height, depth, 0, 0, 0, 0);
screen = SDL_CreateRGBSurface(0, width, height, depth, 0, 0, 0, 0);
displayHandle = vc_dispmanx_display_open(0);
@ -380,8 +379,8 @@ int graphics_setup(void)
sdl_window = SDL_CreateWindow("Amiberry",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
window_height,
window_width,
GUI_HEIGHT,
GUI_WIDTH,
sdl_window_mode);
}
else
@ -389,8 +388,8 @@ int graphics_setup(void)
sdl_window = SDL_CreateWindow("Amiberry",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
window_width,
window_height,
GUI_WIDTH,
GUI_HEIGHT,
sdl_window_mode);
}
check_error_sdl(sdl_window == nullptr, "Unable to create window:");
@ -1201,7 +1200,6 @@ static int save_png(SDL_Surface* surface, char* path)
}
png_init_io(png_ptr, f);
png_set_IHDR(png_ptr,
info_ptr,
w,

View file

@ -1,6 +1,9 @@
#pragma once
#include <SDL.h>
#define GUI_WIDTH 800
#define GUI_HEIGHT 600
#ifdef USE_DISPMANX
#include <bcm_host.h>
#define DISPLAY_SIGNAL_SETUP 1

View file

@ -1,8 +1,6 @@
#ifndef GUI_HANDLING_H
#define GUI_HANDLING_H
#define GUI_WIDTH 800
#define GUI_HEIGHT 600
#define DISTANCE_BORDER 15
#define DISTANCE_NEXT_X 15
#define DISTANCE_NEXT_Y 15