Formatting.

This commit is contained in:
Camilla Berglund 2013-01-02 16:48:02 +01:00
parent 3817771a40
commit 1bc91bfe5b
7 changed files with 122 additions and 126 deletions

View File

@ -202,12 +202,12 @@ 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
GLboolean closeRequested; // GL_TRUE if this window should be closed
int width, height; int width, height;
int positionX, positionY; int positionX, positionY;
GLboolean resizable; // GL_TRUE if user may resize this window GLboolean iconified;
GLboolean visible; // GL_TRUE if this window is visible GLboolean resizable;
GLboolean visible;
GLboolean closeRequested;
void* userPointer; void* userPointer;
_GLFWmonitor* monitor; _GLFWmonitor* monitor;
@ -256,12 +256,10 @@ struct _GLFWmonitor
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;
@ -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

View File

@ -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:

View File

@ -157,8 +157,8 @@ 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;

View File

@ -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);