#include <OpenGl_GlFunctions.hxx>
-//! TBO is available on OpenGL 3.0+ hardware
+//! TBO is available on OpenGL 3.0+ and OpenGL ES 3.2+ hardware
struct OpenGl_ArbTBO : protected OpenGl_GlFunctions
{
-#if !defined(GL_ES_VERSION_2_0)
using OpenGl_GlFunctions::glTexBuffer;
-#endif
};
#endif // _OpenGl_ArbTBO_H__
GLenum anID = (GLenum)aProps.ContextID;
const bool toUseFfp = theGlCtx->core11 != NULL
&& theGlCtx->caps->ffpEnable;
+#else
+ (void )theGlCtx;
#endif
if (theIsEnabled)
{
arbTexFloat = IsGlGreaterEqual (3, 0)
&& FindProc ("glTexImage3D", myFuncs->glTexImage3D);
+
+ const Standard_Boolean hasTexBuffer32 = IsGlGreaterEqual (3, 2) && FindProc ("glTexBuffer", myFuncs->glTexBuffer);
+ const Standard_Boolean hasExtTexBuffer = CheckExtension ("GL_EXT_texture_buffer") && FindProc ("glTexBufferEXT", myFuncs->glTexBuffer);
+
+ if (hasTexBuffer32 || hasExtTexBuffer)
+ {
+ arbTBO = reinterpret_cast<OpenGl_ArbTBO*> (myFuncs.get());
+ }
#else
myTexClamp = IsGlGreaterEqual (1, 2) ? GL_CLAMP_TO_EDGE : GL_CLAMP;
#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
#define GL_MAX_SAMPLES 0x8D57
+ // OpenGL ES 3.2+ or GL_EXT_texture_buffer for OpenGL ES 3.1+
+ #define GL_TEXTURE_BUFFER 0x8C2A
+
// in core since OpenGL ES 3.0, extension GL_EXT_texture_rg
#define GL_RED 0x1903
#define GL_R8 0x8229
#define GL_RG16F 0x822F
#define GL_RG32F 0x8230
+ #define GL_R32I 0x8235
+ #define GL_RG32I 0x823B
+ #define GL_RGB32I 0x8D83
+ #define GL_RGBA32I 0x8D82
+
// GL_OES_packed_depth_stencil
#define GL_DEPTH_STENCIL 0x84F9
#define GL_UNSIGNED_INT_24_8 0x84FA
#define GL_DEBUG_SEVERITY_HIGH 0x9146
#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
#define GL_DEBUG_SEVERITY_LOW 0x9148
-
- // GL_EXT_texture_buffer for OpenGL ES 3.1+
- #define GL_TEXTURE_BUFFER_ARB 0x8C2A
#endif
#if defined(__ANDROID__) || defined(__QNX__)
typedef void (*glTexStorage2DMultisample_t)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
glTexStorage2DMultisample_t glTexStorage2DMultisample;
+public: //! @name OpenGL ES 3.2
+
+ typedef void (*glTexBuffer_t)(GLenum target, GLenum internalFormat, GLuint buffer);
+ glTexBuffer_t glTexBuffer;
+
#else // OpenGL ES vs. desktop
public: //! @name OpenGL 1.2
NSView* TheSpecifiedWindowId = THEWindow->HView();
#endif
#elif defined(__ANDROID__) || defined(__QNX__)
+ (void )AWindow;
int TheSpecifiedWindowId = -1;
#else
const Handle(Xw_Window) THEWindow = Handle(Xw_Window)::DownCast (AWindow);
glPolygonStipple ((const GLubyte* )myInteriors[i < nbi ? i : 0]);
glEndList();
}
+#else
+ (void )theGlCtx;
#endif
}
}
else
glDisable (GL_POLYGON_STIPPLE);
+#else
+ (void )theType;
#endif
}
{
#if !defined(GL_ES_VERSION_2_0) || defined(GL_ES_VERSION_3_0)
theContext.core33->glBindSampler (theUnit, mySamplerID);
+ #else
+ (void )theContext;
+ (void )theUnit;
#endif
}
}
{
#if !defined(GL_ES_VERSION_2_0) || defined(GL_ES_VERSION_3_0)
theContext.core33->glBindSampler (theUnit, NO_SAMPLER);
+ #else
+ (void )theContext;
+ (void )theUnit;
#endif
}
}
{
#if !defined(GL_ES_VERSION_2_0) || defined(GL_ES_VERSION_3_0)
theContext.core33->glSamplerParameteri (mySamplerID, theParam, theValue);
+ #else
+ (void )theContext;
+ (void )theParam;
+ (void )theValue;
#endif
}
}
#if !defined(GL_ES_VERSION_2_0)
theCtx->core32->glUniform2uiv (theLocation, 1, theValue.GetData());
-#endif
-
return Standard_True;
+#else
+ (void )theValue;
+ return Standard_False;
+#endif
}
// =======================================================================
#if !defined(GL_ES_VERSION_2_0)
theCtx->core32->glUniform2uiv (theLocation, theCount, theValue->GetData());
-#endif
-
return Standard_True;
+#else
+ (void )theCount;
+ (void )theValue;
+ return Standard_False;
+#endif
}
// =======================================================================
{
theWorkspace->EnableTexture (aPrevTexture);
}
+ #else
+ (void )theWorkspace;
#endif
}
theVertsPerTexture.Clear();
theTCrdsPerTexture.Clear();
- OpenGl_Font::Tile aTile = {};
+ OpenGl_Font::Tile aTile = {Font_Rect(), Font_Rect(), 0u};
OpenGl_Vec2 aPen (0.0f, 0.0f);
Standard_Integer aRectsNb = 0;
Standard_Integer aSymbolsCounter = 0;
Unbind (theCtx);
return true;
#else
+ (void )theSizeX;
+ (void )theSizeY;
+ (void )theFormat;
return false;
#endif
}
// =======================================================================
GLenum OpenGl_TextureBufferArb::GetTarget() const
{
- return GL_TEXTURE_BUFFER_ARB; // GL_TEXTURE_BUFFER for OpenGL 3.1+
+ return GL_TEXTURE_BUFFER; // GL_TEXTURE_BUFFER for OpenGL 3.1+, OpenGL ES 3.2
}
// =======================================================================
const GLsizei theElemsNb,
const GLfloat* theData)
{
-#if !defined(GL_ES_VERSION_2_0)
- if (theComponentsNb < 1
- || theComponentsNb > 4)
+ if (theGlCtx->arbTBO == NULL)
+ {
+ return false;
+ }
+ else if (theComponentsNb < 1
+ || theComponentsNb > 4)
{
// unsupported format
return false;
UnbindTexture (theGlCtx);
Unbind (theGlCtx);
return true;
-#else
- return false;
-#endif
}
// =======================================================================
const GLsizei theElemsNb,
const GLuint* theData)
{
-#if !defined(GL_ES_VERSION_2_0)
- if (theComponentsNb < 1
- || theComponentsNb > 4)
+ if (theGlCtx->arbTBO == NULL)
+ {
+ return false;
+ }
+ else if (theComponentsNb < 1
+ || theComponentsNb > 4)
{
// unsupported format
return false;
UnbindTexture (theGlCtx);
Unbind (theGlCtx);
return true;
-#else
- return false;
-#endif
}
// =======================================================================
{
return Standard_False;
}
+#else
+ (void )theBufferType;
#endif
// bind FBO if used