Changed: The cursor is now hidden in the window.
TODO: Finish dependencies in Makefile and release :) ~g2k
This commit is contained in:
@@ -39,6 +39,8 @@ namespace OpenArena
|
||||
Display* GetDisplay();
|
||||
|
||||
private:
|
||||
Cursor CreateWindowedCursor();
|
||||
Cursor CreateFullscreenCursor();
|
||||
int screen;
|
||||
::Window window;
|
||||
GLXContext hRC;
|
||||
|
||||
@@ -21,9 +21,11 @@ clean:
|
||||
|
||||
install:
|
||||
|
||||
#Executables
|
||||
../OpenArena/OA: $(OBJECTS)
|
||||
$(LD) $(LDFLAGS) -o ../OpenArena/OA $(OBJECTS)
|
||||
|
||||
#Dynamic Libraries
|
||||
oa_game.so:
|
||||
|
||||
oa_audio.so:
|
||||
@@ -34,6 +36,7 @@ oa_video.so:
|
||||
|
||||
oa_input.so:
|
||||
|
||||
#Object Files
|
||||
screen.o: screen.cpp $(INCLUDEPATH)/screen.h
|
||||
$(CPP) -c -o screen.o screen.cpp
|
||||
|
||||
@@ -43,10 +46,10 @@ bmp.o: bmp.cpp $(INCLUDEPATH)/bmp.h $(INCLUDEPATH)/mygl.h $(INCLUDEPATH)/datatyp
|
||||
camera.o: camera.cpp $(INCLUDEPATH)/camera.h $(INCLUDEPATH)/vector.h $(INCLUDEPATH)/mygl.h $(INCLUDEPATH)/screen.h
|
||||
$(CPP) -c -o camera.o camera.cpp
|
||||
|
||||
ctrls.o: ctrls.cpp $(INCLUDEPATH)/ctrls.h
|
||||
ctrls.o: ctrls.cpp $(INCLUDEPATH)/ctrls.h $(INCLUDEPATH)/keys.h $(INCLUDEPATH)/physics.h $(INCLUDEPATH)/datatypes.h $(INCLUDEPATH)/list.h
|
||||
$(CPP) -c -o ctrls.o ctrls.cpp
|
||||
|
||||
level.o: level.cpp $(INCLUDEPATH)/level.h
|
||||
level.o: level.cpp $(INCLUDEPATH)/level.h $(INCLUDEPATH)/version.h
|
||||
$(CPP) -c -o level.o level.cpp
|
||||
|
||||
$(INCLUDEPATH)/level.h: $(INCLUDEPATH)/myglFont.h
|
||||
|
||||
@@ -150,6 +150,7 @@ bool OpenArena::Window::Open()
|
||||
XMapRaised(display, window);
|
||||
XGrabKeyboard(display, window, true, GrabModeAsync, GrabModeAsync, CurrentTime);
|
||||
XGrabPointer(display, window, true, ButtonPressMask, GrabModeAsync, GrabModeAsync, window, None, CurrentTime);
|
||||
XDefineCursor(display, window, CreateFullscreenCursor());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -158,6 +159,7 @@ bool OpenArena::Window::Open()
|
||||
XSetWMProtocols(display, window, &wmDelete, 1);
|
||||
XSetStandardProperties(display, window, GetName(), GetName(), None, NULL, 0, NULL);
|
||||
XMapRaised(display, window);
|
||||
XDefineCursor(display, window, CreateWindowedCursor());
|
||||
}
|
||||
|
||||
glXMakeCurrent(display, window, hRC);
|
||||
@@ -430,3 +432,23 @@ void OpenArena::Window::SetMousePosition(Vec2i pos)
|
||||
SetCursorPos(pos.x, pos.y);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __linux
|
||||
Cursor OpenArena::Window::CreateWindowedCursor()
|
||||
{
|
||||
return CreateFullscreenCursor();
|
||||
}
|
||||
|
||||
Cursor OpenArena::Window::CreateFullscreenCursor()
|
||||
{
|
||||
Pixmap pixmap = XCreatePixmap(display, window, 1, 1, 1);
|
||||
XColor color;
|
||||
color.pixel = 0;
|
||||
color.red = 0;
|
||||
color.flags = DoRed;
|
||||
Cursor cur = XCreatePixmapCursor(display, pixmap, pixmap, &color, &color, 0, 0);
|
||||
XFreePixmap(display, pixmap);
|
||||
return cur;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user