shithub: npe

Download patch

ref: b1e4757d96ebe8c225737c61f3ace37cfd84d29f
parent: 4cf6f39af2db7e9c5985ff80cc20a8b7b8567a31
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Aug 15 22:10:25 EDT 2023

SDL2: add SDL_GL_GetDrawableSize

--- a/include/npe/SDL2/SDL.h
+++ b/include/npe/SDL2/SDL.h
@@ -57,6 +57,7 @@
 #include <SDL2/SDL_quit.h>
 #include <SDL2/SDL_rwops.h>
 #include <SDL2/SDL_version.h>
+#include <SDL2/SDL_video.h>
 
 void SDL_StopTextInput(void);
 SDL_bool SDL_HasSSE(void);
--- /dev/null
+++ b/include/npe/SDL2/SDL_video.h
@@ -1,0 +1,6 @@
+#ifndef _npe_SDL_video_h_
+#define _npe_SDL_video_h_
+
+void SDL_GL_GetDrawableSize(SDL_Window *window, int *w, int *h);
+
+#endif
--- a/libnpe_sdl2/sdl2.c
+++ b/libnpe_sdl2/sdl2.c
@@ -744,6 +744,13 @@
 }
 
 void
+SDL_GL_GetDrawableSize(SDL_Window *, int *w, int *h)
+{
+	*w = Dx(screen->r);
+	*h = Dy(screen->r);
+}
+
+void
 SDL_GetWindowPosition(SDL_Window *, int *x, int *y)
 {
 	*x = screen->r.min.x;