X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_window.c;h=00bdfdd75094bd6205463a22becd309dd9e63f3d;hb=026710ef54197b252aec1082765bdc61fe2bb731;hp=6244c61bf94ebbee2369abd1d076cb36cf3a27e0;hpb=4826072e24eb7393cc2564d0da9d95f471cb14c9;p=freeglut diff --git a/src/freeglut_window.c b/src/freeglut_window.c index 6244c61..00bdfdd 100644 --- a/src/freeglut_window.c +++ b/src/freeglut_window.c @@ -827,6 +827,7 @@ void fgSetWindow ( SFG_Window *window ) #if TARGET_HOST_MS_WINDOWS +#if(WINVER >= 0x500) typedef struct { int *x; int *y; @@ -859,7 +860,7 @@ static BOOL CALLBACK m_proc(HMONITOR mon, * this function is only used in fgOpenWindow. Currently it only sets * its output parameters, if the DisplayName is set in fgDisplay * (and if it is able to recognize the display) -*/ + */ static void get_display_origin(int *xp,int *yp) { @@ -872,6 +873,17 @@ static void get_display_origin(int *xp,int *yp) EnumDisplayMonitors(0,0,m_proc,(LPARAM)&st); } } +#else +#pragma message( "-display parameter only works if compiled with WINVER >= 0x0500") + +static void get_display_origin(int *xp,int *yp) +{ + if( fgDisplay.DisplayName ) + { + fgWarning( "for working -display support FreeGLUT must be compiled with WINVER >= 0x0500"); + } +} +#endif #endif @@ -1270,7 +1282,10 @@ void fgCloseWindow( SFG_Window* window ) if( window->Window.Context ) glXDestroyContext( fgDisplay.Display, window->Window.Context ); XFree( window->Window.FBConfig ); - XDestroyWindow( fgDisplay.Display, window->Window.Handle ); + + if( window->Window.Handle ) { + XDestroyWindow( fgDisplay.Display, window->Window.Handle ); + } /* XFlush( fgDisplay.Display ); */ /* XXX Shouldn't need this */ #elif TARGET_HOST_MS_WINDOWS