From cee40d58528d63ded147b8e6b950701be7919c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 18 May 2013 11:10:45 +0200 Subject: [PATCH] Fixed compilation of Renderer on OpenGL ES. --- src/Renderer.cpp | 8 ++++++++ src/Renderer.h | 24 +++++++++++++----------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Renderer.cpp b/src/Renderer.cpp index 80602741b..9284c3896 100644 --- a/src/Renderer.cpp +++ b/src/Renderer.cpp @@ -41,9 +41,11 @@ void Renderer::setClearColor(const Color4<>& color) { glClearColor(color.r(), color.g(), color.b(), color.a()); } +#ifndef MAGNUM_TARGET_GLES void Renderer::setClearDepth(const Double depth) { glClearDepth(depth); } +#endif void Renderer::setClearDepth(const Float depth) { glClearDepthf(depth); @@ -57,6 +59,7 @@ void Renderer::setFrontFace(const FrontFace mode) { glFrontFace(GLenum(mode)); } +#ifndef MAGNUM_TARGET_GLES void Renderer::setProvokingVertex(const ProvokingVertex mode) { glProvokingVertex(GLenum(mode)); } @@ -64,6 +67,7 @@ void Renderer::setProvokingVertex(const ProvokingVertex mode) { void Renderer::setPolygonMode(const PolygonMode mode) { glPolygonMode(GL_FRONT_AND_BACK, GLenum(mode)); } +#endif void Renderer::setPolygonOffset(const Float factor, const Float units) { glPolygonOffset(factor, units); @@ -73,9 +77,11 @@ void Renderer::setLineWidth(const Float width) { glLineWidth(width); } +#ifndef MAGNUM_TARGET_GLES void Renderer::setPointSize(const Float size) { glPointSize(size); } +#endif void Renderer::setScissor(const Rectanglei& rectangle) { glScissor(rectangle.left(), rectangle.bottom(), rectangle.width(), rectangle.height()); @@ -137,8 +143,10 @@ void Renderer::setBlendColor(const Color4<>& color) { glBlendColor(color.r(), color.g(), color.b(), color.a()); } +#ifndef MAGNUM_TARGET_GLES void Renderer::setLogicOperation(const LogicOperation operation) { glLogicOp(GLenum(operation)); } +#endif } diff --git a/src/Renderer.h b/src/Renderer.h index eed34659e..aba39ab23 100644 --- a/src/Renderer.h +++ b/src/Renderer.h @@ -75,15 +75,6 @@ class MAGNUM_EXPORT Renderer { */ Blending = GL_BLEND, - /** - * Seamless cube map texture. - * @see CubeMapTexture, CubeMapTextureArray - * @requires_gl32 %Extension @extension{ARB,seamless_cube_map} - * @requires_gl Not available in OpenGL ES 2.0, always enabled in - * OpenGL ES 3.0. - */ - SeamlessCubeMapTexture = GL_TEXTURE_CUBE_MAP_SEAMLESS, - #ifndef MAGNUM_TARGET_GLES /** * Depth clamping. If enabled, ignores near and far clipping plane. @@ -157,6 +148,7 @@ class MAGNUM_EXPORT Renderer { PolygonOffsetPoint = GL_POLYGON_OFFSET_POINT, #endif + #ifndef MAGNUM_TARGET_GLES /** * Programmable point size. If enabled, the point size is taken * from vertex/geometry shader builtin `gl_PointSize`. @@ -164,6 +156,7 @@ class MAGNUM_EXPORT Renderer { * @requires_gl Always enabled on OpenGL ES. */ ProgramPointSize = GL_PROGRAM_POINT_SIZE, + #endif /** * Scissor test @@ -171,6 +164,17 @@ class MAGNUM_EXPORT Renderer { */ ScissorTest = GL_SCISSOR_TEST, + #ifndef MAGNUM_TARGET_GLES + /** + * Seamless cube map texture. + * @see CubeMapTexture, CubeMapTextureArray + * @requires_gl32 %Extension @extension{ARB,seamless_cube_map} + * @requires_gl Not available in OpenGL ES 2.0, always enabled in + * OpenGL ES 3.0. + */ + SeamlessCubeMapTexture = GL_TEXTURE_CUBE_MAP_SEAMLESS, + #endif + /** * Stencil test * @see setClearStencil(), setStencilFunction(), @@ -289,9 +293,7 @@ class MAGNUM_EXPORT Renderer { * @requires_gl OpenGL ES behaves always like the default. */ static void setProvokingVertex(ProvokingVertex mode); - #endif - #ifndef MAGNUM_TARGET_GLES /** * @brief Polygon mode *