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