Some fixes for recent changes in GCC, libX11, etc...
This commit is contained in:
parent
05bc72eeb3
commit
09d8936f0e
3 changed files with 6 additions and 4 deletions
|
@ -9,10 +9,11 @@ IF (NOT OPENGL_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "Could not find OpenGL")
|
MESSAGE(FATAL_ERROR "Could not find OpenGL")
|
||||||
ENDIF (NOT OPENGL_FOUND)
|
ENDIF (NOT OPENGL_FOUND)
|
||||||
|
|
||||||
|
find_package(X11 REQUIRED)
|
||||||
find_package(GLEW REQUIRED)
|
find_package(GLEW REQUIRED)
|
||||||
find_package(GLPng REQUIRED)
|
find_package(GLPng REQUIRED)
|
||||||
find_package(LibXml2 REQUIRED)
|
find_package(LibXml2 REQUIRED)
|
||||||
|
|
||||||
include_directories(${Boost_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR} ${GLPNG_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
|
include_directories(${Boost_INCLUDE_DIR} ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIR} ${GLPNG_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} ${X11_X11_INCLUDE_PATH} ${X11_Xi_INCLUDE_PATH})
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
|
@ -14,4 +14,4 @@ add_executable(zoom
|
||||||
TriangleRecord.h
|
TriangleRecord.h
|
||||||
zoom.cpp
|
zoom.cpp
|
||||||
)
|
)
|
||||||
target_link_libraries(zoom ${Boost_LIBRARIES} ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARY} ${GLPNG_LIBRARY} ${LIBXML2_LIBRARIES})
|
target_link_libraries(zoom ${Boost_LIBRARIES} ${OPENGL_gl_LIBRARY} ${GLEW_LIBRARY} ${GLPNG_LIBRARY} ${LIBXML2_LIBRARIES} ${X11_LIBRARIES} ${X11_Xi_LIB})
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
#else
|
#else
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
#include <X11/XKBlib.h>
|
||||||
#include <X11/extensions/XInput2.h>
|
#include <X11/extensions/XInput2.h>
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
@ -390,7 +391,7 @@ int main() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
switch(XKeycodeToKeysym(disp, event.xkey.keycode, 0)) {
|
switch(XkbKeycodeToKeysym(disp, event.xkey.keycode, 0, 0)) {
|
||||||
case XK_Up: case XK_w: input |= Zoom::Game::FORWARD; break;
|
case XK_Up: case XK_w: input |= Zoom::Game::FORWARD; break;
|
||||||
case XK_Down: case XK_s: input |= Zoom::Game::BACKWARD; break;
|
case XK_Down: case XK_s: input |= Zoom::Game::BACKWARD; break;
|
||||||
case XK_Left: case XK_a: input |= Zoom::Game::LEFT; break;
|
case XK_Left: case XK_a: input |= Zoom::Game::LEFT; break;
|
||||||
|
@ -400,7 +401,7 @@ int main() {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case KeyRelease:
|
case KeyRelease:
|
||||||
switch(XKeycodeToKeysym(disp, event.xkey.keycode, 0)) {
|
switch(XkbKeycodeToKeysym(disp, event.xkey.keycode, 0, 0)) {
|
||||||
case XK_Up: case XK_w: input &= ~Zoom::Game::FORWARD; break;
|
case XK_Up: case XK_w: input &= ~Zoom::Game::FORWARD; break;
|
||||||
case XK_Down: case XK_s: input &= ~Zoom::Game::BACKWARD; break;
|
case XK_Down: case XK_s: input &= ~Zoom::Game::BACKWARD; break;
|
||||||
case XK_Left: case XK_a: input &= ~Zoom::Game::LEFT; break;
|
case XK_Left: case XK_a: input &= ~Zoom::Game::LEFT; break;
|
||||||
|
|
Reference in a new issue