summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-12-27 19:27:07 +0000
committerfaust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-12-27 19:27:07 +0000
commitbd6b315f6b18dbb67ce11a4909bda4ef01d0fedd (patch)
tree19298d5f98b405795add8b86fb69e67596952919 /libvo
parent87494001335cf8d96da3ee7c7e6739408b0002f5 (diff)
downloadmpv-bd6b315f6b18dbb67ce11a4909bda4ef01d0fedd.tar.bz2
mpv-bd6b315f6b18dbb67ce11a4909bda4ef01d0fedd.tar.xz
win95 does not support GetMonitorInfo
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14254 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_directx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libvo/vo_directx.c b/libvo/vo_directx.c
index 2c345f0c47..d20619fe85 100644
--- a/libvo/vo_directx.c
+++ b/libvo/vo_directx.c
@@ -70,6 +70,7 @@ static GUID selected_guid;
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 @@ static BOOL WINAPI EnumCallbackEx(GUID FAR *lpGUID, LPSTR lpDriverDescription, L
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 @@ static uint32_t Directx_InitDirectDraw()
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 @@ static uint32_t Directx_InitDirectDraw()
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 )