Browse Source

Several new buffer targets and usages are available on OpenGL ES 3.0.

In turn also BufferedImage is now available on OpenGL ES 3.0.
vectorfields
Vladimír Vondruš 14 years ago
parent
commit
b067a6d1dc
  1. 48
      src/Buffer.h
  2. 4
      src/BufferedImage.h

48
src/Buffer.h

@ -44,40 +44,36 @@ class Buffer {
/** Used for storing vertex attributes. */ /** Used for storing vertex attributes. */
Array = GL_ARRAY_BUFFER, Array = GL_ARRAY_BUFFER,
#ifndef MAGNUM_TARGET_GLES
/** /**
* Source for copies. * Source for copies.
* @requires_gl
* @requires_gl31 Extension @extension{ARB,copy_buffer} * @requires_gl31 Extension @extension{ARB,copy_buffer}
* @requires_gles30 (no extension providing this functionality)
*/ */
CopyRead = GL_COPY_READ_BUFFER, CopyRead = GL_COPY_READ_BUFFER,
/** /**
* Target for copies. * Target for copies.
* @requires_gl
* @requires_gl31 Extension @extension{ARB,copy_buffer} * @requires_gl31 Extension @extension{ARB,copy_buffer}
* @requires_gles30 (no extension providing this functionality)
*/ */
CopyWrite = GL_COPY_WRITE_BUFFER, CopyWrite = GL_COPY_WRITE_BUFFER,
#endif
/** Used for storing vertex indices. */ /** Used for storing vertex indices. */
ElementArray = GL_ELEMENT_ARRAY_BUFFER ElementArray = GL_ELEMENT_ARRAY_BUFFER,
#ifndef MAGNUM_TARGET_GLES
,
/** /**
* Source for texture update operations. * Source for texture update operations.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
PixelUnpack = GL_PIXEL_UNPACK_BUFFER, PixelUnpack = GL_PIXEL_UNPACK_BUFFER,
/** /**
* Target for pixel pack operations. * Target for pixel pack operations.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
PixelPack = GL_PIXEL_PACK_BUFFER, PixelPack = GL_PIXEL_PACK_BUFFER,
#ifndef MAGNUM_TARGET_GLES
/** /**
* Source for texel fetches. * Source for texel fetches.
* *
@ -86,20 +82,24 @@ class Buffer {
* @requires_gl31 Extension @extension{ARB,texture_buffer_object} * @requires_gl31 Extension @extension{ARB,texture_buffer_object}
*/ */
Texture = GL_TEXTURE_BUFFER, Texture = GL_TEXTURE_BUFFER,
#endif
/** /**
* Target for transform feedback. * Target for transform feedback.
* @requires_gl
* @requires_gl30 Extension @extension{EXT,transform_feedback} * @requires_gl30 Extension @extension{EXT,transform_feedback}
* @requires_gles30 (no extension providing this functionality)
*/ */
TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER, TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER,
/** /**
* Used for storing uniforms. * Used for storing uniforms.
* @requires_gl
* @requires_gl31 Extension @extension{ARB,uniform_buffer_object} * @requires_gl31 Extension @extension{ARB,uniform_buffer_object}
* @requires_gles30 (no extension providing this functionality)
*/ */
Uniform = GL_UNIFORM_BUFFER, Uniform = GL_UNIFORM_BUFFER
#ifndef MAGNUM_TARGET_GLES
,
/** /**
* Used for supplying arguments for instanced drawing. * Used for supplying arguments for instanced drawing.
@ -117,66 +117,58 @@ class Buffer {
*/ */
StreamDraw = GL_STREAM_DRAW, StreamDraw = GL_STREAM_DRAW,
#ifndef MAGNUM_TARGET_GLES
/** /**
* Set once as output from an OpenGL command and used infequently * Set once as output from an OpenGL command and used infequently
* for drawing. * for drawing.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
StreamRead = GL_STREAM_READ, StreamRead = GL_STREAM_READ,
/** /**
* Set once as output from an OpenGL command and used infrequently * Set once as output from an OpenGL command and used infrequently
* for drawing or copying to other buffers. * for drawing or copying to other buffers.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
StreamCopy = GL_STREAM_COPY, StreamCopy = GL_STREAM_COPY,
#endif
/** /**
* Set once by the application and used frequently for drawing. * Set once by the application and used frequently for drawing.
*/ */
StaticDraw = GL_STATIC_DRAW, StaticDraw = GL_STATIC_DRAW,
#ifndef MAGNUM_TARGET_GLES
/** /**
* Set once as output from an OpenGL command and queried many * Set once as output from an OpenGL command and queried many
* times by the application. * times by the application.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
StaticRead = GL_STATIC_READ, StaticRead = GL_STATIC_READ,
/** /**
* Set once as output from an OpenGL command and used frequently * Set once as output from an OpenGL command and used frequently
* for drawing or copying to other buffers. * for drawing or copying to other buffers.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
StaticCopy = GL_STATIC_COPY, StaticCopy = GL_STATIC_COPY,
#endif
/** /**
* Updated frequently by the application and used frequently * Updated frequently by the application and used frequently
* for drawing or copying to other images. * for drawing or copying to other images.
*/ */
DynamicDraw = GL_DYNAMIC_DRAW DynamicDraw = GL_DYNAMIC_DRAW,
#ifndef MAGNUM_TARGET_GLES
,
/** /**
* Updated frequently as output from OpenGL command and queried * Updated frequently as output from OpenGL command and queried
* many times from the application. * many times from the application.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
DynamicRead = GL_DYNAMIC_READ, DynamicRead = GL_DYNAMIC_READ,
/** /**
* Updated frequently as output from OpenGL command and used * Updated frequently as output from OpenGL command and used
* frequently for drawing or copying to other images. * frequently for drawing or copying to other images.
* @requires_gl * @requires_gles30 (no extension providing this functionality)
*/ */
DynamicCopy = GL_DYNAMIC_COPY DynamicCopy = GL_DYNAMIC_COPY
#endif
}; };
/** /**

4
src/BufferedImage.h

@ -25,7 +25,6 @@
namespace Magnum { namespace Magnum {
#ifndef MAGNUM_TARGET_GLES
/** /**
@brief %Buffered image @brief %Buffered image
@ -33,7 +32,7 @@ Class for storing image data in GPU memory. Can be replaced with Image, which
stores image data in client memory, ImageWrapper, or for example with stores image data in client memory, ImageWrapper, or for example with
Trade::ImageData. Trade::ImageData.
@see Buffer @see Buffer
@requires_gl @requires_gles30 (no extension providing this functionality)
*/ */
template<size_t imageDimensions> class BufferedImage: public AbstractImage { template<size_t imageDimensions> class BufferedImage: public AbstractImage {
public: public:
@ -119,7 +118,6 @@ typedef BufferedImage<2> BufferedImage2D;
/** @brief Three-dimensional buffered image */ /** @brief Three-dimensional buffered image */
typedef BufferedImage<3> BufferedImage3D; typedef BufferedImage<3> BufferedImage3D;
#endif
} }

Loading…
Cancel
Save