#include "config.h"
#endif
-#include "../include/GL/freeglut.h"
+#include <GL/freeglut.h>
#include "freeglut_internal.h"
/*
pfd.cColorBits = (BYTE) GetDeviceCaps( window->Window.Device, BITSPIXEL );
ppfd = &pfd;
-
+
pixelformat = ChoosePixelFormat( window->Window.Device, ppfd );
if( pixelformat == 0 )
return GL_FALSE;
if ( window )
{
window->Window.Device = GetDC( window->Window.Handle );
- wglMakeCurrent(
- window->Window.Device,
+ wglMakeCurrent(
+ window->Window.Device,
window->Window.Context
);
}
window->Window.VisualInfo = fgChooseVisual( );
else
{
+ /* XXX Why are menus double- and depth-buffered? */
unsigned int current_DisplayMode = fgState.DisplayMode ;
fgState.DisplayMode = GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH ;
window->Window.VisualInfo = fgChooseVisual( );
window->Window.VisualInfo = fgChooseVisual( );
fgState.DisplayMode &= ~GLUT_DOUBLE;
}
-
+
/*
* GLUT also checks for multi-sampling, but I don't see that
* anywhere else in FREEGLUT so I won't bother with it for the moment.
* XXX A: Not appreciably, but it WILL make it easier to debug.
* XXX Try tracing old GLUT and try tracing freeglut. Old GLUT
* XXX turns off events that it doesn't need and is a whole lot
- * XXX more pleasant to trace. (Hint: Think mouse-motion!)
- * XXX
- * XXX It may make a difference in networked environments or on
- * XXX some very slow systems, but I think that that is secondary
- * XXX to making debugging easier.
+ * XXX more pleasant to trace. (Think mouse-motion! Tons of
+ * XXX ``bonus'' GUI events stream in.)
*/
winAttr.event_mask =
StructureNotifyMask | SubstructureNotifyMask | ExposureMask |
);
}
-/* window->Window.Context = fgStructure.MenuContext->Context ; */
+ /* window->Window.Context = fgStructure.MenuContext->Context; */
window->Window.Context = glXCreateContext(
fgDisplay.Display, window->Window.VisualInfo,
NULL, fgState.ForceDirectContext | fgState.TryDirectContext
&wmHints,
NULL
);
-
+
XSetWMProtocols( fgDisplay.Display, window->Window.Handle,
&fgDisplay.DeleteWindow, 1 );
-
+
XMapWindow( fgDisplay.Display, window->Window.Handle );
}
-
+
#elif TARGET_HOST_WIN32
WNDCLASS wc;
- int flags;
+ DWORD flags;
+ DWORD exFlags = 0;
ATOM atom;
freeglut_assert_ready;
-
+
/*
* Grab the window class we have registered on glutInit():
*/
atom = GetClassInfo( fgDisplay.Instance, "FREEGLUT", &wc );
assert( atom != 0 );
-
+
if( gameMode )
{
assert( window->Parent == NULL );
flags = WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE;
if ( window->IsMenu )
- flags |= WS_POPUP ;
+ {
+ flags |= WS_POPUP;
+ exFlags |= WS_EX_TOOLWINDOW;
+ }
else if( window->Parent == NULL )
flags |= WS_OVERLAPPEDWINDOW;
else
flags |= WS_CHILD;
}
- window->Window.Handle = CreateWindow(
+ window->Window.Handle = CreateWindowEx(
+ exFlags,
"FREEGLUT",
title,
flags,
int FGAPIENTRY glutCreateSubWindow( int parentID, int x, int y, int w, int h )
{
int ret = 0;
-
+
if( GL_FALSE == fgStructure.Window->State.IsOffscreen )
{
SFG_Window* window = NULL;
#if TARGET_HOST_UNIX_X11
XTextProperty text;
-
+
text.value = (unsigned char *) title;
text.encoding = XA_STRING;
text.format = 8;
text.nitems = strlen( title );
-
+
XSetWMName(
fgDisplay.Display,
fgStructure.Window->Window.Handle,
&text
);
-
+
XFlush( fgDisplay.Display ); /* XXX Shouldn't need this */
#elif TARGET_HOST_WIN32
#if TARGET_HOST_UNIX_X11
XTextProperty text;
-
+
text.value = (unsigned char *) title;
text.encoding = XA_STRING;
text.format = 8;
#elif TARGET_HOST_WIN32
RECT winRect;
-
+
GetWindowRect( fgStructure.Window->Window.Handle, &winRect );
MoveWindow(
fgStructure.Window->Window.Handle,