Changing a comment ... nothing big.
[freeglut] / src / freeglut_internal.h
index 0226214..8182f36 100644 (file)
@@ -34,7 +34,7 @@
 
 /* XXX Update these for each release! */
 #define  VERSION_MAJOR 2
-#define  VERSION_MINOR 2
+#define  VERSION_MINOR 4
 #define  VERSION_PATCH 0
 
 /* Freeglut is meant to be available under all Unix/X11 and Win32 platforms. */
 #include <windowsx.h>
 #include <mmsystem.h>
 #include <TCHAR.H>
+
+/* TODO: MinGW is lacking a prototype, this should better be handled via autoconf! */
+#ifndef ChangeDisplaySettingsEx
+LONG WINAPI ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPVOID);
+LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
+#ifdef UNICODE
+#define ChangeDisplaySettingsEx ChangeDisplaySettingsExW
+#else
+#define ChangeDisplaySettingsEx ChangeDisplaySettingsExA
+#endif
+#endif
 #endif
 
 #if defined(_MSC_VER)
 #    define  FALSE  0
 #endif
 
+#define INVALID_MODIFIERS 0xffffffff
+
 /* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
 
 /* Freeglut callbacks type definitions */
@@ -244,6 +257,7 @@ struct tagSFG_State
     fgExecutionState ExecState;           /* Used for GLUT termination       */
     char            *ProgramName;         /* Name of the invoking program    */
     GLboolean        JoysticksInitialised;  /* Only initialize if application calls for them */
+    GLboolean        InputDevsInitialised;  /* Only initialize if application calls for them */
 };
 
 /* The structure used by display initialization in freeglut_init.c */
@@ -323,8 +337,6 @@ struct tagSFG_Context
 
 #if TARGET_HOST_UNIX_X11
     XVisualInfo*    VisualInfo;      /* The window's visual information     */
-    Pixmap          Pixmap;          /* Used for offscreen rendering        */
-    /* GLXPixmap      GLXPixMap; */  /* Used for offscreen rendering        */
 #elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
     HDC             Device;          /* The window's device context         */
 #endif
@@ -387,8 +399,8 @@ typedef void (*SFG_Proc)();
 #define SET_WCB(window,cbname,func)                            \
 do                                                             \
 {                                                              \
-    if( FETCH_WCB( window, cbname ) != func )                  \
-        (((window).CallBacks[CB_ ## cbname]) = (SFG_Proc) func); \
+    if( FETCH_WCB( window, cbname ) != (SFG_Proc)(func) )      \
+        (((window).CallBacks[CB_ ## cbname]) = (SFG_Proc)(func)); \
 } while( 0 )
 
 /*
@@ -502,10 +514,10 @@ typedef struct tagSFG_MenuContext SFG_MenuContext;
 struct tagSFG_MenuContext
 {
 #if TARGET_HOST_UNIX_X11
-    XVisualInfo*        VisualInfo;       /* The window's visual information */
+    XVisualInfo*        MVisualInfo;      /* The window's visual information */
 #endif
 
-    SFG_WindowContextType Context;        /* The menu window's WGL context   */
+    SFG_WindowContextType MContext;       /* The menu window's WGL context   */
 };
 
 /* This structure describes a menu */
@@ -545,6 +557,8 @@ struct tagSFG_MenuEntry
 /*
  * A window, making part of freeglut windows hierarchy.
  * Should be kept portable.
+ *
+ * NOTE that ActiveMenu is set to menu itself if the window is a menu.
  */
 struct tagSFG_Window
 {
@@ -772,6 +786,11 @@ int  glutJoystickGetNumAxes( int ident );
 int  glutJoystickGetNumButtons( int ident );
 int  glutJoystickNotWorking( int ident );
 
+/* InputDevice Initialisation and Closure */
+int         fgInputDeviceDetect( void );
+void        fgInitialiseInputDevices( void );
+void        fgInputDeviceClose( void );
+
 /* Setting the cursor for a given window */
 void fgSetCursor ( SFG_Window *window, int cursorID );
 
@@ -815,6 +834,7 @@ SFG_Menu* fgMenuByID( int menuID );
  * The menu activation and deactivation the code. This is the meat
  * of the menu user interface handling code...
  */
+void fgUpdateMenuHighlight ( SFG_Menu *menu );
 GLboolean fgCheckActiveMenu ( SFG_Window *window, int button, GLboolean pressed,
                               int mouse_x, int mouse_y );
 void fgDeactivateMenu( SFG_Window *window );