Moving X11-specific code from "freeglut_display.c" into its own file
[freeglut] / src / Common / freeglut_display.c
index f13319c..8264949 100644 (file)
 #include <GL/freeglut.h>\r
 #include "freeglut_internal.h"\r
 \r
+\r
+/* Function prototypes */\r
+extern void fgPlatformGlutSwapBuffers( SFG_PlatformDisplay *pDisplayPtr, SFG_Window* CurrentWindow );\r
+\r
+\r
 /* -- INTERFACE FUNCTIONS -------------------------------------------------- */\r
 \r
 /*\r
@@ -61,11 +66,7 @@ void FGAPIENTRY glutSwapBuffers( void )
     if( ! fgStructure.CurrentWindow->Window.DoubleBuffered )\r
         return;\r
 \r
-#if TARGET_HOST_POSIX_X11\r
-    glXSwapBuffers( fgDisplay.pDisplay.Display, fgStructure.CurrentWindow->Window.Handle );\r
-#elif TARGET_HOST_MS_WINDOWS\r
-    SwapBuffers( fgStructure.CurrentWindow->Window.Device );\r
-#endif\r
+    fgPlatformGlutSwapBuffers( &fgDisplay.pDisplay, fgStructure.CurrentWindow );\r
 \r
     /* GLUT_FPS env var support */\r
     if( fgState.FPSInterval )\r