diff --git a/examples/OpenGLWindow/OpenGL2Include.h b/examples/OpenGLWindow/OpenGL2Include.h index d47a2d4a9..34caaaf07 100644 --- a/examples/OpenGLWindow/OpenGL2Include.h +++ b/examples/OpenGLWindow/OpenGL2Include.h @@ -24,7 +24,11 @@ subject to the following restrictions: #include #else +#ifdef GLEW_STATIC #include "CustomGL/glew.h" +#else +#include +#endif//GLEW_STATIC #ifdef _WINDOWS #include diff --git a/examples/OpenGLWindow/OpenGLInclude.h b/examples/OpenGLWindow/OpenGLInclude.h index 87b9fd175..fee6a3095 100644 --- a/examples/OpenGLWindow/OpenGLInclude.h +++ b/examples/OpenGLWindow/OpenGLInclude.h @@ -31,7 +31,11 @@ subject to the following restrictions: #endif #else +#ifdef GLEW_STATIC #include "CustomGL/glew.h" +#else +#include +#endif //GLEW_STATIC #ifdef _WINDOWS #include diff --git a/examples/OpenGLWindow/X11OpenGLWindow.cpp b/examples/OpenGLWindow/X11OpenGLWindow.cpp index 961863580..db142e71d 100644 --- a/examples/OpenGLWindow/X11OpenGLWindow.cpp +++ b/examples/OpenGLWindow/X11OpenGLWindow.cpp @@ -3,9 +3,14 @@ #include #include -#include "GlewWindows/GL/glew.h" +#ifdef GLEW_STATIC +#include "CustomGL/glew.h" +#else +#include +#endif//GLEW_STATIC + #ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS -#include "GlewWindows/GL/glxew.h" +#include "CustomGL/glxew.h" #else #include #endif // GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS @@ -146,6 +151,14 @@ typedef Status (*PFNXGETWINDOWATTRIBUTES) (Display* a,Window b,XWindowAttributes #define MyXLookupKeysym XLookupKeysym #endif//DYNAMIC_LOAD_X11_FUNCTIONS + +enum +{ + MY_ALT = 1, + MY_SHIFT = 2, + MY_CONTROL = 4 +}; + struct InternalData2 { Display* m_dpy; @@ -158,6 +171,7 @@ struct InternalData2 XWindowAttributes m_gwa; XEvent m_xev; GLXFBConfig m_bestFbc; + int m_modifierFlags; #ifdef DYNAMIC_LOAD_X11_FUNCTIONS //dynamically load stuff @@ -720,6 +734,35 @@ int X11OpenGLWindow::getAsciiCodeFromVirtualKeycode(int keycode) return result; } +bool X11OpenGLWindow::isModifiedKeyPressed(int key) +{ + bool isPressed = false; + + switch (key) + { + case B3G_ALT: + { + isPressed = ((m_data->m_modifierFlags && MY_ALT)!=0); + break; + }; + case B3G_SHIFT: + { + isPressed = ((m_data->m_modifierFlags && MY_SHIFT)!=0); + break; + }; + case B3G_CONTROL: + { + isPressed = ((m_data->m_modifierFlags && MY_CONTROL )!=0); + break; + }; + + default: + { + } + }; + return isPressed; +} + void X11OpenGLWindow::pumpMessage() { diff --git a/examples/OpenGLWindow/X11OpenGLWindow.h b/examples/OpenGLWindow/X11OpenGLWindow.h index 4d29a637d..91e9f90bf 100644 --- a/examples/OpenGLWindow/X11OpenGLWindow.h +++ b/examples/OpenGLWindow/X11OpenGLWindow.h @@ -3,7 +3,7 @@ #define b3gDefaultOpenGLWindow X11OpenGLWindow -#include "b3gWindowInterface.h" +#include "../CommonInterfaces/CommonWindowInterface.h" class X11OpenGLWindow : public b3gWindowInterface { @@ -47,6 +47,7 @@ public: virtual bool requestedExit() const; virtual void setRequestExit() ; + virtual bool isModifiedKeyPressed(int key); virtual void setMouseMoveCallback(b3MouseMoveCallback mouseCallback); virtual void setMouseButtonCallback(b3MouseButtonCallback mouseCallback); diff --git a/examples/Planar2D/Planar2D.cpp b/examples/Planar2D/Planar2D.cpp index 08ef5d95a..6db5ae3c9 100644 --- a/examples/Planar2D/Planar2D.cpp +++ b/examples/Planar2D/Planar2D.cpp @@ -37,7 +37,7 @@ subject to the following restrictions: #define START_POS_Y -5 #define START_POS_Z -3 -#include "Planar2d.h" +#include "Planar2D.h" ///btBulletDynamicsCommon.h is the main Bullet include file, contains most common include files. #include "btBulletDynamicsCommon.h" diff --git a/examples/ThirdPartyLibs/Gwen/Renderers/OpenGL_DebugFont.cpp b/examples/ThirdPartyLibs/Gwen/Renderers/OpenGL_DebugFont.cpp index 0f1dcc188..bf876b475 100644 --- a/examples/ThirdPartyLibs/Gwen/Renderers/OpenGL_DebugFont.cpp +++ b/examples/ThirdPartyLibs/Gwen/Renderers/OpenGL_DebugFont.cpp @@ -10,7 +10,11 @@ #include #include #else + #ifdef GLEW_STATIC #include "CustomGL/glew.h" + #else + #include + #endif #endif #include "FontData.h" @@ -408,4 +412,4 @@ namespace Gwen } } -} \ No newline at end of file +} diff --git a/src/Bullet3Common/b3FileUtils.h b/src/Bullet3Common/b3FileUtils.h index 6745126a3..9a26f8c6b 100644 --- a/src/Bullet3Common/b3FileUtils.h +++ b/src/Bullet3Common/b3FileUtils.h @@ -4,7 +4,7 @@ #include #include "b3Scalar.h" #include //ptrdiff_h -#include +#include struct b3FileUtils {