13#ifndef ML_GLRESOURCES_H
14#define ML_GLRESOURCES_H
22ML_OPENGL_START_NAMESPACE
88 bool isValid()
const {
return !_ids.empty(); }
91 void create(GLsizei numberOfTextures);
100 std::vector<GLuint> _ids;
229 GLSLShader(GLenum shaderType) : _shaderType(shaderType), _id(0) {}
236 inline bool isValid()
const {
return _id!=0; }
249 GLSLShader() : _shaderType(GL_NONE), _id(0) {}
252 GLSLShader(
const GLSLShader &) : GLResource() {}
253 GLSLShader &operator = (
const GLSLShader &) {
return *
this; }
269 GLSLVertexShader &operator = (
const GLSLVertexShader &) {
return *
this; }
282 GLSLFragmentShader &operator = (
const GLSLFragmentShader &) {
return *
this; }
295 GLSLGeometryShader &operator = (
const GLSLGeometryShader &) {
return *
this; }
319 inline bool isValid()
const {
return _id!=0; }
335 GLSLProgram &operator = (
const GLSLProgram &) {
return *
this; }
340ML_OPENGL_END_NAMESPACE
Manages a generic OpenGL buffer object.
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 contextDestroyed() override
forget the resource, the context was destroyed
void create()
create the pixel buffer (requires valid GL context)
void destroy()
destroy the resource
ARB_FRAGMENT_PROGRAM resource.
void destroy()
destroy the resource
~GLFragmentProgramARB() override
void contextDestroyed() override
forget the resource, the context was destroyed
void create()
create the program (requires valid GL context)
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
FrameBufferObject resource (frame_buffer_object extension)
~GLFrameBuffer() override
void contextDestroyed() override
forget the resource, the context was destroyed
void destroy()
destroy the resource
void create()
create the program (requires valid GL context)
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)
PixelBuffer resource (pixel_buffer_object) http://www.opengl.org/registry/specs/ARB/pixel_buffer_obje...
RenderBuffer resource (frame_buffer_object extension)
bool isValid() const
check if the program is valid
void destroy()
destroy the resource
void contextDestroyed() override
forget the resource, the context was destroyed
void create()
create the program (requires valid GL context)
GLuint getHandle() const
get the program's handle (you need to create() the buffer before you get a handle)
~GLRenderBuffer() override
Manages OpenGL resources.
Abstract base class for GLResources.
static GLenum getGLError()
check for OpenGL error (returns GL_INVALID_OPERATION if there is no valid OpenGL context)
virtual void contextDestroyed()=0
forget the resource, the context was destroyed
GLSL FragmentShader resource.
~GLSLFragmentShader() override
GLSL GeometryShader resource.
~GLSLGeometryShader() override
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)
void create()
create the program (requires valid GL context)
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 disable()
disable program
void contextDestroyed() override
forget the resource, the context was destroyed
void detachShader(GLuint shader)
detach the given shader (this is safe to be called outside of a valid GL context)
void create()
create the program (requires valid GL context)
void destroy()
destroy the resource
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
bool isValid() const
check if the program is valid
GLSLShader(GLenum shaderType)
GLSL VertexShader resource.
~GLSLVertexShader() override
void destroy()
destroy the resource
GLuint getHandle() const
get the texture's handle (you need to create() the texture before you get a handle)
void contextDestroyed() override
forget the resource, the context was destroyed
void create()
create the texture (requires valid GL context)
bool isValid() const
check if the texture is valid
Texture class that manages multiple texture ids.
void create(GLsizei numberOfTextures)
create the textures (requires valid GL context)
void contextDestroyed() override
forget the resource, the context was destroyed
void destroy()
destroy the resource
GLuint getHandle(GLsizei i) 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
GLsizei getNumTextures() const
get the number of created textures
VertexBuffer resource (vertex_buffer_object extension) http://www.opengl.org/registry/specs/ARB/verte...
#define MLOPENGL_EXPORT
Macro to put all following stuff into the namespace ML_NAMESPACE to avoid collisions with symbols of ...