Splitting platform-specific code out of "fgJoystickClose" function
[freeglut] / src / Common / freeglut_internal.h
index 7697094..e4b9d8f 100644 (file)
@@ -214,6 +214,7 @@ LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
 \r
 /* Platform-specific includes */\r
 #if TARGET_HOST_POSIX_X11\r
+\r
 typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay;\r
 struct tagSFG_PlatformDisplay\r
 {\r
@@ -247,6 +248,21 @@ struct tagSFG_PlatformDisplay
     int             DisplayPointerY;    /* saved Y location of the pointer   */\r
 };\r
 \r
+\r
+/*\r
+ * Make "freeglut" window handle and context types so that we don't need so\r
+ * much conditionally-compiled code later in the library.\r
+ */\r
+typedef Window     SFG_WindowHandleType ;\r
+typedef GLXContext SFG_WindowContextType ;\r
+typedef struct tagSFG_PlatformContext SFG_PlatformContext;\r
+struct tagSFG_PlatformContext\r
+{\r
+    GLXFBConfig*    FBConfig;        /* The window's FBConfig               */\r
+};\r
+\r
+\r
+\r
 #endif\r
 #if TARGET_HOST_MS_WINDOWS\r
 #include "../mswin/freeglut_internal_mswin.h"\r
@@ -419,22 +435,6 @@ struct tagSFG_Timer
 };\r
 \r
 /*\r
- * Make "freeglut" window handle and context types so that we don't need so\r
- * much conditionally-compiled code later in the library.\r
- */\r
-#if TARGET_HOST_POSIX_X11\r
-\r
-typedef Window     SFG_WindowHandleType ;\r
-typedef GLXContext SFG_WindowContextType ;\r
-\r
-#elif TARGET_HOST_MS_WINDOWS\r
-\r
-typedef HWND    SFG_WindowHandleType ;\r
-typedef HGLRC   SFG_WindowContextType ;\r
-\r
-#endif\r
-\r
-/*\r
  * A window and its OpenGL context. The contents of this structure\r
  * are highly dependant on the target operating system we aim at...\r
  */\r
@@ -444,11 +444,7 @@ struct tagSFG_Context
     SFG_WindowHandleType  Handle;    /* The window's handle                 */\r
     SFG_WindowContextType Context;   /* The window's OpenGL/WGL context     */\r
 \r
-#if TARGET_HOST_POSIX_X11\r
-    GLXFBConfig*    FBConfig;        /* The window's FBConfig               */\r
-#elif TARGET_HOST_MS_WINDOWS\r
-    HDC             Device;          /* The window's device context         */\r
-#endif\r
+       SFG_PlatformContext pContext;    /* The window's FBConfig (X11) or device context (Windows) */\r
 \r
     int             DoubleBuffered;  /* Treat the window as double-buffered */\r
 };\r
@@ -995,10 +991,6 @@ int fgHintPresent(Window window, Atom property, Atom hint);
 \r
 SFG_Proc fghGetProcAddress( const char *procName );\r
 \r
-#if TARGET_HOST_MS_WINDOWS\r
-extern void (__cdecl *__glutExitFunc)( int return_value );\r
-#endif\r
-\r
 #endif /* FREEGLUT_INTERNAL_H */\r
 \r
 /*** END OF FILE ***/\r