#define GLUT_STROKE_FONT_DRAW_JOIN_DOTS 0x0206 /* Draw dots between line segments of stroke fonts? */
+#define GLUT_ALLOW_NEGATIVE_WINDOW_POSITION 0x0207 /* GLUT doesn't allow negative window positions by default */
+
/*
* New tokens for glutInitDisplayMode.
* Only one GLUT_AUXn bit may be used at a time.
4, /* SampleNumber */
GL_FALSE, /* SkipStaleMotion */
GL_FALSE, /* StrokeFontDrawJoinDots */
+ GL_FALSE, /* AllowNegativeWindowPosition */
1, /* OpenGL context MajorVersion */
0, /* OpenGL context MinorVersion */
0, /* OpenGL ContextFlags */
* size.
*/
- if (geometry )
+ if ( geometry )
{
unsigned int parsedWidth, parsedHeight;
int mask = XParseGeometry( geometry,
if( (mask & (WidthValue|HeightValue)) == (WidthValue|HeightValue) )
fgState.Size.Use = GL_TRUE;
- if( mask & XNegative )
+ if( ( mask & XNegative ) && !fgState.AllowNegativeWindowPosition )
fgState.Position.X += fgDisplay.ScreenWidth - fgState.Size.X;
- if( mask & YNegative )
+ if( ( mask & YNegative ) && !fgState.AllowNegativeWindowPosition )
fgState.Position.Y += fgDisplay.ScreenHeight - fgState.Size.Y;
if( (mask & (XValue|YValue)) == (XValue|YValue) )
fgState.Position.X = x;
fgState.Position.Y = y;
- if( ( x >= 0 ) && ( y >= 0 ) )
+ if( ( ( x >= 0 ) && ( y >= 0 ) ) || fgState.AllowNegativeWindowPosition )
fgState.Position.Use = GL_TRUE;
else
fgState.Position.Use = GL_FALSE;
GLboolean SkipStaleMotion; /* skip stale motion events */
GLboolean StrokeFontDrawJoinDots;/* Draw dots between line segments of stroke fonts? */
+ GLboolean AllowNegativeWindowPosition; /* GLUT, by default, doesn't allow negative window positions. Enable it? */
int MajorVersion; /* Major OpenGL context version */
int MinorVersion; /* Minor OpenGL context version */
fgState.StrokeFontDrawJoinDots = !!value;
break;
+ case GLUT_ALLOW_NEGATIVE_WINDOW_POSITION:
+ fgState.AllowNegativeWindowPosition = !!value;
+ break;
+
default:
fgWarning( "glutSetOption(): missing enum handle %d", eWhat );
break;
case GLUT_STROKE_FONT_DRAW_JOIN_DOTS:
return fgState.StrokeFontDrawJoinDots;
+ case GLUT_ALLOW_NEGATIVE_WINDOW_POSITION:
+ return fgState.AllowNegativeWindowPosition;
+
default:
return fgPlatformGlutGet ( eWhat );
break;