Commit c25f29a5 authored by hybrid's avatar hybrid

Properly fixed the OpenGL extension search. Also removed the glu part in order...

Properly fixed the OpenGL extension search. Also removed the glu part in order to get rid of glu at all.
Added a Linux keyboard fix posted by denton. Now, Linux also sends just KeyPressed for Autorepeat, instead of alternating KeyReleased-KeyPressed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@882 dfc29bdd-3216-0410-991c-e03cc46cb475
parent e8b042f2
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "COSOperator.h" #include "COSOperator.h"
#include "CColorConverter.h" #include "CColorConverter.h"
#include "SIrrCreationParameters.h" #include "SIrrCreationParameters.h"
#include <X11/XKBlib.h>
namespace irr namespace irr
{ {
...@@ -48,7 +49,7 @@ CIrrDeviceLinux::CIrrDeviceLinux(video::E_DRIVER_TYPE driverType, ...@@ -48,7 +49,7 @@ CIrrDeviceLinux::CIrrDeviceLinux(video::E_DRIVER_TYPE driverType,
#endif #endif
Fullscreen(fullscreen), StencilBuffer(sbuffer), AntiAlias(antiAlias), DriverType(driverType), Fullscreen(fullscreen), StencilBuffer(sbuffer), AntiAlias(antiAlias), DriverType(driverType),
Width(windowSize.Width), Height(windowSize.Height), Depth(24), Width(windowSize.Width), Height(windowSize.Height), Depth(24),
Close(false), WindowActive(false), WindowMinimized(false), UseXVidMode(false), UseXRandR(false), UseGLXWindow(false) Close(false), WindowActive(false), WindowMinimized(false), UseXVidMode(false), UseXRandR(false), UseGLXWindow(false), AutorepeatSupport(0)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CIrrDeviceLinux"); setDebugName("CIrrDeviceLinux");
...@@ -520,6 +521,7 @@ bool CIrrDeviceLinux::createWindow(const core::dimension2d<s32>& windowSize, ...@@ -520,6 +521,7 @@ bool CIrrDeviceLinux::createWindow(const core::dimension2d<s32>& windowSize,
XMapRaised(display, window); XMapRaised(display, window);
} }
WindowActive=true; WindowActive=true;
XkbSetDetectableAutoRepeat(display, True, &AutorepeatSupport);
#ifdef _IRR_COMPILE_WITH_OPENGL_ #ifdef _IRR_COMPILE_WITH_OPENGL_
......
...@@ -320,6 +320,7 @@ namespace irr ...@@ -320,6 +320,7 @@ namespace irr
bool UseXVidMode; bool UseXVidMode;
bool UseXRandR; bool UseXRandR;
bool UseGLXWindow; bool UseGLXWindow;
int AutorepeatSupport;
struct SKeyMap struct SKeyMap
{ {
......
...@@ -67,20 +67,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -67,20 +67,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
else else
os::Printer::log("OpenGL driver version is not 1.2 or better.", ELL_WARNING); os::Printer::log("OpenGL driver version is not 1.2 or better.", ELL_WARNING);
const GLubyte* t = glGetString(GL_EXTENSIONS);
// os::Printer::log(reinterpret_cast<const c8*>(t), ELL_INFORMATION);
#ifdef GLU_VERSION_1_3
const GLubyte* gluVersion = gluGetString(GLU_VERSION);
if (gluVersion[0]>1 || gluVersion[3]>2)
{
for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i)
FeatureAvailable[i] = gluCheckExtension(reinterpret_cast<const GLubyte*>(OpenGLFeatureStrings[i]), t);
}
else
#endif
{ {
size_t len = strlen(reinterpret_cast<const char*>(t)); const char* t = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
const size_t len = strlen(t);
c8 *str = new c8[len+1]; c8 *str = new c8[len+1];
c8* p = str; c8* p = str;
...@@ -91,9 +80,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer) ...@@ -91,9 +80,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
if (str[i] == ' ') if (str[i] == ' ')
{ {
str[i] = 0; str[i] = 0;
for (s32 i=IRR_OpenGL_Feature_Count-1; i>0; --i) for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i)
{ {
if (strstr(p, OpenGLFeatureStrings[i])) if (!strcmp(OpenGLFeatureStrings[i], p))
{ {
FeatureAvailable[i] = true; FeatureAvailable[i] = true;
break; break;
......
...@@ -14,11 +14,9 @@ ...@@ -14,11 +14,9 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#include <windows.h> #include <windows.h>
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h>
#include "glext.h" #include "glext.h"
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma comment(lib, "OpenGL32.lib") #pragma comment(lib, "OpenGL32.lib")
#pragma comment(lib, "GLu32.lib")
#endif #endif
#elif defined(MACOSX) #elif defined(MACOSX)
#include "CIrrDeviceMacOSX.h" #include "CIrrDeviceMacOSX.h"
...@@ -26,7 +24,6 @@ ...@@ -26,7 +24,6 @@
#define GL_GLEXT_LEGACY 1 #define GL_GLEXT_LEGACY 1
#endif #endif
#include <OpenGL/gl.h> #include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h" #include "glext.h"
#endif #endif
...@@ -50,7 +47,6 @@ ...@@ -50,7 +47,6 @@
#define GLX_GLXEXT_PROTOTYPES 1 #define GLX_GLXEXT_PROTOTYPES 1
#endif #endif
#include <GL/gl.h> #include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h> #include <GL/glx.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_) #if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h" #include "glext.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment