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 @@
#include "COSOperator.h"
#include "CColorConverter.h"
#include "SIrrCreationParameters.h"
#include <X11/XKBlib.h>
namespace irr
{
......@@ -48,7 +49,7 @@ CIrrDeviceLinux::CIrrDeviceLinux(video::E_DRIVER_TYPE driverType,
#endif
Fullscreen(fullscreen), StencilBuffer(sbuffer), AntiAlias(antiAlias), DriverType(driverType),
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
setDebugName("CIrrDeviceLinux");
......@@ -520,6 +521,7 @@ bool CIrrDeviceLinux::createWindow(const core::dimension2d<s32>& windowSize,
XMapRaised(display, window);
}
WindowActive=true;
XkbSetDetectableAutoRepeat(display, True, &AutorepeatSupport);
#ifdef _IRR_COMPILE_WITH_OPENGL_
......
......@@ -320,6 +320,7 @@ namespace irr
bool UseXVidMode;
bool UseXRandR;
bool UseGLXWindow;
int AutorepeatSupport;
struct SKeyMap
{
......
......@@ -67,20 +67,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
else
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* p = str;
......@@ -91,9 +80,9 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
if (str[i] == ' ')
{
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;
break;
......
......@@ -14,11 +14,9 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include "glext.h"
#ifdef _MSC_VER
#pragma comment(lib, "OpenGL32.lib")
#pragma comment(lib, "GLu32.lib")
#endif
#elif defined(MACOSX)
#include "CIrrDeviceMacOSX.h"
......@@ -26,7 +24,6 @@
#define GL_GLEXT_LEGACY 1
#endif
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#include "glext.h"
#endif
......@@ -50,7 +47,6 @@
#define GLX_GLXEXT_PROTOTYPES 1
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glx.h>
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
#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