forked from Mirrorlandia_minetest/irrlicht
master #5
@ -8,19 +8,12 @@
|
||||
|
||||
#include "os.h"
|
||||
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#define GL_GLEXT_LEGACY 1
|
||||
#define GLX_GLXEXT_LEGACY 1
|
||||
#else
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
#define GLX_GLXEXT_PROTOTYPES 1
|
||||
#endif
|
||||
#define GL_GLEXT_LEGACY 1
|
||||
#define GLX_GLXEXT_LEGACY 1
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#include <GL/glext.h>
|
||||
#include <GL/glxext.h>
|
||||
#endif
|
||||
|
||||
namespace irr
|
||||
{
|
||||
@ -45,11 +38,7 @@ CGLXManager::CGLXManager(const SIrrlichtCreationParameters& params, const SExpos
|
||||
#if defined(GLX_VERSION_1_3)
|
||||
typedef GLXFBConfig * ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
PFNGLXCHOOSEFBCONFIGPROC glxChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXChooseFBConfig"));
|
||||
#else
|
||||
PFNGLXCHOOSEFBCONFIGPROC glxChooseFBConfig=glXChooseFBConfig;
|
||||
#endif
|
||||
if (major==1 && minor>2 && glxChooseFBConfig)
|
||||
{
|
||||
os::Printer::log("GLX >= 1.3", ELL_DEBUG);
|
||||
@ -196,14 +185,10 @@ os::Printer::log("GLX >= 1.3", ELL_DEBUG);
|
||||
{
|
||||
glxFBConfig=configList[0];
|
||||
XFree(configList);
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
typedef XVisualInfo * ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
PFNGLXGETVISUALFROMFBCONFIGPROC glxGetVisualFromFBConfig= (PFNGLXGETVISUALFROMFBCONFIGPROC)glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXGetVisualFromFBConfig"));
|
||||
if (glxGetVisualFromFBConfig)
|
||||
VisualInfo = glxGetVisualFromFBConfig(display,(GLXFBConfig)glxFBConfig);
|
||||
#else
|
||||
VisualInfo = glXGetVisualFromFBConfig(display,(GLXFBConfig)glxFBConfig);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -328,11 +313,7 @@ bool CGLXManager::generateContext()
|
||||
{
|
||||
#if defined(GLX_ARB_create_context)
|
||||
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
PFNGLXCREATECONTEXTATTRIBSARBPROC glxCreateContextAttribsARB=(PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddress(reinterpret_cast<const GLubyte*>("glXCreateContextAttribsARB"));
|
||||
#else
|
||||
PFNGLXCREATECONTEXTATTRIBSARBPROC glxCreateContextAttribsARB=glXCreateContextAttribsARB;
|
||||
#endif
|
||||
|
||||
if (glxCreateContextAttribsARB)
|
||||
{
|
||||
|
@ -186,13 +186,12 @@ if(ENABLE_OPENGL)
|
||||
add_definitions(-D_IRR_COMPILE_WITH_OPENGL_)
|
||||
set(OPENGL_DIRECT_LINK TRUE) # not yet possible to remove this
|
||||
if(DEVICE STREQUAL "WINDOWS")
|
||||
add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
add_definitions(-D_IRR_COMPILE_WITH_WGL_MANAGER_)
|
||||
elseif(DEVICE STREQUAL "X11")
|
||||
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_ -D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
add_definitions(-D_IRR_COMPILE_WITH_GLX_MANAGER_)
|
||||
elseif(DEVICE STREQUAL "OSX")
|
||||
add_definitions(-D_IRR_COMPILE_WITH_NSOGL_MANAGER_)
|
||||
elseif(DEVICE STREQUAL "SDL")
|
||||
add_definitions(-D_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
# FIXME broken due to missing glext.h now!
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -9,51 +9,30 @@
|
||||
#if defined(_IRR_WINDOWS_API_)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#define GL_GLEXT_LEGACY 1
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#include <GL/glext.h>
|
||||
#endif
|
||||
#include <GL/wglext.h>
|
||||
#elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_)
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#define GL_GLEXT_LEGACY 1
|
||||
#endif
|
||||
#include <OpenGL/gl.h>
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#error glext.h missing on OSX
|
||||
#endif
|
||||
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#define GL_GLEXT_LEGACY 1
|
||||
#else
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
#endif
|
||||
#include <SDL_video.h>
|
||||
#include <SDL_opengl.h>
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#ifdef __APPLE__
|
||||
#include <SDL_opengl_glext.h>
|
||||
#else
|
||||
#include <GL/glext.h>
|
||||
#endif
|
||||
#endif
|
||||
#else
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#define GL_GLEXT_LEGACY 1
|
||||
#define GLX_GLXEXT_LEGACY 1
|
||||
#else
|
||||
#define GL_GLEXT_PROTOTYPES 1
|
||||
#define GLX_GLXEXT_PROTOTYPES 1
|
||||
#endif
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glx.h>
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#include <GL/glext.h>
|
||||
#include <GL/glxext.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef GL_ARB_shader_objects
|
||||
|
@ -23,7 +23,6 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
|
||||
MaxTextureSize(1), MaxGeometryVerticesOut(0),
|
||||
MaxTextureLODBias(0.f), Version(0), ShaderLanguageVersion(0),
|
||||
OcclusionQuerySupport(false), IsAtiRadeonX(false)
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
,pGlActiveTexture(0)
|
||||
,pGlActiveTextureARB(0), pGlClientActiveTextureARB(0),
|
||||
pGlGenProgramsARB(0), pGlGenProgramsNV(0),
|
||||
@ -105,7 +104,6 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
|
||||
#if defined(GLX_MESA_swap_control)
|
||||
,pGlxSwapIntervalMESA(0)
|
||||
#endif
|
||||
#endif // _IRR_OPENGL_USE_EXTPOINTER_
|
||||
{
|
||||
for (u32 i=0; i<IRR_OpenGL_Feature_Count; ++i)
|
||||
FeatureAvailable[i]=false;
|
||||
@ -179,7 +177,6 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
|
||||
IsAtiRadeonX = (strncmp(renderer, "ATI RADEON X", 12) == 0) || (strncmp(renderer, "ATI MOBILITY RADEON X", 21) == 0);
|
||||
}
|
||||
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
#ifdef _IRR_WINDOWS_API_
|
||||
#define IRR_OGL_LOAD_EXTENSION(x) wglGetProcAddress(reinterpret_cast<const char*>(x))
|
||||
#elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_)
|
||||
@ -412,7 +409,6 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
|
||||
#if defined(GLX_MESA_swap_control) && !defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
|
||||
pGlxSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)IRR_OGL_LOAD_EXTENSION("glXSwapIntervalMESA");
|
||||
#endif
|
||||
#endif // use extension pointer
|
||||
|
||||
GLint num=0;
|
||||
// set some properties
|
||||
@ -533,14 +529,12 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
|
||||
if (!pGlActiveTextureARB || !pGlClientActiveTextureARB)
|
||||
{
|
||||
Feature.MaxTextureUnits = 1;
|
||||
os::Printer::log("Failed to load OpenGL's multitexture extension, proceeding without.", ELL_WARNING);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
Feature.MaxTextureUnits = core::min_(Feature.MaxTextureUnits, static_cast<u8>(MATERIAL_MAX_TEXTURES));
|
||||
|
||||
#ifdef GL_ARB_occlusion_query
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user