projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding multitouch capability per e-mail from Florian Echtler dated 3/17/11 12:07 PM
[freeglut]
/
src
/
freeglut_state.c
diff --git
a/src/freeglut_state.c
b/src/freeglut_state.c
index
cca7b92
..
9126c4f
100644
(file)
--- a/
src/freeglut_state.c
+++ b/
src/freeglut_state.c
@@
-64,6
+64,16
@@
static int fghGetConfig( int attribute )
}
#endif
}
#endif
+/* Check if the window is in full screen state. */
+static int fghCheckFullScreen(void)
+{
+#if TARGET_HOST_POSIX_X11
+ return fgStructure.CurrentWindow->State.IsFullscreen;
+#else
+ return 0;
+#endif
+}
+
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
/*
/* -- INTERFACE FUNCTIONS -------------------------------------------------- */
/*
@@
-179,6
+189,10
@@
int FGAPIENTRY glutGet( GLenum eWhat )
case GLUT_INIT_WINDOW_HEIGHT: return fgState.Size.Use ?
fgState.Size.Y : -1 ;
case GLUT_INIT_DISPLAY_MODE: return fgState.DisplayMode ;
case GLUT_INIT_WINDOW_HEIGHT: return fgState.Size.Use ?
fgState.Size.Y : -1 ;
case GLUT_INIT_DISPLAY_MODE: return fgState.DisplayMode ;
+ case GLUT_INIT_MAJOR_VERSION: return fgState.MajorVersion ;
+ case GLUT_INIT_MINOR_VERSION: return fgState.MinorVersion ;
+ case GLUT_INIT_FLAGS: return fgState.ContextFlags ;
+ case GLUT_INIT_PROFILE: return fgState.ContextProfile ;
#if TARGET_HOST_POSIX_X11
/*
#if TARGET_HOST_POSIX_X11
/*
@@
-306,7
+320,7
@@
int FGAPIENTRY glutGet( GLenum eWhat )
GLXFBConfig * fbconfig;
int isPossible;
GLXFBConfig * fbconfig;
int isPossible;
- fbconfig = fgChooseFBConfig();
+ fbconfig = fgChooseFBConfig(NULL);
if (fbconfig == NULL)
{
if (fbconfig == NULL)
{
@@
-336,16
+350,28
@@
int FGAPIENTRY glutGet( GLenum eWhat )
/* Handle the OpenGL inquiries */
case GLUT_WINDOW_RGBA:
/* Handle the OpenGL inquiries */
case GLUT_WINDOW_RGBA:
+#if defined(_WIN32_WCE)
+ boolValue = (GLboolean)0; /* WinCE doesn't support this feature */
+#else
glGetBooleanv ( GL_RGBA_MODE, &boolValue );
returnValue = boolValue ? 1 : 0;
glGetBooleanv ( GL_RGBA_MODE, &boolValue );
returnValue = boolValue ? 1 : 0;
+#endif
return returnValue;
case GLUT_WINDOW_DOUBLEBUFFER:
return returnValue;
case GLUT_WINDOW_DOUBLEBUFFER:
+#if defined(_WIN32_WCE)
+ boolValue = (GLboolean)0; /* WinCE doesn't support this feature */
+#else
glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue );
returnValue = boolValue ? 1 : 0;
glGetBooleanv ( GL_DOUBLEBUFFER, &boolValue );
returnValue = boolValue ? 1 : 0;
+#endif
return returnValue;
case GLUT_WINDOW_STEREO:
return returnValue;
case GLUT_WINDOW_STEREO:
+#if defined(_WIN32_WCE)
+ boolValue = (GLboolean)0; /* WinCE doesn't support this feature */
+#else
glGetBooleanv ( GL_STEREO, &boolValue );
returnValue = boolValue ? 1 : 0;
glGetBooleanv ( GL_STEREO, &boolValue );
returnValue = boolValue ? 1 : 0;
+#endif
return returnValue;
case GLUT_WINDOW_RED_SIZE:
return returnValue;
case GLUT_WINDOW_RED_SIZE:
@@
-361,16
+387,32
@@
int FGAPIENTRY glutGet( GLenum eWhat )
glGetIntegerv ( GL_ALPHA_BITS, &returnValue );
return returnValue;
case GLUT_WINDOW_ACCUM_RED_SIZE:
glGetIntegerv ( GL_ALPHA_BITS, &returnValue );
return returnValue;
case GLUT_WINDOW_ACCUM_RED_SIZE:
+#if defined(_WIN32_WCE)
+ returnValue = 0; /* WinCE doesn't support this feature */
+#else
glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue );
glGetIntegerv ( GL_ACCUM_RED_BITS, &returnValue );
+#endif
return returnValue;
case GLUT_WINDOW_ACCUM_GREEN_SIZE:
return returnValue;
case GLUT_WINDOW_ACCUM_GREEN_SIZE:
+#if defined(_WIN32_WCE)
+ returnValue = 0; /* WinCE doesn't support this feature */
+#else
glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue );
glGetIntegerv ( GL_ACCUM_GREEN_BITS, &returnValue );
+#endif
return returnValue;
case GLUT_WINDOW_ACCUM_BLUE_SIZE:
return returnValue;
case GLUT_WINDOW_ACCUM_BLUE_SIZE:
+#if defined(_WIN32_WCE)
+ returnValue = 0; /* WinCE doesn't support this feature */
+#else
glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue );
glGetIntegerv ( GL_ACCUM_BLUE_BITS, &returnValue );
+#endif
return returnValue;
case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
return returnValue;
case GLUT_WINDOW_ACCUM_ALPHA_SIZE:
+#if defined(_WIN32_WCE)
+ returnValue = 0; /* WinCE doesn't support this feature */
+#else
glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue );
glGetIntegerv ( GL_ACCUM_ALPHA_BITS, &returnValue );
+#endif
return returnValue;
case GLUT_WINDOW_DEPTH_SIZE:
glGetIntegerv ( GL_DEPTH_BITS, &returnValue );
return returnValue;
case GLUT_WINDOW_DEPTH_SIZE:
glGetIntegerv ( GL_DEPTH_BITS, &returnValue );
@@
-510,7
+552,15
@@
int FGAPIENTRY glutGet( GLenum eWhat )
case GLUT_DIRECT_RENDERING:
return fgState.DirectContext;
case GLUT_DIRECT_RENDERING:
return fgState.DirectContext;
- break;
+
+ case GLUT_FULL_SCREEN:
+ return fghCheckFullScreen();
+
+ case GLUT_AUX:
+ return fgState.AuxiliaryBufferNumber;
+
+ case GLUT_MULTISAMPLE:
+ return fgState.SampleNumber;
default:
fgWarning( "glutGet(): missing enum handle %d", eWhat );
default:
fgWarning( "glutGet(): missing enum handle %d", eWhat );
@@
-611,10
+661,14
@@
int FGAPIENTRY glutDeviceGet( GLenum eWhat )
return 0;
case GLUT_HAS_SPACEBALL:
return 0;
case GLUT_HAS_SPACEBALL:
+ return fgHasSpaceball();
+
case GLUT_HAS_TABLET:
return 0;
case GLUT_NUM_SPACEBALL_BUTTONS:
case GLUT_HAS_TABLET:
return 0;
case GLUT_NUM_SPACEBALL_BUTTONS:
+ return fgSpaceballNumButtons();
+
case GLUT_NUM_TABLET_BUTTONS:
return 0;
case GLUT_NUM_TABLET_BUTTONS:
return 0;