\r
#define INVALID_MODIFIERS 0xffffffff\r
\r
+\r
+\r
+/* Platform-specific includes */\r
+#if TARGET_HOST_POSIX_X11\r
+\r
+typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay;\r
+struct tagSFG_PlatformDisplay\r
+{\r
+ Display* Display; /* The display we are being run in. */\r
+ int Screen; /* The screen we are about to use. */\r
+ Window RootWindow; /* The screen's root window. */\r
+ int Connection; /* The display's connection number */\r
+ Atom DeleteWindow; /* The window deletion atom */\r
+ Atom State; /* The state atom */\r
+ Atom StateFullScreen; /* The full screen atom */\r
+\r
+#ifdef HAVE_X11_EXTENSIONS_XRANDR_H\r
+ int prev_xsz, prev_ysz;\r
+ int prev_refresh;\r
+ int prev_size_valid;\r
+#endif /* HAVE_X11_EXTENSIONS_XRANDR_H */\r
+\r
+#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H\r
+ /*\r
+ * XF86VidMode may be compilable even if it fails at runtime. Therefore,\r
+ * the validity of the VidMode has to be tracked\r
+ */\r
+ int DisplayModeValid; /* Flag that indicates runtime status*/\r
+ XF86VidModeModeLine DisplayMode; /* Current screen's display settings */\r
+ int DisplayModeClock; /* The display mode's refresh rate */\r
+ int DisplayViewPortX; /* saved X location of the viewport */\r
+ int DisplayViewPortY; /* saved Y location of the viewport */\r
+#endif /* HAVE_X11_EXTENSIONS_XF86VMODE_H */\r
+\r
+ int DisplayPointerX; /* saved X location of the pointer */\r
+ 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
+\r
+\r
+#endif\r
+#if TARGET_HOST_MS_WINDOWS\r
+#include "../mswin/freeglut_internal_mswin.h"\r
+#endif\r
+\r
+\r
/* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */\r
\r
/* Freeglut callbacks type definitions */\r
typedef struct tagSFG_Display SFG_Display;\r
struct tagSFG_Display\r
{\r
-#if TARGET_HOST_POSIX_X11\r
- Display* Display; /* The display we are being run in. */\r
- int Screen; /* The screen we are about to use. */\r
- Window RootWindow; /* The screen's root window. */\r
- int Connection; /* The display's connection number */\r
- Atom DeleteWindow; /* The window deletion atom */\r
- Atom State; /* The state atom */\r
- Atom StateFullScreen; /* The full screen atom */\r
-\r
-#ifdef HAVE_X11_EXTENSIONS_XRANDR_H\r
- int prev_xsz, prev_ysz;\r
- int prev_refresh;\r
- int prev_size_valid;\r
-#endif /* HAVE_X11_EXTENSIONS_XRANDR_H */\r
-\r
-#ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H\r
- /*\r
- * XF86VidMode may be compilable even if it fails at runtime. Therefore,\r
- * the validity of the VidMode has to be tracked\r
- */\r
- int DisplayModeValid; /* Flag that indicates runtime status*/\r
- XF86VidModeModeLine DisplayMode; /* Current screen's display settings */\r
- int DisplayModeClock; /* The display mode's refresh rate */\r
- int DisplayViewPortX; /* saved X location of the viewport */\r
- int DisplayViewPortY; /* saved Y location of the viewport */\r
-#endif /* HAVE_X11_EXTENSIONS_XF86VMODE_H */\r
-\r
- int DisplayPointerX; /* saved X location of the pointer */\r
- int DisplayPointerY; /* saved Y location of the pointer */\r
-\r
-#elif TARGET_HOST_MS_WINDOWS\r
- HINSTANCE Instance; /* The application's instance */\r
- DEVMODE DisplayMode; /* Desktop's display settings */\r
- char *DisplayName; /* Display name for multi display support*/ \r
-\r
-#endif\r
+ SFG_PlatformDisplay pDisplay;\r
\r
int ScreenWidth; /* The screen's width in pixels */\r
int ScreenHeight; /* The screen's height in pixels */\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
-#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
void fgCreateStructure( void );\r
void fgDestroyStructure( void );\r
\r
-/* A helper function to check if a display mode is possible to use */\r
-#if TARGET_HOST_POSIX_X11\r
-GLXFBConfig* fgChooseFBConfig( int* numcfgs );\r
-#endif\r
-\r
-/* The window procedure for Win32 events handling */\r
-#if TARGET_HOST_MS_WINDOWS\r
-LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg,\r
- WPARAM wParam, LPARAM lParam );\r
-void fgNewWGLCreateContext( SFG_Window* window );\r
-GLboolean fgSetupPixelFormat( SFG_Window* window, GLboolean checkOnly,\r
- unsigned char layer_type );\r
-#endif\r
-\r
/*\r
* Window creation, opening, closing and destruction.\r
* Also CallBack clearing/initialization.\r
void fgEnumSubWindows( SFG_Window* window, FGCBenumerator enumCallback,\r
SFG_Enumerator* enumerator );\r
\r
-#if TARGET_HOST_MS_WINDOWS\r
-/* \r
- * Helper functions for getting client area from the window rect\r
- * and the window rect from the client area given the style of the window\r
- * (or a valid window pointer from which the style can be queried).\r
- */\r
-void fghComputeWindowRectFromClientArea_UseStyle ( const DWORD windowStyle , RECT *clientRect, BOOL posIsOutside );\r
-void fghComputeWindowRectFromClientArea_QueryWindow( const SFG_Window *window, RECT *clientRect, BOOL posIsOutside );\r
-void fghComputeClientAreaFromWindowRect ( const SFG_Window *window, RECT *windowRect, BOOL wantPosOutside );\r
-RECT fghGetClientArea ( const SFG_Window *window, BOOL wantPosOutside );\r
-void fghGetBorderWidth(const DWORD windowStyle, int* xBorderWidth, int* yBorderWidth);\r
-#endif\r
-\r
/*\r
* fgWindowByHandle returns a (SFG_Window *) value pointing to the\r
* first window in the queue matching the specified window handle.\r