Added: Resolution to startup output
Changed: Fixed GetMousePosition Changed: Fixed SetMousePosition ~g2k
This commit is contained in:
@@ -286,6 +286,7 @@ bool OpenArena::Window::Open()
|
|||||||
bpp = (char)depth;
|
bpp = (char)depth;
|
||||||
height = (short)twidth;
|
height = (short)twidth;
|
||||||
width = (short)theight;
|
width = (short)theight;
|
||||||
|
printf("Resolution %dx%d\n", twidth, theight);
|
||||||
printf("Depth %d\n", bpp);
|
printf("Depth %d\n", bpp);
|
||||||
if(glXIsDirect(display, hRC))
|
if(glXIsDirect(display, hRC))
|
||||||
{
|
{
|
||||||
@@ -396,7 +397,6 @@ Vec2i OpenArena::Window::GetMousePosition()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
printf("X:%d, Root X:%d\n", mouseX, rootX);
|
|
||||||
return Vec2i(mouseX, mouseY);
|
return Vec2i(mouseX, mouseY);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -410,10 +410,8 @@ Vec2i OpenArena::Window::GetMousePosition()
|
|||||||
void OpenArena::Window::SetMousePosition(Vec2i pos)
|
void OpenArena::Window::SetMousePosition(Vec2i pos)
|
||||||
{
|
{
|
||||||
#ifdef __linux
|
#ifdef __linux
|
||||||
Vec2i current = GetMousePosition();
|
|
||||||
Vec2i middle = Vec2i(width, height)/2;
|
Vec2i middle = Vec2i(width, height)/2;
|
||||||
Vec2i dest = middle - current;
|
XWarpPointer(display, None, window, 0, 0, 0, 0, middle.x, middle.y);
|
||||||
XWarpPointer(display, None, None, 0, 0, 0, 0, dest.x, dest.y);
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
SetCursorPos(pos.x, pos.y);
|
SetCursorPos(pos.x, pos.y);
|
||||||
|
|||||||
Reference in New Issue
Block a user