Formatting (no code changes).
This commit is contained in:
parent
d46b222e08
commit
9b443e5bfd
@ -31,12 +31,9 @@
|
|||||||
#ifndef _platform_h_
|
#ifndef _platform_h_
|
||||||
#define _platform_h_
|
#define _platform_h_
|
||||||
|
|
||||||
|
|
||||||
// This is the X11 version of GLFW
|
// This is the X11 version of GLFW
|
||||||
#define _GLFW_X11
|
#define _GLFW_X11
|
||||||
|
|
||||||
|
|
||||||
// Include files
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
@ -54,21 +51,21 @@
|
|||||||
#error "GLX header version 1.3 or above is required"
|
#error "GLX header version 1.3 or above is required"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( _GLFW_HAS_XF86VIDMODE ) && defined( _GLFW_HAS_XRANDR )
|
#if defined(_GLFW_HAS_XF86VIDMODE) && defined(_GLFW_HAS_XRANDR)
|
||||||
#error "Xf86VidMode and RandR extensions cannot both be enabled"
|
#error "Xf86VidMode and RandR extensions cannot both be enabled"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// With XFree86, we can use the XF86VidMode extension
|
// With XFree86, we can use the XF86VidMode extension
|
||||||
#if defined( _GLFW_HAS_XF86VIDMODE )
|
#if defined(_GLFW_HAS_XF86VIDMODE)
|
||||||
#include <X11/extensions/xf86vmode.h>
|
#include <X11/extensions/xf86vmode.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( _GLFW_HAS_XRANDR )
|
#if defined(_GLFW_HAS_XRANDR)
|
||||||
#include <X11/extensions/Xrandr.h>
|
#include <X11/extensions/Xrandr.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Do we have support for dlopen/dlsym?
|
// Do we have support for dlopen/dlsym?
|
||||||
#if defined( _GLFW_HAS_DLOPEN )
|
#if defined(_GLFW_HAS_DLOPEN)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -80,7 +77,7 @@ typedef intptr_t GLFWintptr;
|
|||||||
#ifndef GLX_SGI_swap_control
|
#ifndef GLX_SGI_swap_control
|
||||||
|
|
||||||
// Function signature for GLX_SGI_swap_control
|
// Function signature for GLX_SGI_swap_control
|
||||||
typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
typedef int (*PFNGLXSWAPINTERVALSGIPROC)(int interval);
|
||||||
|
|
||||||
#endif /*GLX_SGI_swap_control*/
|
#endif /*GLX_SGI_swap_control*/
|
||||||
|
|
||||||
@ -89,13 +86,24 @@ typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
|||||||
|
|
||||||
/* Type definitions for GLX_SGIX_fbconfig */
|
/* Type definitions for GLX_SGIX_fbconfig */
|
||||||
typedef XID GLXFBConfigIDSGIX;
|
typedef XID GLXFBConfigIDSGIX;
|
||||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
|
typedef struct __GLXFBConfigRec* GLXFBConfigSGIX;
|
||||||
|
|
||||||
/* Function signatures for GLX_SGIX_fbconfig */
|
/* Function signatures for GLX_SGIX_fbconfig */
|
||||||
typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
typedef int (*PFNGLXGETFBCONFIGATTRIBSGIXPROC)(Display* dpy,
|
||||||
typedef GLXFBConfigSGIX * ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
|
GLXFBConfigSGIX config,
|
||||||
typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
int attribute,
|
||||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
|
int* value);
|
||||||
|
typedef GLXFBConfigSGIX* (*PFNGLXCHOOSEFBCONFIGSGIXPROC)(Display* dpy,
|
||||||
|
int screen,
|
||||||
|
int* attrib_list,
|
||||||
|
int* nelements);
|
||||||
|
typedef GLXContext (*PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)(Display* dpy,
|
||||||
|
GLXFBConfigSGIX config,
|
||||||
|
int render_type,
|
||||||
|
GLXContext share_list,
|
||||||
|
Bool direct);
|
||||||
|
typedef XVisualInfo* (*PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)(Display* dpy,
|
||||||
|
GLXFBConfigSGIX config);
|
||||||
|
|
||||||
/* Tokens for GLX_SGIX_fbconfig */
|
/* Tokens for GLX_SGIX_fbconfig */
|
||||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||||
@ -125,7 +133,11 @@ typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GL
|
|||||||
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
|
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
|
||||||
|
|
||||||
/* Prototype for glXCreateContextAttribs */
|
/* Prototype for glXCreateContextAttribs */
|
||||||
typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSARBPROC)( Display *display, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display* display,
|
||||||
|
GLXFBConfig config,
|
||||||
|
GLXContext share_context,
|
||||||
|
Bool direct,
|
||||||
|
const int* attrib_list);
|
||||||
|
|
||||||
#endif /*GLX_ARB_create_context*/
|
#endif /*GLX_ARB_create_context*/
|
||||||
|
|
||||||
@ -144,7 +156,7 @@ typedef GLXContext (*PFNGLXCREATECONTEXTATTRIBSARBPROC)( Display *display, GLXFB
|
|||||||
|
|
||||||
#ifndef GL_VERSION_3_0
|
#ifndef GL_VERSION_3_0
|
||||||
|
|
||||||
typedef const GLubyte * (APIENTRY *PFNGLGETSTRINGIPROC) (GLenum, GLuint);
|
typedef const GLubyte* (APIENTRY *PFNGLGETSTRINGIPROC)(GLenum, GLuint);
|
||||||
|
|
||||||
#endif /*GL_VERSION_3_0*/
|
#endif /*GL_VERSION_3_0*/
|
||||||
|
|
||||||
@ -217,7 +229,7 @@ struct _GLFWwin_struct {
|
|||||||
Window window; // Window
|
Window window; // Window
|
||||||
Window root; // Root window for screen
|
Window root; // Root window for screen
|
||||||
int screen; // Screen ID
|
int screen; // Screen ID
|
||||||
XVisualInfo *visual; // Visual for selected GLXFBConfig
|
XVisualInfo* visual; // Visual for selected GLXFBConfig
|
||||||
GLXFBConfigID fbconfigID; // ID of selected GLXFBConfig
|
GLXFBConfigID fbconfigID; // ID of selected GLXFBConfig
|
||||||
GLXContext context; // OpenGL rendering context
|
GLXContext context; // OpenGL rendering context
|
||||||
Atom wmDeleteWindow; // WM_DELETE_WINDOW atom
|
Atom wmDeleteWindow; // WM_DELETE_WINDOW atom
|
||||||
@ -259,10 +271,10 @@ struct _GLFWwin_struct {
|
|||||||
// Fullscreen data
|
// Fullscreen data
|
||||||
struct {
|
struct {
|
||||||
int modeChanged;
|
int modeChanged;
|
||||||
#if defined( _GLFW_HAS_XF86VIDMODE )
|
#if defined(_GLFW_HAS_XF86VIDMODE)
|
||||||
XF86VidModeModeInfo oldMode;
|
XF86VidModeModeInfo oldMode;
|
||||||
#endif
|
#endif
|
||||||
#if defined( _GLFW_HAS_XRANDR )
|
#if defined(_GLFW_HAS_XRANDR)
|
||||||
SizeID oldSizeID;
|
SizeID oldSizeID;
|
||||||
int oldWidth;
|
int oldWidth;
|
||||||
int oldHeight;
|
int oldHeight;
|
||||||
@ -316,7 +328,7 @@ GLFWGLOBAL struct {
|
|||||||
|
|
||||||
// ========= PLATFORM SPECIFIC PART ======================================
|
// ========= PLATFORM SPECIFIC PART ======================================
|
||||||
|
|
||||||
Display *display;
|
Display* display;
|
||||||
|
|
||||||
// Server-side GLX version
|
// Server-side GLX version
|
||||||
int glxMajor, glxMinor;
|
int glxMajor, glxMinor;
|
||||||
@ -341,7 +353,7 @@ GLFWGLOBAL struct {
|
|||||||
|
|
||||||
#if defined(_GLFW_DLOPEN_LIBGL)
|
#if defined(_GLFW_DLOPEN_LIBGL)
|
||||||
struct {
|
struct {
|
||||||
void *libGL; // dlopen handle for libGL.so
|
void* libGL; // dlopen handle for libGL.so
|
||||||
} Libs;
|
} Libs;
|
||||||
#endif
|
#endif
|
||||||
} _glfwLibrary;
|
} _glfwLibrary;
|
||||||
@ -355,9 +367,9 @@ GLFWGLOBAL struct {
|
|||||||
int fd;
|
int fd;
|
||||||
int NumAxes;
|
int NumAxes;
|
||||||
int NumButtons;
|
int NumButtons;
|
||||||
float *Axis;
|
float* Axis;
|
||||||
unsigned char *Button;
|
unsigned char* Button;
|
||||||
} _glfwJoy[ GLFW_JOYSTICK_LAST + 1 ];
|
} _glfwJoy[GLFW_JOYSTICK_LAST + 1];
|
||||||
|
|
||||||
|
|
||||||
//========================================================================
|
//========================================================================
|
||||||
@ -365,20 +377,20 @@ GLFWGLOBAL struct {
|
|||||||
//========================================================================
|
//========================================================================
|
||||||
|
|
||||||
// Time
|
// Time
|
||||||
void _glfwInitTimer( void );
|
void _glfwInitTimer(void);
|
||||||
|
|
||||||
// Fullscreen support
|
// Fullscreen support
|
||||||
int _glfwGetClosestVideoMode( int screen, int *width, int *height, int *rate );
|
int _glfwGetClosestVideoMode(int screen, int* width, int* height, int* rate);
|
||||||
void _glfwSetVideoModeMODE( int screen, int mode, int rate );
|
void _glfwSetVideoModeMODE(int screen, int mode, int rate);
|
||||||
void _glfwSetVideoMode( int screen, int *width, int *height, int *rate );
|
void _glfwSetVideoMode(int screen, int* width, int* height, int* rate);
|
||||||
void _glfwRestoreVideoMode( void );
|
void _glfwRestoreVideoMode(void);
|
||||||
|
|
||||||
// Joystick input
|
// Joystick input
|
||||||
void _glfwInitJoysticks( void );
|
void _glfwInitJoysticks(void);
|
||||||
void _glfwTerminateJoysticks( void );
|
void _glfwTerminateJoysticks(void);
|
||||||
|
|
||||||
// Unicode support
|
// Unicode support
|
||||||
long _glfwKeySym2Unicode( KeySym keysym );
|
long _glfwKeySym2Unicode(KeySym keysym);
|
||||||
|
|
||||||
|
|
||||||
#endif // _platform_h_
|
#endif // _platform_h_
|
||||||
|
Loading…
Reference in New Issue
Block a user