13#ifndef ML_GLRESOURCES_H
14#define ML_GLRESOURCES_H
88 bool isValid()
const {
return !_ids.empty(); }
100 std::vector<GLuint> _ids;
236 inline bool isValid()
const {
return _id!=0; }
319 inline bool isValid()
const {
return _id!=0; }
Manages a generic OpenGL buffer object.
void contextDestroyed() override
forget the resource, the context was destroyed
bool isValid() const
check if the program is valid
GLuint getHandle() const
get the buffers's handle (you need to create() the buffer before you get a handle)
void create()
create the pixel buffer (requires valid GL context)
void destroy()
destroy the resource
ARB_FRAGMENT_PROGRAM resource.
void destroy()
destroy the resource
void contextDestroyed() override
forget the resource, the context was destroyed
~GLFragmentProgramARB() override
GLuint getHandle() const
get the program's handle (you need to create() the texture before you get a handle)
bool isValid() const
check if the program is valid
void create()
create the program (requires valid GL context)
FrameBufferObject resource (frame_buffer_object extension)
~GLFrameBuffer() override
void destroy()
destroy the resource
GLuint getHandle() const
get the program's handle (you need to create() the buffer before you get a handle)
bool isValid() const
check if the program is valid
void create()
create the program (requires valid GL context)
void contextDestroyed() override
forget the resource, the context was destroyed
PixelBuffer resource (pixel_buffer_object) http://www.opengl.org/registry/specs/ARB/pixel_buffer_obje...
RenderBuffer resource (frame_buffer_object extension)
void create()
create the program (requires valid GL context)
void destroy()
destroy the resource
void contextDestroyed() override
forget the resource, the context was destroyed
bool isValid() const
check if the program is valid
GLuint getHandle() const
get the program's handle (you need to create() the buffer before you get a handle)
~GLRenderBuffer() override
Manages OpenGL resources.
Collection of OpenGL related resource classes, such as textures, buffers, fragment programs etc.
virtual void contextDestroyed()=0
forget the resource, the context was destroyed
static GLenum getGLError()
check for OpenGL error (returns GL_INVALID_OPERATION if there is no valid OpenGL context)
GLSL FragmentShader resource.
~GLSLFragmentShader() override
GLSL GeometryShader resource.
~GLSLGeometryShader() override
bool isValid() const
check if the program is valid
void detachShader(GLSLShader &shader)
detach the given shader (this is safe to be called outside of a valid GL context)
void destroy()
destroy the resource
void detachShader(GLuint shader)
detach the given shader (this is safe to be called outside of a valid GL context)
void disable()
disable program
GLuint getHandle() const
get the program's handle (you need to create() the buffer before you get a handle)
void contextDestroyed() override
forget the resource, the context was destroyed
void create()
create the program (requires valid GL context)
void contextDestroyed() override
forget the resource, the context was destroyed
GLSLShader(GLenum shaderType)
void create()
create the program (requires valid GL context)
bool isValid() const
check if the program is valid
void destroy()
destroy the resource
GLuint getHandle() const
get the program's handle (you need to create() the buffer before you get a handle)
GLSL VertexShader resource.
~GLSLVertexShader() override
void contextDestroyed() override
forget the resource, the context was destroyed
void create()
create the texture (requires valid GL context)
GLuint getHandle() const
get the texture's handle (you need to create() the texture before you get a handle)
bool isValid() const
check if the texture is valid
void destroy()
destroy the resource
Texture class that manages multiple texture ids.
GLuint getHandle(GLsizei i) const
get the texture's handle (you need to create() the texture before you get a handle)
void destroy()
destroy the resource
void contextDestroyed() override
forget the resource, the context was destroyed
void create(GLsizei numberOfTextures)
create the textures (requires valid GL context)
GLsizei getNumTextures() const
get the number of created textures
bool isValid() const
check if the texture is valid
VertexBuffer resource (vertex_buffer_object extension) http://www.opengl.org/registry/specs/ARB/verte...
#define ML_OPENGL_END_NAMESPACE
Closes the namespace for all ML stuff after the usage of ML_UTILS_START_NAMESPACE.
#define ML_OPENGL_START_NAMESPACE
Macro to put all following stuff into the namespace ML_NAMESPACE to avoid collisions with symbols of ...
Target mlrange_cast(Source arg)
Generic version of checked ML casts.