Putting in the "glutFullScreen" support for Gnome and other X window managers per...
[freeglut] / src / freeglut_internal.h
index 081ae9c..7c71873 100644 (file)
@@ -34,7 +34,7 @@
 
 /* XXX Update these for each release! */
 #define  VERSION_MAJOR 2
-#define  VERSION_MINOR 4
+#define  VERSION_MINOR 6
 #define  VERSION_PATCH 0
 
 /* Freeglut is intended to function under all Unix/X11 and Win32 platforms. */
 */
 #endif
 
+/* Detect both SunPro and gcc compilers on Sun Solaris */
+#if defined (__SVR4) && defined (__sun)
+#   define TARGET_HOST_SOLARIS 1
+#endif
+
 #ifndef TARGET_HOST_MS_WINDOWS
 #   define  TARGET_HOST_MS_WINDOWS 0
 #endif
 #   define  TARGET_HOST_MAC_OSX    0
 #endif
 
+#ifndef  TARGET_HOST_SOLARIS
+#   define  TARGET_HOST_SOLARIS    0
+#endif
+
 /* -- FIXED CONFIGURATION LIMITS ------------------------------------------- */
 
 #define  FREEGLUT_MAX_MENUS         3
 #    ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
 #        include <X11/extensions/xf86vmode.h>
 #    endif
+/* If GLX is too old, we will fail during runtime when multisampling
+   is requested, but at least freeglut compiles. */
+#    ifndef GLX_SAMPLE_BUFFERS
+#        define GLX_SAMPLE_BUFFERS 0x80A8
+#    endif
+#    ifndef GLX_SAMPLES
+#        define GLX_SAMPLES 0x80A9
+#    endif
 
 #endif
 
 /* These files should be available on every platform. */
-#include <GL/gl.h>
-#include <GL/glu.h>
 #include <stdio.h>
 #include <string.h>
 #include <math.h>
@@ -305,6 +320,11 @@ struct tagSFG_State
 
     int              AuxiliaryBufferNumber;  /* Number of auxiliary buffers */
     int              SampleNumber;         /*  Number of samples per pixel  */
+
+    int              MajorVersion;         /* Major OpenGL context version  */
+    int              MinorVersion;         /* Minor OpenGL context version  */
+    int              ContextFlags;         /* OpenGL context flags          */
+    int              ContextProfile;       /* OpenGL context profile        */
 };
 
 /* The structure used by display initialization in freeglut_init.c */
@@ -416,6 +436,8 @@ struct tagSFG_WindowState
     GLboolean       KeyRepeating;       /* Currently in repeat mode          */
 
     GLboolean       NeedToResize;       /* Do we need to resize the window?  */
+
+    GLboolean       IsFullscreen;       /* is the window fullscreen? */
 };
 
 
@@ -544,9 +566,9 @@ enum
     /* Presently ignored */
     CB_Select,
     CB_OverlayDisplay,
-    CB_SpaceMotion,
-    CB_SpaceRotation,
-    CB_SpaceButton,
+    CB_SpaceMotion,     /* presently implemented only on UNIX/X11 */
+    CB_SpaceRotation,   /* presently implemented only on UNIX/X11 */
+    CB_SpaceButton,     /* presently implemented only on UNIX/X11 */
     CB_Dials,
     CB_ButtonBox,
     CB_TabletMotion,
@@ -794,6 +816,7 @@ GLXFBConfig* fgChooseFBConfig( void );
 #if TARGET_HOST_MS_WINDOWS
 LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg,
                                WPARAM wParam, LPARAM lParam );
+void fgNewWGLCreateContext( SFG_Window* window );
 GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,
                               unsigned char layer_type );
 #endif
@@ -832,6 +855,19 @@ int         fgInputDeviceDetect( void );
 void        fgInitialiseInputDevices( void );
 void        fgInputDeviceClose( void );
 
+/* spaceball device functions, defined in freeglut_spaceball.c */
+void        fgInitialiseSpaceball( void );
+void        fgSpaceballClose( void );
+void        fgSpaceballSetWindow( SFG_Window *window );
+
+int         fgHasSpaceball( void );
+int         fgSpaceballNumButtons( void );
+
+#if TARGET_HOST_POSIX_X11
+int         fgIsSpaceballXEvent( const XEvent *ev );
+void        fgSpaceballHandleXEvent( const XEvent *ev );
+#endif
+
 /* Setting the cursor for a given window */
 void fgSetCursor ( SFG_Window *window, int cursorID );
 
@@ -911,6 +947,12 @@ void fgWarning( const char *fmt, ... );
 int fgHintPresent(Window window, Atom property, Atom hint);
 #endif
 
+SFG_Proc fghGetProcAddress( const char *procName );
+
+#if TARGET_HOST_MS_WINDOWS
+extern void (__cdecl *__glutExitFunc)( int return_value );
+#endif
+
 #endif /* FREEGLUT_INTERNAL_H */
 
 /*** END OF FILE ***/