fixes for Linux

This commit is contained in:
Erwin Coumans (Google) 2015-04-16 16:58:42 -07:00
parent b2ba615874
commit bf39570ff3
7 changed files with 62 additions and 6 deletions

View File

@ -24,7 +24,11 @@ subject to the following restrictions:
#include <OpenGL/gl.h>
#else
#ifdef GLEW_STATIC
#include "CustomGL/glew.h"
#else
#include <GL/glew.h>
#endif//GLEW_STATIC
#ifdef _WINDOWS
#include <windows.h>

View File

@ -31,7 +31,11 @@ subject to the following restrictions:
#endif
#else
#ifdef GLEW_STATIC
#include "CustomGL/glew.h"
#else
#include <GL/glew.h>
#endif //GLEW_STATIC
#ifdef _WINDOWS
#include <windows.h>

View File

@ -3,9 +3,14 @@
#include<stdio.h>
#include<stdlib.h>
#include "GlewWindows/GL/glew.h"
#ifdef GLEW_STATIC
#include "CustomGL/glew.h"
#else
#include <GL/glew.h>
#endif//GLEW_STATIC
#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
#include "GlewWindows/GL/glxew.h"
#include "CustomGL/glxew.h"
#else
#include<GL/glx.h>
#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()
{

View File

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

View File

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

View File

@ -10,7 +10,11 @@
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#else
#ifdef GLEW_STATIC
#include "CustomGL/glew.h"
#else
#include <GL/glew.h>
#endif
#endif
#include "FontData.h"
@ -408,4 +412,4 @@ namespace Gwen
}
}
}
}

View File

@ -4,7 +4,7 @@
#include <stdio.h>
#include "b3Scalar.h"
#include <stddef.h>//ptrdiff_h
#include <string>
#include <string.h>
struct b3FileUtils
{