window: add window_dpi()

main
Dominik Madarász 2023-10-10 16:26:17 +02:00
parent 8c05030d48
commit a0aa0a1d3d
6 changed files with 25 additions and 0 deletions

View File

@ -1505,6 +1505,9 @@ ffi.cdef([[
//lcpp INF [0000] vec2: macro name but used as C declaration in:API vec2 window_canvas();
//lcpp INF [0000] vec2: macro name but used as C declaration in:STATIC vec2 window_canvas();
//lcpp INF [0000] vec2: macro name but used as C declaration in: vec2 window_canvas();
//lcpp INF [0000] vec2: macro name but used as C declaration in:API vec2 window_dpi();
//lcpp INF [0000] vec2: macro name but used as C declaration in:STATIC vec2 window_dpi();
//lcpp INF [0000] vec2: macro name but used as C declaration in: vec2 window_dpi();
typedef struct FILE FILE;
typedef long int ptrdiff_t;
typedef long unsigned int size_t;
@ -3190,6 +3193,7 @@ WINDOW_VSYNC_DISABLED =8192,
uint64_t window_frame();
int window_width();
int window_height();
vec2 window_dpi();
double window_time();
double window_delta();
void window_focus();

View File

@ -17984,6 +17984,7 @@ API char* window_stats();
API uint64_t window_frame();
API int window_width();
API int window_height();
API vec2 window_dpi();
API double window_time();
API double window_delta();
@ -605770,6 +605771,12 @@ double window_time() {
double window_delta() {
return dt;
}
vec2 window_dpi() {
float x=0.0f;
float y=0.0f;
glfwGetMonitorContentScale(glfwGetPrimaryMonitor(), &x, &y);
return vec2(x,y);
}
double window_fps() {
return fps;

View File

@ -813,6 +813,12 @@ double window_time() {
double window_delta() {
return dt;
}
vec2 window_dpi() {
float x=0.0f;
float y=0.0f;
glfwGetMonitorContentScale(glfwGetPrimaryMonitor(), &x, &y);
return vec2(x,y);
}
double window_fps() {
return fps;

View File

@ -45,6 +45,7 @@ API char* window_stats();
API uint64_t window_frame();
API int window_width();
API int window_height();
API vec2 window_dpi();
API double window_time();
API double window_delta();

View File

@ -23944,6 +23944,12 @@ double window_time() {
double window_delta() {
return dt;
}
vec2 window_dpi() {
float x=0.0f;
float y=0.0f;
glfwGetMonitorContentScale(glfwGetPrimaryMonitor(), &x, &y);
return vec2(x,y);
}
double window_fps() {
return fps;

View File

@ -4051,6 +4051,7 @@ API char* window_stats();
API uint64_t window_frame();
API int window_width();
API int window_height();
API vec2 window_dpi();
API double window_time();
API double window_delta();