Increase framebuffer window scale

This commit is contained in:
Konstantin Nazarov 2024-12-22 22:50:50 +00:00
parent ca5c7e3bd3
commit 6fe7d5adc6
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22

View file

@ -12,7 +12,7 @@ SDL_Texture* texture = nullptr;
#define FB_WIDTH 320 #define FB_WIDTH 320
#define FB_HEIGHT 200 #define FB_HEIGHT 200
#define FB_SCALE 2 #define FB_SCALE 4
#define FB_OFFSET 0x10000 #define FB_OFFSET 0x10000
Framebuffer::Framebuffer(UART& uart) Framebuffer::Framebuffer(UART& uart)
@ -30,7 +30,8 @@ Framebuffer::Framebuffer(UART& uart)
void Framebuffer::mainloop() { void Framebuffer::mainloop() {
window = SDL_CreateWindow("rve Framebuffer", SDL_WINDOWPOS_CENTERED, window = SDL_CreateWindow("rve Framebuffer", SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED, width, height, 0); SDL_WINDOWPOS_CENTERED, width * FB_SCALE,
height * FB_SCALE, 0);
if (!window) { if (!window) {
throw std::runtime_error("Failed to create SDL window"); throw std::runtime_error("Failed to create SDL window");
} }
@ -79,6 +80,8 @@ void Framebuffer::mainloop() {
asciiValue = 2; asciiValue = 2;
} else if (key == SDLK_RCTRL || key == SDLK_LCTRL) { } else if (key == SDLK_RCTRL || key == SDLK_LCTRL) {
asciiValue = 5; asciiValue = 5;
} else if (key == SDLK_RALT || key == SDLK_LALT) {
asciiValue = 6;
} else { } else {
valid_key = false; valid_key = false;
} }