Fix blackscreen, better debug print of display parameters

This commit is contained in:
Henrik Rydgård 2023-02-27 15:21:58 +01:00
parent ca8af6f4c7
commit 3aa0a9e17b
3 changed files with 24 additions and 3 deletions

View File

@ -1,3 +1,5 @@
#include <cstdio>
#include "Common/System/Display.h"
#include "Common/Math/math_util.h"
@ -46,3 +48,21 @@ void RotateRectToDisplay(DisplayRect<int> &rect, int curRTWidth, int curRTHeight
void RotateRectToDisplay(DisplayRect<float> &rect, float curRTWidth, float curRTHeight) {
RotateRectToDisplayImpl<float>(rect, curRTWidth, curRTHeight);
}
DisplayProperties::DisplayProperties() {
rot_matrix.setIdentity();
}
void DisplayProperties::Print() {
printf("dp_xres/yres: %d, %d\n", dp_xres, dp_yres);
printf("pixel_xres/yres: %d, %d\n", pixel_xres, pixel_yres);
printf("dpi, x, y: %f, %f, %f\n", dpi, dpi_scale_x, dpi_scale_y);
printf("pixel_in_dps: %f, %f\n", pixel_in_dps_x, pixel_in_dps_y);
printf("dpi_real: %f, %f\n", dpi_scale_real_x, dpi_scale_real_y);
printf("display_hz: %f\n", display_hz);
printf("rotation: %d\n", rotation);
rot_matrix.print();
}

View File

@ -36,6 +36,9 @@ struct DisplayProperties {
DisplayRotation rotation;
Lin::Matrix4x4 rot_matrix;
DisplayProperties();
void Print();
};
extern DisplayProperties g_display;

View File

@ -751,9 +751,7 @@ int main(int argc, char *argv[]) {
g_display.dpi_scale_y = g_display.dp_yres / (float)g_display.pixel_yres;
g_display.dpi_scale_real_x = g_display.dpi_scale_x;
g_display.dpi_scale_real_y = g_display.dpi_scale_y;
printf("Pixels: %i x %i\n", g_display.pixel_xres, g_display.pixel_yres);
printf("Virtual pixels: %i x %i\n", g_display.dp_xres, g_display.dp_yres);
g_display.Print();
GraphicsContext *graphicsContext = nullptr;
SDL_Window *window = nullptr;