changeset 2040:bf7764f429c9

-fs fix
author atmos4
date Mon, 01 Oct 2001 20:56:19 +0000
parents 452f3cb96b32
children ba8a225d1a18
files libvo/vo_gl.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_gl.c	Mon Oct 01 20:40:07 2001 +0000
+++ b/libvo/vo_gl.c	Mon Oct 01 20:56:19 2001 +0000
@@ -98,6 +98,7 @@
 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t fullscreen, char *title, uint32_t format)
 {
 	int screen;
+        int dwidth,dheight;
 	unsigned int fg, bg;
 	char *hello = (title == NULL) ? "OpenGL rulez" : title;
 	char *name = ":0.0";
@@ -126,7 +127,23 @@
 	}
 
 	screen = DefaultScreen(mydisplay);
+        vo_screenwidth = DisplayWidth(mydisplay, myscreen);
+	vo_screenheight = DisplayHeight(mydisplay, myscreen);
 
+        dwidth=d_width; dheight=d_height;
+#ifdef X11_FULLSCREEN
+        if(fullscreen){ // handle flags correct
+          d_height=(int)((float)vo_screenwidth/(float)dwidth*(float)dheight);
+          d_height+=d_height%2; // round
+          d_width=vo_screenwidth;
+          if(dheight>vo_screenheight){
+            d_width=(int)((float)vo_screenheight/(float)dheight*(float)dwidth);
+            d_width+=d_width%2; // round
+            d_height=vo_screenheight;
+          }
+          dwidth=d_width; dheight=d_height;
+        }
+#endif
 	hint.x = 0;
 	hint.y = 0;
 	hint.width = d_width;