changeset 14253:6c9f27a5ea02

win95 does not support GetMonitorInfo
author faust3
date Mon, 27 Dec 2004 19:27:07 +0000
parents 1e16a8e3735b
children 21e72b6d8d11
files libvo/vo_directx.c
diffstat 1 files changed, 12 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/vo_directx.c	Mon Dec 27 18:16:55 2004 +0000
+++ b/libvo/vo_directx.c	Mon Dec 27 19:27:07 2004 +0000
@@ -70,6 +70,7 @@
 static GUID *selected_guid_ptr = NULL;
 static RECT monitor_rect;	                        //monitor coordinates 
 static float window_aspect;
+static BOOL (WINAPI* myGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL;
 
 extern void mplayer_put_key(int code);              //let mplayer handel the keyevents 
 extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
@@ -379,9 +380,13 @@
             selected_guid_ptr = &selected_guid;
         }
         mi.cbSize = sizeof(mi);
-        if (GetMonitorInfo(hm, &mi)) {
+        if(myGetMonitorInfo){
+        if (myGetMonitorInfo(hm, &mi)) {
 			monitor_rect = mi.rcMonitor;
         }
+        }else{
+            mp_msg(MSGT_VO, MSGL_ERR, "-adapter is not supported on Win95\n");
+        }
         mp_msg(MSGT_VO, MSGL_INFO ,"\t\t<--");
     }
     mp_msg(MSGT_VO, MSGL_INFO ,"\n");
@@ -397,6 +402,11 @@
  	LPDIRECTDRAW lpDDraw;
 	DDSURFACEDESC2 ddsd;
 	LPDIRECTDRAWENUMERATEEX OurDirectDrawEnumerateEx;
+	HINSTANCE user32dll=LoadLibrary("user32.dll");
+	
+	if(user32dll){
+		myGetMonitorInfo=GetProcAddress(user32dll,"GetMonitorInfo");
+	}
 	
 	mp_msg(MSGT_VO, MSGL_DBG3,"<vo_directx><INFO>Initing DirectDraw\n" );
 
@@ -424,6 +434,7 @@
         if(vo_adapter_num >= adapter_count)
             mp_msg(MSGT_VO, MSGL_ERR,"Selected adapter (%d) doesn't exist: Default Display Adapter selected\n",vo_adapter_num);
     }
+    FreeLibrary(user32dll);
 
 	OurDirectDrawCreateEx = (void *)GetProcAddress(hddraw_dll, "DirectDrawCreateEx");
     if ( OurDirectDrawCreateEx == NULL )