mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 13:32:01 +00:00
Formatting.
This commit is contained in:
parent
3817771a40
commit
1bc91bfe5b
@ -66,10 +66,10 @@ typedef intptr_t GLFWintptr;
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
typedef struct _GLFWwindowNS
|
typedef struct _GLFWwindowNS
|
||||||
{
|
{
|
||||||
id object;
|
id object;
|
||||||
id delegate;
|
id delegate;
|
||||||
id view;
|
id view;
|
||||||
unsigned int modifierFlags;
|
unsigned int modifierFlags;
|
||||||
} _GLFWwindowNS;
|
} _GLFWwindowNS;
|
||||||
|
|
||||||
|
|
||||||
@ -79,16 +79,16 @@ typedef struct _GLFWwindowNS
|
|||||||
typedef struct _GLFWlibraryNS
|
typedef struct _GLFWlibraryNS
|
||||||
{
|
{
|
||||||
struct {
|
struct {
|
||||||
double base;
|
double base;
|
||||||
double resolution;
|
double resolution;
|
||||||
} timer;
|
} timer;
|
||||||
|
|
||||||
CGDisplayModeRef previousMode;
|
CGDisplayModeRef previousMode;
|
||||||
CGEventSourceRef eventSource;
|
CGEventSourceRef eventSource;
|
||||||
id delegate;
|
id delegate;
|
||||||
id autoreleasePool;
|
id autoreleasePool;
|
||||||
|
|
||||||
char* clipboardString;
|
char* clipboardString;
|
||||||
} _GLFWlibraryNS;
|
} _GLFWlibraryNS;
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,8 +77,8 @@ typedef int (*PFNGLXSWAPINTERVALMESAPROC)(int);
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
typedef struct _GLFWcontextGLX
|
typedef struct _GLFWcontextGLX
|
||||||
{
|
{
|
||||||
GLXContext context; // OpenGL rendering context
|
GLXContext context; // OpenGL rendering context
|
||||||
XVisualInfo* visual; // Visual for selected GLXFBConfig
|
XVisualInfo* visual; // Visual for selected GLXFBConfig
|
||||||
|
|
||||||
} _GLFWcontextGLX;
|
} _GLFWcontextGLX;
|
||||||
|
|
||||||
@ -102,16 +102,16 @@ typedef struct _GLFWlibraryGLX
|
|||||||
PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX;
|
PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC CreateContextWithConfigSGIX;
|
||||||
PFNGLXGETVISUALFROMFBCONFIGSGIXPROC GetVisualFromFBConfigSGIX;
|
PFNGLXGETVISUALFROMFBCONFIGSGIXPROC GetVisualFromFBConfigSGIX;
|
||||||
PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
|
PFNGLXCREATECONTEXTATTRIBSARBPROC CreateContextAttribsARB;
|
||||||
GLboolean SGIX_fbconfig;
|
GLboolean SGIX_fbconfig;
|
||||||
GLboolean SGI_swap_control;
|
GLboolean SGI_swap_control;
|
||||||
GLboolean EXT_swap_control;
|
GLboolean EXT_swap_control;
|
||||||
GLboolean MESA_swap_control;
|
GLboolean MESA_swap_control;
|
||||||
GLboolean ARB_multisample;
|
GLboolean ARB_multisample;
|
||||||
GLboolean ARB_framebuffer_sRGB;
|
GLboolean ARB_framebuffer_sRGB;
|
||||||
GLboolean ARB_create_context;
|
GLboolean ARB_create_context;
|
||||||
GLboolean ARB_create_context_profile;
|
GLboolean ARB_create_context_profile;
|
||||||
GLboolean ARB_create_context_robustness;
|
GLboolean ARB_create_context_robustness;
|
||||||
GLboolean EXT_create_context_es2_profile;
|
GLboolean EXT_create_context_es2_profile;
|
||||||
|
|
||||||
#if defined(_GLFW_DLOPEN_LIBGL)
|
#if defined(_GLFW_DLOPEN_LIBGL)
|
||||||
void* libGL; // dlopen handle for libGL.so
|
void* libGL; // dlopen handle for libGL.so
|
||||||
|
@ -202,30 +202,30 @@ struct _GLFWwindow
|
|||||||
struct _GLFWwindow* next;
|
struct _GLFWwindow* next;
|
||||||
|
|
||||||
// Window settings and state
|
// Window settings and state
|
||||||
GLboolean iconified; // GL_TRUE if this window is iconified
|
int width, height;
|
||||||
GLboolean closeRequested; // GL_TRUE if this window should be closed
|
int positionX, positionY;
|
||||||
int width, height;
|
GLboolean iconified;
|
||||||
int positionX, positionY;
|
GLboolean resizable;
|
||||||
GLboolean resizable; // GL_TRUE if user may resize this window
|
GLboolean visible;
|
||||||
GLboolean visible; // GL_TRUE if this window is visible
|
GLboolean closeRequested;
|
||||||
void* userPointer;
|
void* userPointer;
|
||||||
_GLFWmonitor* monitor;
|
_GLFWmonitor* monitor;
|
||||||
|
|
||||||
// Window input state
|
// Window input state
|
||||||
GLboolean stickyKeys;
|
GLboolean stickyKeys;
|
||||||
GLboolean stickyMouseButtons;
|
GLboolean stickyMouseButtons;
|
||||||
int cursorPosX, cursorPosY;
|
int cursorPosX, cursorPosY;
|
||||||
int cursorMode;
|
int cursorMode;
|
||||||
double scrollX, scrollY;
|
double scrollX, scrollY;
|
||||||
char mouseButton[GLFW_MOUSE_BUTTON_LAST + 1];
|
char mouseButton[GLFW_MOUSE_BUTTON_LAST + 1];
|
||||||
char key[GLFW_KEY_LAST + 1];
|
char key[GLFW_KEY_LAST + 1];
|
||||||
|
|
||||||
// OpenGL extensions and context attributes
|
// OpenGL extensions and context attributes
|
||||||
int clientAPI;
|
int clientAPI;
|
||||||
int glMajor, glMinor, glRevision;
|
int glMajor, glMinor, glRevision;
|
||||||
GLboolean glForward, glDebug;
|
GLboolean glForward, glDebug;
|
||||||
int glProfile;
|
int glProfile;
|
||||||
int glRobustness;
|
int glRobustness;
|
||||||
PFNGLGETSTRINGIPROC GetStringi;
|
PFNGLGETSTRINGIPROC GetStringi;
|
||||||
|
|
||||||
GLFWwindowposfun windowPosCallback;
|
GLFWwindowposfun windowPosCallback;
|
||||||
@ -252,19 +252,17 @@ struct _GLFWwindow
|
|||||||
*/
|
*/
|
||||||
struct _GLFWmonitor
|
struct _GLFWmonitor
|
||||||
{
|
{
|
||||||
char* name;
|
char* name;
|
||||||
|
|
||||||
GLboolean primary;
|
GLboolean primary;
|
||||||
|
|
||||||
// physical dimensions in millimeters.
|
// Physical dimensions in millimeters.
|
||||||
int physicalWidth;
|
int widthMM, heightMM;
|
||||||
int physicalHeight;
|
// Logical orientation of the screen on the desktop
|
||||||
// logical orientation of the screen on the desktop
|
int positionX, positionY;
|
||||||
int positionX;
|
|
||||||
int positionY;
|
|
||||||
|
|
||||||
GLFWvidmode* modes;
|
GLFWvidmode* modes;
|
||||||
int modeCount;
|
int modeCount;
|
||||||
|
|
||||||
// This is defined in the window API's platform.h
|
// This is defined in the window API's platform.h
|
||||||
_GLFW_PLATFORM_MONITOR_STATE;
|
_GLFW_PLATFORM_MONITOR_STATE;
|
||||||
@ -275,19 +273,19 @@ struct _GLFWmonitor
|
|||||||
*/
|
*/
|
||||||
struct _GLFWlibrary
|
struct _GLFWlibrary
|
||||||
{
|
{
|
||||||
_GLFWhints hints;
|
_GLFWhints hints;
|
||||||
|
|
||||||
_GLFWwindow* windowListHead;
|
_GLFWwindow* windowListHead;
|
||||||
_GLFWwindow* focusedWindow;
|
_GLFWwindow* focusedWindow;
|
||||||
|
|
||||||
_GLFWmonitor** monitors;
|
_GLFWmonitor** monitors;
|
||||||
int monitorCount;
|
int monitorCount;
|
||||||
GLFWmonitorfun monitorCallback;
|
GLFWmonitorfun monitorCallback;
|
||||||
|
|
||||||
GLFWgammaramp currentRamp;
|
GLFWgammaramp currentRamp;
|
||||||
GLFWgammaramp originalRamp;
|
GLFWgammaramp originalRamp;
|
||||||
int originalRampSize;
|
int originalRampSize;
|
||||||
GLboolean rampChanged;
|
GLboolean rampChanged;
|
||||||
|
|
||||||
// This is defined in the window API's platform.h
|
// This is defined in the window API's platform.h
|
||||||
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
|
_GLFW_PLATFORM_LIBRARY_WINDOW_STATE;
|
||||||
@ -706,7 +704,7 @@ GLboolean _glfwIsValidContext(_GLFWwndconfig* wndconfig);
|
|||||||
*/
|
*/
|
||||||
_GLFWmonitor* _glfwCreateMonitor(const char* name,
|
_GLFWmonitor* _glfwCreateMonitor(const char* name,
|
||||||
GLboolean primary,
|
GLboolean primary,
|
||||||
int physicalWidth, int physicalHeight,
|
int widthMM, int heightMM,
|
||||||
int x, int y);
|
int x, int y);
|
||||||
|
|
||||||
/*! @ingroup utility
|
/*! @ingroup utility
|
||||||
|
@ -81,7 +81,7 @@ static int compareVideoModes(const void* firstPtr, const void* secondPtr)
|
|||||||
|
|
||||||
_GLFWmonitor* _glfwCreateMonitor(const char* name,
|
_GLFWmonitor* _glfwCreateMonitor(const char* name,
|
||||||
GLboolean primary,
|
GLboolean primary,
|
||||||
int physicalWidth, int physicalHeight,
|
int widthMM, int heightMM,
|
||||||
int x, int y)
|
int x, int y)
|
||||||
{
|
{
|
||||||
_GLFWmonitor* monitor = (_GLFWmonitor*) calloc(1, sizeof(_GLFWmonitor));
|
_GLFWmonitor* monitor = (_GLFWmonitor*) calloc(1, sizeof(_GLFWmonitor));
|
||||||
@ -93,8 +93,8 @@ _GLFWmonitor* _glfwCreateMonitor(const char* name,
|
|||||||
|
|
||||||
monitor->name = strdup(name);
|
monitor->name = strdup(name);
|
||||||
monitor->primary = primary;
|
monitor->primary = primary;
|
||||||
monitor->physicalWidth = physicalWidth;
|
monitor->widthMM = widthMM;
|
||||||
monitor->physicalHeight = physicalHeight;
|
monitor->heightMM = heightMM;
|
||||||
monitor->positionX = x;
|
monitor->positionX = x;
|
||||||
monitor->positionY = y;
|
monitor->positionY = y;
|
||||||
|
|
||||||
@ -357,9 +357,9 @@ GLFWAPI int glfwGetMonitorParam(GLFWmonitor handle, int param)
|
|||||||
switch (param)
|
switch (param)
|
||||||
{
|
{
|
||||||
case GLFW_MONITOR_WIDTH_MM:
|
case GLFW_MONITOR_WIDTH_MM:
|
||||||
return monitor->physicalWidth;
|
return monitor->widthMM;
|
||||||
case GLFW_MONITOR_HEIGHT_MM:
|
case GLFW_MONITOR_HEIGHT_MM:
|
||||||
return monitor->physicalHeight;
|
return monitor->heightMM;
|
||||||
case GLFW_MONITOR_POS_X:
|
case GLFW_MONITOR_POS_X:
|
||||||
return monitor->positionX;
|
return monitor->positionX;
|
||||||
case GLFW_MONITOR_POS_Y:
|
case GLFW_MONITOR_POS_Y:
|
||||||
|
@ -141,14 +141,14 @@ typedef INT_PTR GLFWintptr;
|
|||||||
typedef struct _GLFWwindowWin32
|
typedef struct _GLFWwindowWin32
|
||||||
{
|
{
|
||||||
// Platform specific window resources
|
// Platform specific window resources
|
||||||
HWND handle; // Window handle
|
HWND handle; // Window handle
|
||||||
DWORD dwStyle; // Window styles used for window creation
|
DWORD dwStyle; // Window styles used for window creation
|
||||||
DWORD dwExStyle; // --"--
|
DWORD dwExStyle; // --"--
|
||||||
|
|
||||||
// Various platform specific internal variables
|
// Various platform specific internal variables
|
||||||
GLboolean cursorCentered;
|
GLboolean cursorCentered;
|
||||||
GLboolean cursorInside;
|
GLboolean cursorInside;
|
||||||
int oldCursorX, oldCursorY;
|
int oldCursorX, oldCursorY;
|
||||||
} _GLFWwindowWin32;
|
} _GLFWwindowWin32;
|
||||||
|
|
||||||
|
|
||||||
@ -157,35 +157,35 @@ typedef struct _GLFWwindowWin32
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
typedef struct _GLFWlibraryWin32
|
typedef struct _GLFWlibraryWin32
|
||||||
{
|
{
|
||||||
HINSTANCE instance; // Instance of the application
|
HINSTANCE instance;
|
||||||
ATOM classAtom; // Window class atom
|
ATOM classAtom;
|
||||||
DWORD foregroundLockTimeout;
|
DWORD foregroundLockTimeout;
|
||||||
char* clipboardString;
|
char* clipboardString;
|
||||||
|
|
||||||
// Default monitor
|
// Default monitor
|
||||||
struct {
|
struct {
|
||||||
GLboolean modeChanged;
|
GLboolean modeChanged;
|
||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
int bitsPerPixel;
|
int bitsPerPixel;
|
||||||
} monitor;
|
} monitor;
|
||||||
|
|
||||||
// Timer data
|
// Timer data
|
||||||
struct {
|
struct {
|
||||||
GLboolean hasPC;
|
GLboolean hasPC;
|
||||||
double resolution;
|
double resolution;
|
||||||
unsigned int t0_32;
|
unsigned int t0_32;
|
||||||
__int64 t0_64;
|
__int64 t0_64;
|
||||||
} timer;
|
} timer;
|
||||||
|
|
||||||
#ifndef _GLFW_NO_DLOAD_WINMM
|
#ifndef _GLFW_NO_DLOAD_WINMM
|
||||||
// winmm.dll
|
// winmm.dll
|
||||||
struct {
|
struct {
|
||||||
HINSTANCE instance;
|
HINSTANCE instance;
|
||||||
JOYGETDEVCAPS_T joyGetDevCaps;
|
JOYGETDEVCAPS_T joyGetDevCaps;
|
||||||
JOYGETPOS_T joyGetPos;
|
JOYGETPOS_T joyGetPos;
|
||||||
JOYGETPOSEX_T joyGetPosEx;
|
JOYGETPOSEX_T joyGetPosEx;
|
||||||
TIMEGETTIME_T timeGetTime;
|
TIMEGETTIME_T timeGetTime;
|
||||||
} winmm;
|
} winmm;
|
||||||
#endif // _GLFW_NO_DLOAD_WINMM
|
#endif // _GLFW_NO_DLOAD_WINMM
|
||||||
|
|
||||||
@ -201,7 +201,7 @@ typedef struct _GLFWlibraryWin32
|
|||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
typedef struct _GLFWmonitorWin32
|
typedef struct _GLFWmonitorWin32
|
||||||
{
|
{
|
||||||
WCHAR* name;
|
WCHAR* name;
|
||||||
|
|
||||||
} _GLFWmonitorWin32;
|
} _GLFWmonitorWin32;
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
{
|
{
|
||||||
XRROutputInfo* oi;
|
XRROutputInfo* oi;
|
||||||
XRRCrtcInfo* ci;
|
XRRCrtcInfo* ci;
|
||||||
int physicalWidth, physicalHeight;
|
int widthMM, heightMM;
|
||||||
|
|
||||||
oi = XRRGetOutputInfo(_glfw.x11.display, sr, sr->outputs[i]);
|
oi = XRRGetOutputInfo(_glfw.x11.display, sr, sr->outputs[i]);
|
||||||
if (oi->connection != RR_Connected)
|
if (oi->connection != RR_Connected)
|
||||||
@ -235,22 +235,20 @@ _GLFWmonitor** _glfwPlatformGetMonitors(int* count)
|
|||||||
|
|
||||||
if (oi->mm_width && oi->mm_height)
|
if (oi->mm_width && oi->mm_height)
|
||||||
{
|
{
|
||||||
physicalWidth = oi->mm_width;
|
widthMM = oi->mm_width;
|
||||||
physicalHeight = oi->mm_height;
|
heightMM = oi->mm_height;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
physicalWidth = DisplayWidthMM(_glfw.x11.display,
|
widthMM = DisplayWidthMM(_glfw.x11.display, _glfw.x11.screen);
|
||||||
_glfw.x11.screen);
|
heightMM = DisplayHeightMM(_glfw.x11.display, _glfw.x11.screen);
|
||||||
physicalHeight = DisplayHeightMM(_glfw.x11.display,
|
|
||||||
_glfw.x11.screen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ci = XRRGetCrtcInfo(_glfw.x11.display, sr, oi->crtc);
|
ci = XRRGetCrtcInfo(_glfw.x11.display, sr, oi->crtc);
|
||||||
|
|
||||||
monitors[found] = _glfwCreateMonitor(oi->name,
|
monitors[found] = _glfwCreateMonitor(oi->name,
|
||||||
sr->outputs[i] == primary,
|
sr->outputs[i] == primary,
|
||||||
physicalWidth, physicalHeight,
|
widthMM, heightMM,
|
||||||
ci->x, ci->y);
|
ci->x, ci->y);
|
||||||
|
|
||||||
XRRFreeCrtcInfo(ci);
|
XRRFreeCrtcInfo(ci);
|
||||||
|
@ -97,21 +97,21 @@ typedef intptr_t GLFWintptr;
|
|||||||
typedef struct _GLFWwindowX11
|
typedef struct _GLFWwindowX11
|
||||||
{
|
{
|
||||||
// Platform specific window resources
|
// Platform specific window resources
|
||||||
Colormap colormap; // Window colormap
|
Colormap colormap; // Window colormap
|
||||||
Window handle; // Window handle
|
Window handle; // Window handle
|
||||||
|
|
||||||
// Various platform specific internal variables
|
// Various platform specific internal variables
|
||||||
GLboolean overrideRedirect; // True if window is OverrideRedirect
|
GLboolean overrideRedirect; // True if window is OverrideRedirect
|
||||||
GLboolean cursorGrabbed; // True if cursor is currently grabbed
|
GLboolean cursorGrabbed; // True if cursor is currently grabbed
|
||||||
GLboolean cursorHidden; // True if cursor is currently hidden
|
GLboolean cursorHidden; // True if cursor is currently hidden
|
||||||
GLboolean cursorCentered; // True if cursor was moved since last poll
|
GLboolean cursorCentered; // True if cursor was moved since last poll
|
||||||
int cursorPosX, cursorPosY;
|
int cursorPosX, cursorPosY;
|
||||||
|
|
||||||
// Window position hint (commited the first time the window is shown)
|
// Window position hint (commited the first time the window is shown)
|
||||||
GLboolean windowPosSet; // False until the window position has
|
GLboolean windowPosSet; // False until the window position has
|
||||||
// been set
|
// been set
|
||||||
int positionX; // The window position to be set the
|
int positionX; // The window position to be set the
|
||||||
int positionY; // first time the window is shown
|
int positionY; // first time the window is shown
|
||||||
|
|
||||||
} _GLFWwindowX11;
|
} _GLFWwindowX11;
|
||||||
|
|
||||||
@ -196,23 +196,23 @@ typedef struct _GLFWlibraryX11
|
|||||||
|
|
||||||
// Selection data
|
// Selection data
|
||||||
struct {
|
struct {
|
||||||
Atom atom;
|
Atom atom;
|
||||||
Atom formats[_GLFW_CLIPBOARD_FORMAT_COUNT];
|
Atom formats[_GLFW_CLIPBOARD_FORMAT_COUNT];
|
||||||
char* string;
|
char* string;
|
||||||
Atom target;
|
Atom target;
|
||||||
Atom targets;
|
Atom targets;
|
||||||
Atom property;
|
Atom property;
|
||||||
int status;
|
int status;
|
||||||
} selection;
|
} selection;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
int present;
|
int present;
|
||||||
int fd;
|
int fd;
|
||||||
int numAxes;
|
int numAxes;
|
||||||
int numButtons;
|
int numButtons;
|
||||||
float* axis;
|
float* axis;
|
||||||
unsigned char* button;
|
unsigned char* button;
|
||||||
char* name;
|
char* name;
|
||||||
} joystick[GLFW_JOYSTICK_LAST + 1];
|
} joystick[GLFW_JOYSTICK_LAST + 1];
|
||||||
|
|
||||||
} _GLFWlibraryX11;
|
} _GLFWlibraryX11;
|
||||||
@ -224,9 +224,9 @@ typedef struct _GLFWlibraryX11
|
|||||||
typedef struct _GLFWmonitorX11
|
typedef struct _GLFWmonitorX11
|
||||||
{
|
{
|
||||||
#if defined(_GLFW_HAS_XRANDR)
|
#if defined(_GLFW_HAS_XRANDR)
|
||||||
XRROutputInfo* output;
|
XRROutputInfo* output;
|
||||||
#else
|
#else
|
||||||
int dummy;
|
int dummy;
|
||||||
#endif /*_GLFW_HAS_XRANDR*/
|
#endif /*_GLFW_HAS_XRANDR*/
|
||||||
|
|
||||||
} _GLFWmonitorX11;
|
} _GLFWmonitorX11;
|
||||||
|
Loading…
Reference in New Issue
Block a user