# define TARGET_HOST_UNIX_X11 0
# define TARGET_HOST_WIN32 0
# define TARGET_HOST_WINCE 1
-#elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
+#elif defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__WATCOMC__)
# define TARGET_HOST_UNIX_X11 0
# define TARGET_HOST_WIN32 1
# define TARGET_HOST_WINCE 0
#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)
+#if defined(_MSC_VER) || defined(__WATCOMC__)
#define strdup _strdup
#endif
-/* Those files should be available on every platform. */
+/* 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>
#include <stdlib.h>
+
+/* These are included based on autoconf directives. */
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
# define FALSE 0
#endif
+/* General defines */
+
+#define INVALID_MODIFIERS 0xffffffff
+
/* -- GLOBAL TYPE DEFINITIONS ---------------------------------------------- */
/* Freeglut callbacks type definitions */
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 */
int DisplayPointerX; /* saved X location of the pointer */
int DisplayPointerY; /* saved Y location of the pointer */
-#endif
+#endif /* X_XF86VidModeGetModeLine */
#elif TARGET_HOST_WIN32 || TARGET_HOST_WINCE
HINSTANCE Instance; /* The application's instance */
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 */
typedef struct tagSFG_Structure SFG_Structure;
struct tagSFG_Structure
{
- SFG_List Windows; /* The global windows list */
- SFG_List Menus; /* The global menus list */
+ SFG_List Windows; /* The global windows list */
+ SFG_List Menus; /* The global menus list */
SFG_List WindowsToDestroy;
- SFG_Window* CurrentWindow; /* The currently set window */
- SFG_Menu* CurrentMenu; /* Same, but menu... */
+ SFG_Window* CurrentWindow; /* The currently set window */
+ SFG_Menu* CurrentMenu; /* Same, but menu... */
- SFG_MenuContext* MenuContext; /* OpenGL rendering context for menus */
+ SFG_MenuContext* MenuContext; /* OpenGL rendering context for menus */
- SFG_Window* GameMode; /* The game mode window */
+ SFG_Window* GameModeWindow; /* The game mode window */
- int WindowID; /* The new current window ID */
- int MenuID; /* The new current menu ID */
+ int WindowID; /* The new current window ID */
+ int MenuID; /* The new current menu ID */
};
/*
void fgJoystickClose( void );
void fgJoystickPollWindow( SFG_Window* window );
-/* More joystick functions. Should these go into the API? */
-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 );