tibia_alpha/system.c
Rodrigo Verdiani a0223f8e4e initial commit
2025-12-26 23:48:59 -03:00

25 lines
629 B
C

//
// Created by rov on 12/26/25.
//
#include "system.h"
#include <SDL3/SDL.h>
void System_QueryMetrics(SystemMetrics_t *systemMetrics) {
SDL_Rect bounds;
const SDL_DisplayID displayId = SDL_GetPrimaryDisplay();
if (displayId && SDL_GetDisplayBounds(displayId, &bounds)) {
systemMetrics->screenWidth = bounds.w;
systemMetrics->screenHeight = bounds.h;
return;
}
// Fallback
SDL_LogError(SDL_LOG_CATEGORY_VIDEO, "System_QueryMetrics: couldn't get primary display bounds. Using fallback values.");
systemMetrics->screenWidth = 800;
systemMetrics->screenHeight = 600;
}