Browse Source

Updated for OpenGL ES 2 support.

pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
a46b51b11f
  1. 28
      src/Framebuffer.h
  2. 7
      src/Mesh.cpp

28
src/Framebuffer.h

@ -58,13 +58,14 @@ class MAGNUM_EXPORT Framebuffer {
*/ */
Blending = GL_BLEND, Blending = GL_BLEND,
#ifndef MAGNUM_TARGET_GLES
/** /**
* Logical operation * Logical operation
* @see setLogicOperation() * @see setLogicOperation()
* @requires_gl Logic operations on framebuffer are in desktop OpenGL only.
*/ */
LogicOperation = GL_COLOR_LOGIC_OP, LogicOperation = GL_COLOR_LOGIC_OP,
#ifndef MAGNUM_TARGET_GLES
/** /**
* Depth clamping. If enabled, ignores near and far clipping plane. * Depth clamping. If enabled, ignores near and far clipping plane.
* @requires_gl * @requires_gl
@ -393,9 +394,24 @@ class MAGNUM_EXPORT Framebuffer {
enum class BlendEquation: GLenum { enum class BlendEquation: GLenum {
Add = GL_FUNC_ADD, /**< `source + destination` */ Add = GL_FUNC_ADD, /**< `source + destination` */
Subtract = GL_FUNC_SUBTRACT, /**< `source - destination` */ Subtract = GL_FUNC_SUBTRACT, /**< `source - destination` */
ReverseSubtract = GL_FUNC_REVERSE_SUBTRACT, /**< `destination - source` */ ReverseSubtract = GL_FUNC_REVERSE_SUBTRACT /**< `destination - source` */
Min = GL_MIN, /**< `min(source, destination)` */
Max = GL_MAX /**< `max(source, destination)` */ #ifndef MAGNUM_TARGET_GLES
/** @todo Enable for ES3 when the headers are available */
,
/**
* `min(source, destination)`
* @requires_gles30 Extension @es_extension{EXT,blend_minmax}
*/
Min = GL_MIN,
/**
* `max(source, destination)`
* @requires_gles30 Extension @es_extension{EXT,blend_minmax}
*/
Max = GL_MAX
#endif
}; };
/** /**
@ -585,12 +601,14 @@ class MAGNUM_EXPORT Framebuffer {
/*@}*/ /*@}*/
#ifndef MAGNUM_TARGET_GLES
/** @{ @name Logical operation */ /** @{ @name Logical operation */
/** /**
* @brief Logical operation * @brief Logical operation
* *
* @see setLogicOperation() * @see setLogicOperation()
* @requires_gl
*/ */
enum class LogicOperation: GLenum { enum class LogicOperation: GLenum {
Clear = GL_CLEAR, /**< `0` */ Clear = GL_CLEAR, /**< `0` */
@ -615,12 +633,14 @@ class MAGNUM_EXPORT Framebuffer {
* @brief Set logical operation * @brief Set logical operation
* *
* @attention You have to enable logical operation with setFeature() first. * @attention You have to enable logical operation with setFeature() first.
* @requires_gl Logic operations on framebuffer are in desktop OpenGL only.
*/ */
inline static void setLogicOperation(LogicOperation operation) { inline static void setLogicOperation(LogicOperation operation) {
glLogicOp(static_cast<GLenum>(operation)); glLogicOp(static_cast<GLenum>(operation));
} }
/*@}*/ /*@}*/
#endif
/** @{ @name Framebuffer creation and binding */ /** @{ @name Framebuffer creation and binding */

7
src/Mesh.cpp

@ -26,7 +26,9 @@ Mesh::Mesh(Mesh&& other):
#endif #endif
_primitive(other._primitive), _vertexCount(other._vertexCount), finalized(other.finalized), _buffers(other._buffers), _attributes(other._attributes) _primitive(other._primitive), _vertexCount(other._vertexCount), finalized(other.finalized), _buffers(other._buffers), _attributes(other._attributes)
{ {
#ifndef MAGNUM_TARGET_GLES
other.vao = 0; other.vao = 0;
#endif
} }
void Mesh::destroy() { void Mesh::destroy() {
@ -41,13 +43,18 @@ void Mesh::destroy() {
Mesh& Mesh::operator=(Mesh&& other) { Mesh& Mesh::operator=(Mesh&& other) {
destroy(); destroy();
#ifndef MAGNUM_TARGET_GLES
vao = other.vao; vao = other.vao;
#endif
_primitive = other._primitive; _primitive = other._primitive;
_vertexCount = other._vertexCount; _vertexCount = other._vertexCount;
finalized = other.finalized; finalized = other.finalized;
_buffers = other._buffers; _buffers = other._buffers;
_attributes = other._attributes; _attributes = other._attributes;
#ifndef MAGNUM_TARGET_GLES
other.vao = 0; other.vao = 0;
#endif
return *this; return *this;
} }

Loading…
Cancel
Save