Merging r6122 through r6127 from trunk to ogl-es branch

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6128 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien 2020-06-20 15:26:29 +00:00
parent eaefca2cd1
commit 048aa500b9
7 changed files with 150 additions and 34 deletions

@ -91,7 +91,7 @@ namespace irr
//! Get the position of this window on screen //! Get the position of this window on screen
virtual core::position2di getWindowPosition() _IRR_OVERRIDE_; virtual core::position2di getWindowPosition() _IRR_OVERRIDE_;
//! Activate any joysticks, and generate events for them. //! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_; virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) _IRR_OVERRIDE_;
@ -176,13 +176,13 @@ namespace irr
} }
//! Returns the current position of the mouse cursor. //! Returns the current position of the mouse cursor.
virtual const core::position2d<s32>& getPosition() virtual const core::position2d<s32>& getPosition(bool updateCursor) _IRR_OVERRIDE_
{ {
return CursorPos; return CursorPos;
} }
//! Returns the current position of the mouse cursor. //! Returns the current position of the mouse cursor.
virtual core::position2d<f32> getRelativePosition() virtual core::position2d<f32> getRelativePosition(bool updateCursor) _IRR_OVERRIDE_
{ {
if (!UseReferenceRect) if (!UseReferenceRect)
{ {

@ -1224,7 +1224,7 @@ void CIrrDeviceMacOSX::storeMouseLocation()
x = (int)point.x; x = (int)point.x;
y = (int)point.y; y = (int)point.y;
const core::position2di& curr = ((CCursorControl *)CursorControl)->getPosition(); const core::position2di& curr = ((CCursorControl *)CursorControl)->getPosition(true);
if (curr.X != x || curr.Y != y) if (curr.X != x || curr.Y != y)
{ {
// In fullscreen mode, events are not sent regularly so rely on polling // In fullscreen mode, events are not sent regularly so rely on polling

@ -52,7 +52,7 @@ namespace video
const SExposedVideoData& getContext() const; const SExposedVideoData& getContext() const;
//! Change render context, disable old and activate new defined by videoData //! Change render context, disable old and activate new defined by videoData
bool activateContext(const SExposedVideoData& videoData); bool activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero) _IRR_OVERRIDE_;
// Swap buffers. // Swap buffers.
bool swapBuffers(); bool swapBuffers();
@ -61,7 +61,7 @@ namespace video
SIrrlichtCreationParameters Params; SIrrlichtCreationParameters Params;
SExposedVideoData PrimaryContext; SExposedVideoData PrimaryContext;
SExposedVideoData CurrentContext; SExposedVideoData CurrentContext;
NSOpenGLPixelFormat* PixelFormat; NSOpenGLPixelFormat* PixelFormat;
}; };
} }

@ -188,8 +188,9 @@ const SExposedVideoData& CNSOGLManager::getContext() const
return CurrentContext; return CurrentContext;
} }
bool CNSOGLManager::activateContext(const SExposedVideoData& videoData) bool CNSOGLManager::activateContext(const SExposedVideoData& videoData, bool restorePrimaryOnZero)
{ {
//TODO: handle restorePrimaryOnZero
if (videoData.OpenGLOSX.Context) if (videoData.OpenGLOSX.Context)
{ {
if ((NSOpenGLContext*)videoData.OpenGLOSX.Context != [NSOpenGLContext currentContext]) if ((NSOpenGLContext*)videoData.OpenGLOSX.Context != [NSOpenGLContext currentContext])

@ -1915,7 +1915,7 @@ inline void COpenGLExtensionHandler::extGlUniform1uiv(GLint loc, GLsizei count,
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlUniform1uiv) if (pGlUniform1uiv)
pGlUniform1uiv(loc, count, v); pGlUniform1uiv(loc, count, v);
#else #elif defined(GL_VERSION_3_0)
glUniform1uiv(loc, count, v); glUniform1uiv(loc, count, v);
#endif #endif
} }
@ -1925,7 +1925,7 @@ inline void COpenGLExtensionHandler::extGlUniform2uiv(GLint loc, GLsizei count,
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlUniform2uiv) if (pGlUniform2uiv)
pGlUniform2uiv(loc, count, v); pGlUniform2uiv(loc, count, v);
#else #elif defined(GL_VERSION_3_0)
glUniform2uiv(loc, count, v); glUniform2uiv(loc, count, v);
#endif #endif
} }
@ -1935,7 +1935,7 @@ inline void COpenGLExtensionHandler::extGlUniform3uiv(GLint loc, GLsizei count,
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlUniform3uiv) if (pGlUniform3uiv)
pGlUniform3uiv(loc, count, v); pGlUniform3uiv(loc, count, v);
#else #elif defined(GL_VERSION_3_0)
glUniform3uiv(loc, count, v); glUniform3uiv(loc, count, v);
#endif #endif
} }
@ -1945,7 +1945,7 @@ inline void COpenGLExtensionHandler::extGlUniform4uiv(GLint loc, GLsizei count,
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlUniform4uiv) if (pGlUniform4uiv)
pGlUniform4uiv(loc, count, v); pGlUniform4uiv(loc, count, v);
#else #elif defined(GL_VERSION_3_0)
glUniform4uiv(loc, count, v); glUniform4uiv(loc, count, v);
#endif #endif
} }
@ -2867,7 +2867,7 @@ inline void COpenGLExtensionHandler::extGlTextureSubImage2D(GLuint texture, GLen
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureSubImage2D) if (pGlTextureSubImage2D)
pGlTextureSubImage2D(texture, level, xoffset, yoffset,width, height,format, type, pixels); pGlTextureSubImage2D(texture, level, xoffset, yoffset,width, height,format, type, pixels);
#else #elif defined(GL_VERSION_4_5)
glTextureSubImage2D(texture, level, xoffset, yoffset,width, height,format, type, pixels); glTextureSubImage2D(texture, level, xoffset, yoffset,width, height,format, type, pixels);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -2876,7 +2876,7 @@ inline void COpenGLExtensionHandler::extGlTextureSubImage2D(GLuint texture, GLen
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureSubImage2DEXT) if (pGlTextureSubImage2DEXT)
pGlTextureSubImage2DEXT(texture, target, level, xoffset, yoffset,width, height,format, type, pixels); pGlTextureSubImage2DEXT(texture, target, level, xoffset, yoffset,width, height,format, type, pixels);
#else #elif defined(GL_EXT_direct_state_access)
glTextureSubImage2DEXT(texture, target, level, xoffset, yoffset,width, height,format, type, pixels); glTextureSubImage2DEXT(texture, target, level, xoffset, yoffset,width, height,format, type, pixels);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -2885,15 +2885,23 @@ inline void COpenGLExtensionHandler::extGlTextureSubImage2D(GLuint texture, GLen
GLint bound; GLint bound;
switch (target) switch (target)
{ {
#ifdef GL_VERSION_3_0
case GL_TEXTURE_1D_ARRAY: case GL_TEXTURE_1D_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY, &bound);
break; break;
#elif GL_EXT_texture_array
case GL_TEXTURE_1D_ARRAY_EXT:
glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY_EXT, &bound);
break;
#endif
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound);
break; break;
#ifdef GL_VERSION_3_2
case GL_TEXTURE_2D_MULTISAMPLE: case GL_TEXTURE_2D_MULTISAMPLE:
glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE, &bound);
break; break;
#endif
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
@ -2921,7 +2929,7 @@ inline void COpenGLExtensionHandler::extGlTextureStorage2D(GLuint texture, GLenu
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureStorage2D) if (pGlTextureStorage2D)
pGlTextureStorage2D(texture,levels,internalformat,width,height); pGlTextureStorage2D(texture,levels,internalformat,width,height);
#else #elif defined(GL_VERSION_4_5)
glTextureStorage2D(texture,levels,internalformat,width,height); glTextureStorage2D(texture,levels,internalformat,width,height);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -2930,22 +2938,29 @@ inline void COpenGLExtensionHandler::extGlTextureStorage2D(GLuint texture, GLenu
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureStorage2DEXT) if (pGlTextureStorage2DEXT)
pGlTextureStorage2DEXT(texture,target,levels,internalformat,width,height); pGlTextureStorage2DEXT(texture,target,levels,internalformat,width,height);
#else #elif defined(GL_EXT_direct_state_access)
glTextureStorage2DEXT(texture,target,levels,internalformat,width,height); glTextureStorage2DEXT(texture,target,levels,internalformat,width,height);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
else if (pGlTexStorage2D) #if defined(GL_VERSION_4_2) || defined(_IRR_OPENGL_USE_EXTPOINTER_)
#else
else else
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTexStorage2D)
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
{ {
GLint bound; GLint bound;
switch (target) switch (target)
{ {
#ifdef GL_VERSION_3_0
case GL_TEXTURE_1D_ARRAY: case GL_TEXTURE_1D_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY, &bound);
break; break;
#elif GL_EXT_texture_array
case GL_TEXTURE_1D_ARRAY_EXT:
glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY_EXT, &bound);
break;
#endif
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound);
break; break;
@ -2966,6 +2981,7 @@ inline void COpenGLExtensionHandler::extGlTextureStorage2D(GLuint texture, GLenu
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
glBindTexture(target, bound); glBindTexture(target, bound);
} }
#endif // GL_VERSION_4_2 || _IRR_OPENGL_USE_EXTPOINTER_
} }
inline void COpenGLExtensionHandler::extGlTextureStorage3D(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) inline void COpenGLExtensionHandler::extGlTextureStorage3D(GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
@ -2975,7 +2991,7 @@ inline void COpenGLExtensionHandler::extGlTextureStorage3D(GLuint texture, GLenu
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureStorage3D) if (pGlTextureStorage3D)
pGlTextureStorage3D(texture,levels,internalformat,width,height,depth); pGlTextureStorage3D(texture,levels,internalformat,width,height,depth);
#else #elif defined(GL_VERSION_4_5)
glTextureStorage3D(texture,levels,internalformat,width,height,depth); glTextureStorage3D(texture,levels,internalformat,width,height,depth);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -2984,28 +3000,40 @@ inline void COpenGLExtensionHandler::extGlTextureStorage3D(GLuint texture, GLenu
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTextureStorage3DEXT) if (pGlTextureStorage3DEXT)
pGlTextureStorage3DEXT(texture,target,levels,internalformat,width,height,depth); pGlTextureStorage3DEXT(texture,target,levels,internalformat,width,height,depth);
#else #elif defined(GL_EXT_direct_state_access)
glTextureStorage3DEXT(texture,target,levels,internalformat,width,height,depth); glTextureStorage3DEXT(texture,target,levels,internalformat,width,height,depth);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #if defined(GL_VERSION_4_2) || defined(_IRR_OPENGL_USE_EXTPOINTER_)
else if (pGlTexStorage3D)
#else
else else
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlTexStorage3D)
#endif // _IRR_OPENGL_USE_EX TPOINTER_
{ {
GLint bound; GLint bound;
switch (target) switch (target)
{ {
#ifdef GL_VERSION_3_0
case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_2D_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &bound);
break; break;
#elif GL_EXT_texture_array
case GL_TEXTURE_2D_ARRAY_EXT:
glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY_EXT, &bound);
break;
#endif
case GL_TEXTURE_3D: case GL_TEXTURE_3D:
glGetIntegerv(GL_TEXTURE_BINDING_3D, &bound); glGetIntegerv(GL_TEXTURE_BINDING_3D, &bound);
break; break;
#ifdef GL_VERSION_4_0
case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_TEXTURE_CUBE_MAP_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, &bound);
break; break;
#elif defined(GL_ARB_texture_cube_map_array)
case GL_TEXTURE_CUBE_MAP_ARRAY_ARB:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB, &bound);
break;
#endif
default: default:
return; return;
} }
@ -3017,6 +3045,7 @@ inline void COpenGLExtensionHandler::extGlTextureStorage3D(GLuint texture, GLenu
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
glBindTexture(target, bound); glBindTexture(target, bound);
} }
#endif // GL_VERSION_4_2 || _IRR_OPENGL_USE_EXTPOINTER_
} }
inline void COpenGLExtensionHandler::extGlGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels) inline void COpenGLExtensionHandler::extGlGetTextureImage(GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* pixels)
@ -3026,7 +3055,7 @@ inline void COpenGLExtensionHandler::extGlGetTextureImage(GLuint texture, GLenum
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGetTextureImage) if (pGlGetTextureImage)
pGlGetTextureImage(texture,level,format,type,bufSize,pixels); pGlGetTextureImage(texture,level,format,type,bufSize,pixels);
#else #elif defined(GL_VERSION_4_5)
glGetTextureImage(texture,level,format,type,bufSize,pixels); glGetTextureImage(texture,level,format,type,bufSize,pixels);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -3035,7 +3064,7 @@ inline void COpenGLExtensionHandler::extGlGetTextureImage(GLuint texture, GLenum
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGetTextureImageEXT) if (pGlGetTextureImageEXT)
pGlGetTextureImageEXT(texture,target,level,format,type,pixels); pGlGetTextureImageEXT(texture,target,level,format,type,pixels);
#else #elif defined(GL_EXT_direct_state_access)
glGetTextureImageEXT(texture,target,level,format,type,pixels); glGetTextureImageEXT(texture,target,level,format,type,pixels);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -3044,15 +3073,27 @@ inline void COpenGLExtensionHandler::extGlGetTextureImage(GLuint texture, GLenum
GLint bound; GLint bound;
switch (target) switch (target)
{ {
#ifdef GL_VERSION_3_0
case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_2D_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &bound);
break; break;
#elif GL_EXT_texture_array
case GL_TEXTURE_2D_ARRAY_EXT:
glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY_EXT, &bound);
break;
#endif
case GL_TEXTURE_3D: case GL_TEXTURE_3D:
glGetIntegerv(GL_TEXTURE_BINDING_3D, &bound); glGetIntegerv(GL_TEXTURE_BINDING_3D, &bound);
break; break;
#ifdef GL_VERSION_4_0
case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_TEXTURE_CUBE_MAP_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, &bound);
break; break;
#elif defined(GL_ARB_texture_cube_map_array)
case GL_TEXTURE_CUBE_MAP_ARRAY_ARB:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB, &bound);
break;
#endif
default: default:
return; return;
} }
@ -3064,6 +3105,7 @@ inline void COpenGLExtensionHandler::extGlGetTextureImage(GLuint texture, GLenum
inline void COpenGLExtensionHandler::extGlNamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level) inline void COpenGLExtensionHandler::extGlNamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level)
{ {
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (!needsDSAFramebufferHack) if (!needsDSAFramebufferHack)
{ {
if (Version>=405 || FeatureAvailable[IRR_ARB_direct_state_access]) if (Version>=405 || FeatureAvailable[IRR_ARB_direct_state_access])
@ -3086,6 +3128,7 @@ inline void COpenGLExtensionHandler::extGlNamedFramebufferTexture(GLuint framebu
pGlFramebufferTexture(GL_FRAMEBUFFER,attachment,texture,level); pGlFramebufferTexture(GL_FRAMEBUFFER,attachment,texture,level);
if (bound!=framebuffer) if (bound!=framebuffer)
pGlBindFramebuffer(GL_FRAMEBUFFER,bound); pGlBindFramebuffer(GL_FRAMEBUFFER,bound);
#endif
} }
inline void COpenGLExtensionHandler::extGlTextureParameteri(GLuint texture, GLenum pname, GLint param) inline void COpenGLExtensionHandler::extGlTextureParameteri(GLuint texture, GLenum pname, GLint param)
@ -3129,7 +3172,7 @@ inline void COpenGLExtensionHandler::extGlCreateTextures(GLenum target, GLsizei
pGlCreateTextures(target,n,textures); pGlCreateTextures(target,n,textures);
else if (textures) else if (textures)
memset(textures,0,n*sizeof(GLuint)); memset(textures,0,n*sizeof(GLuint));
#else #elif defined(GL_VERSION_4_5)
glCreateTextures(target,n,textures); glCreateTextures(target,n,textures);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -3141,6 +3184,7 @@ inline void COpenGLExtensionHandler::extGlCreateTextures(GLenum target, GLsizei
inline void COpenGLExtensionHandler::extGlCreateFramebuffers(GLsizei n, GLuint* framebuffers) inline void COpenGLExtensionHandler::extGlCreateFramebuffers(GLsizei n, GLuint* framebuffers)
{ {
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (!needsDSAFramebufferHack) if (!needsDSAFramebufferHack)
{ {
if (Version>=405) if (Version>=405)
@ -3151,21 +3195,49 @@ inline void COpenGLExtensionHandler::extGlCreateFramebuffers(GLsizei n, GLuint*
} }
pGlGenFramebuffers(n, framebuffers); pGlGenFramebuffers(n, framebuffers);
#endif
} }
inline void COpenGLExtensionHandler::extGlBindTextures(GLuint first, GLsizei count, const GLuint *textures, const GLenum* targets) inline void COpenGLExtensionHandler::extGlBindTextures(GLuint first, GLsizei count, const GLuint *textures, const GLenum* targets)
{ {
const GLenum supportedTargets[] = { GL_TEXTURE_1D,GL_TEXTURE_2D, // GL 1.x const GLenum supportedTargets[] = { GL_TEXTURE_1D, GL_TEXTURE_2D // GL 1.x
GL_TEXTURE_3D,GL_TEXTURE_RECTANGLE,GL_TEXTURE_CUBE_MAP, // GL 2.x ,GL_TEXTURE_3D // GL 2.x
GL_TEXTURE_1D_ARRAY,GL_TEXTURE_2D_ARRAY,GL_TEXTURE_BUFFER, // GL 3.x #ifdef GL_VERSION_3_1
GL_TEXTURE_CUBE_MAP_ARRAY,GL_TEXTURE_2D_MULTISAMPLE,GL_TEXTURE_2D_MULTISAMPLE_ARRAY}; // GL 4.x ,GL_TEXTURE_RECTANGLE
#elif defined(GL_ARB_texture_rectangle)
,GL_TEXTURE_RECTANGLE_ARB
#elif defined(GL_NV_texture_rectangle)
,GL_TEXTURE_RECTANGLE_NV
#endif
,GL_TEXTURE_CUBE_MAP
#ifdef GL_VERSION_3_0
,GL_TEXTURE_1D_ARRAY,GL_TEXTURE_2D_ARRAY // GL 3.x
#elif GL_EXT_texture_array
,GL_TEXTURE_1D_ARRAY_EXT,GL_TEXTURE_2D_ARRAY_EXT
#endif
#ifdef GL_VERSION_3_1
,GL_TEXTURE_BUFFER
#elif defined(GL_ARB_texture_buffer_object)
,GL_TEXTURE_BUFFER_ARB
#elif defined(GL_EXT_texture_buffer_object)
,GL_TEXTURE_BUFFER_EXT
#endif
#ifdef GL_VERSION_4_0
,GL_TEXTURE_CUBE_MAP_ARRAY // GL 4.x
#elif defined(GL_ARB_texture_cube_map_array)
,GL_TEXTURE_CUBE_MAP_ARRAY_ARB
#endif
#ifdef GL_VERSION_3_2
,GL_TEXTURE_2D_MULTISAMPLE,GL_TEXTURE_2D_MULTISAMPLE_ARRAY
#endif
};
if (Version>=404||FeatureAvailable[IRR_ARB_multi_bind]) if (Version>=404||FeatureAvailable[IRR_ARB_multi_bind])
{ {
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlBindTextures) if (pGlBindTextures)
pGlBindTextures(first,count,textures); pGlBindTextures(first,count,textures);
#else #elif defined(GL_VERSION_4_4)
glBindTextures(first,count,textures); glBindTextures(first,count,textures);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -3201,7 +3273,7 @@ inline void COpenGLExtensionHandler::extGlGenerateTextureMipmap(GLuint texture,
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGenerateTextureMipmap) if (pGlGenerateTextureMipmap)
pGlGenerateTextureMipmap(texture); pGlGenerateTextureMipmap(texture);
#else #elif defined(GL_VERSION_4_5)
glGenerateTextureMipmap(texture); glGenerateTextureMipmap(texture);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -3210,7 +3282,7 @@ inline void COpenGLExtensionHandler::extGlGenerateTextureMipmap(GLuint texture,
#ifdef _IRR_OPENGL_USE_EXTPOINTER_ #ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGenerateTextureMipmapEXT) if (pGlGenerateTextureMipmapEXT)
pGlGenerateTextureMipmapEXT(texture,target); pGlGenerateTextureMipmapEXT(texture,target);
#else #elif defined(GL_EXT_direct_state_access)
glGenerateTextureMipmapEXT(texture,target); glGenerateTextureMipmapEXT(texture,target);
#endif // _IRR_OPENGL_USE_EXTPOINTER_ #endif // _IRR_OPENGL_USE_EXTPOINTER_
} }
@ -3226,33 +3298,63 @@ inline void COpenGLExtensionHandler::extGlGenerateTextureMipmap(GLuint texture,
case GL_TEXTURE_1D: case GL_TEXTURE_1D:
glGetIntegerv(GL_TEXTURE_BINDING_1D, &bound); glGetIntegerv(GL_TEXTURE_BINDING_1D, &bound);
break; break;
#ifdef GL_VERSION_3_0
case GL_TEXTURE_1D_ARRAY: case GL_TEXTURE_1D_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY, &bound);
break; break;
#elif GL_EXT_texture_array
case GL_TEXTURE_1D_ARRAY_EXT:
glGetIntegerv(GL_TEXTURE_BINDING_1D_ARRAY_EXT, &bound);
break;
#endif
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D, &bound);
break; break;
#ifdef GL_VERSION_3_0
case GL_TEXTURE_2D_ARRAY: case GL_TEXTURE_2D_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY, &bound);
break; break;
#elif GL_EXT_texture_array
case GL_TEXTURE_2D_ARRAY_EXT:
glGetIntegerv(GL_TEXTURE_BINDING_2D_ARRAY_EXT, &bound);
break;
#endif
#ifdef GL_VERSION_3_2
case GL_TEXTURE_2D_MULTISAMPLE: case GL_TEXTURE_2D_MULTISAMPLE:
glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE, &bound);
break; break;
case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY, &bound);
break; break;
#endif
case GL_TEXTURE_3D: case GL_TEXTURE_3D:
glGetIntegerv(GL_TEXTURE_BINDING_3D, &bound); glGetIntegerv(GL_TEXTURE_BINDING_3D, &bound);
break; break;
#ifdef GL_VERSION_3_1
case GL_TEXTURE_BUFFER: case GL_TEXTURE_BUFFER:
glGetIntegerv(GL_TEXTURE_BINDING_BUFFER, &bound); glGetIntegerv(GL_TEXTURE_BINDING_BUFFER, &bound);
break; break;
#elif defined(GL_ARB_texture_buffer_object)
case GL_TEXTURE_BUFFER_ARB:
glGetIntegerv(GL_TEXTURE_BINDING_BUFFER_ARB, &bound);
break;
#elif defined(GL_EXT_texture_buffer_object)
case GL_TEXTURE_BUFFER_EXT:
glGetIntegerv(GL_TEXTURE_BINDING_BUFFER_EXT, &bound);
break;
#endif
case GL_TEXTURE_CUBE_MAP: case GL_TEXTURE_CUBE_MAP:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &bound); glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP, &bound);
break; break;
#ifdef GL_VERSION_4_0
case GL_TEXTURE_CUBE_MAP_ARRAY: case GL_TEXTURE_CUBE_MAP_ARRAY:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, &bound); glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY, &bound);
break; break;
#elif defined(GL_ARB_texture_cube_map_array)
case GL_TEXTURE_CUBE_MAP_ARRAY_ARB:
glGetIntegerv(GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB, &bound);
break;
#endif
case GL_TEXTURE_RECTANGLE: case GL_TEXTURE_RECTANGLE:
glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE, &bound); glGetIntegerv(GL_TEXTURE_BINDING_RECTANGLE, &bound);
break; break;

@ -736,6 +736,7 @@ bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const u32* int
case GL_UNSIGNED_INT: case GL_UNSIGNED_INT:
Driver->extGlUniform1uiv(UniformInfo[index].location, count, reinterpret_cast<const GLuint*>(ints)); Driver->extGlUniform1uiv(UniformInfo[index].location, count, reinterpret_cast<const GLuint*>(ints));
break; break;
#if defined(GL_VERSION_3_0)
case GL_UNSIGNED_INT_VEC2: case GL_UNSIGNED_INT_VEC2:
Driver->extGlUniform2uiv(UniformInfo[index].location, count/2, reinterpret_cast<const GLuint*>(ints)); Driver->extGlUniform2uiv(UniformInfo[index].location, count/2, reinterpret_cast<const GLuint*>(ints));
break; break;
@ -745,6 +746,7 @@ bool COpenGLSLMaterialRenderer::setPixelShaderConstant(s32 index, const u32* int
case GL_UNSIGNED_INT_VEC4: case GL_UNSIGNED_INT_VEC4:
Driver->extGlUniform4uiv(UniformInfo[index].location, count/4, reinterpret_cast<const GLuint*>(ints)); Driver->extGlUniform4uiv(UniformInfo[index].location, count/4, reinterpret_cast<const GLuint*>(ints));
break; break;
#endif
default: default:
status = false; status = false;
break; break;

@ -613,6 +613,8 @@
5E79089B1C10FEF900DFE7FE /* CB3DMeshWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7908981C10FE4A00DFE7FE /* CB3DMeshWriter.cpp */; }; 5E79089B1C10FEF900DFE7FE /* CB3DMeshWriter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E7908981C10FE4A00DFE7FE /* CB3DMeshWriter.cpp */; };
5E8570BC1B7F9AC400B267D2 /* CIrrDeviceConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E8570BA1B7F9AC400B267D2 /* CIrrDeviceConsole.cpp */; }; 5E8570BC1B7F9AC400B267D2 /* CIrrDeviceConsole.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E8570BA1B7F9AC400B267D2 /* CIrrDeviceConsole.cpp */; };
5E9573D71C18E9E600C27989 /* CEAGLManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E9573D61C18E9E600C27989 /* CEAGLManager.mm */; }; 5E9573D71C18E9E600C27989 /* CEAGLManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E9573D61C18E9E600C27989 /* CEAGLManager.mm */; };
8493BC02249DEBB30092813E /* IOctreeSceneNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 8493BC01249DEBB20092813E /* IOctreeSceneNode.h */; };
8493BC04249DED3F0092813E /* IMemoryReadFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 8493BC03249DED3F0092813E /* IMemoryReadFile.h */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
@ -1366,6 +1368,8 @@
5E9573D31C18E9B300C27989 /* CEAGLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEAGLManager.h; sourceTree = "<group>"; }; 5E9573D31C18E9B300C27989 /* CEAGLManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CEAGLManager.h; sourceTree = "<group>"; };
5E9573D61C18E9E600C27989 /* CEAGLManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CEAGLManager.mm; sourceTree = "<group>"; }; 5E9573D61C18E9E600C27989 /* CEAGLManager.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CEAGLManager.mm; sourceTree = "<group>"; };
5EC24F5E1B8B861200DCA615 /* exampleHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = exampleHelper.h; path = ../../include/exampleHelper.h; sourceTree = "<group>"; }; 5EC24F5E1B8B861200DCA615 /* exampleHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = exampleHelper.h; path = ../../include/exampleHelper.h; sourceTree = "<group>"; };
8493BC01249DEBB20092813E /* IOctreeSceneNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOctreeSceneNode.h; path = ../../include/IOctreeSceneNode.h; sourceTree = "<group>"; };
8493BC03249DED3F0092813E /* IMemoryReadFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IMemoryReadFile.h; path = ../../include/IMemoryReadFile.h; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -1508,6 +1512,7 @@
5E34C7401B7F4AFC00F212E8 /* IMeshTextureLoader.h */, 5E34C7401B7F4AFC00F212E8 /* IMeshTextureLoader.h */,
5E34C7411B7F4AFC00F212E8 /* IMeshWriter.h */, 5E34C7411B7F4AFC00F212E8 /* IMeshWriter.h */,
5E34C7421B7F4AFC00F212E8 /* IMetaTriangleSelector.h */, 5E34C7421B7F4AFC00F212E8 /* IMetaTriangleSelector.h */,
8493BC01249DEBB20092813E /* IOctreeSceneNode.h */,
5E34C7441B7F4AFC00F212E8 /* IParticleAffector.h */, 5E34C7441B7F4AFC00F212E8 /* IParticleAffector.h */,
5E34C7451B7F4AFC00F212E8 /* IParticleAnimatedMeshSceneNodeEmitter.h */, 5E34C7451B7F4AFC00F212E8 /* IParticleAnimatedMeshSceneNodeEmitter.h */,
5E34C7461B7F4AFC00F212E8 /* IParticleAttractionAffector.h */, 5E34C7461B7F4AFC00F212E8 /* IParticleAttractionAffector.h */,
@ -1565,6 +1570,7 @@
5E34C7101B7F4AFC00F212E8 /* IFileArchive.h */, 5E34C7101B7F4AFC00F212E8 /* IFileArchive.h */,
5E34C7111B7F4AFC00F212E8 /* IFileList.h */, 5E34C7111B7F4AFC00F212E8 /* IFileList.h */,
5E34C7121B7F4AFC00F212E8 /* IFileSystem.h */, 5E34C7121B7F4AFC00F212E8 /* IFileSystem.h */,
8493BC03249DED3F0092813E /* IMemoryReadFile.h */,
5E34C7551B7F4AFC00F212E8 /* IReadFile.h */, 5E34C7551B7F4AFC00F212E8 /* IReadFile.h */,
5E34C7631B7F4AFC00F212E8 /* irrXML.h */, 5E34C7631B7F4AFC00F212E8 /* irrXML.h */,
5E34C77B1B7F4AFC00F212E8 /* IWriteFile.h */, 5E34C77B1B7F4AFC00F212E8 /* IWriteFile.h */,
@ -2445,6 +2451,11 @@
isa = PBXHeadersBuildPhase; isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
5E8570BD1B7F9AC400B267D2 /* CIrrDeviceConsole.h in Headers */,
5E7908961C10EEC000DFE7FE /* COpenGLCommon.h in Headers */,
8493BC04249DED3F0092813E /* IMemoryReadFile.h in Headers */,
5E7908951C10EEC000DFE7FE /* COpenGLCacheHandler.h in Headers */,
8493BC02249DEBB30092813E /* IOctreeSceneNode.h in Headers */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };