8#ifndef META_OCEAN_PLATFORM_GL_CONTEXT_H
9#define META_OCEAN_PLATFORM_GL_CONTEXT_H
327 inline unsigned int majorVersion()
const;
334 inline unsigned int minorVersion()
const;
342 inline bool compatibilityProfile()
const;
348 inline const StringSet& supportedExtensions()
const;
355 inline bool isExtensionSupported(
const std::string& extension)
const;
361 inline unsigned int multisamples()
const;
387 virtual bool createOpenGLContext(
const bool initializeOpenGL33 =
true,
const unsigned int multisamples = 1u);
564 void* handle_ =
nullptr;
567 unsigned int majorVersion_ = 0u;
570 unsigned int minorVersion_ = 0u;
573 bool compatibilityProfile_ =
false;
579 unsigned int multisamples_ = 0u;
This class encapsulates an OpenGL context.
Definition platform/gl/Context.h:29
virtual bool createOpenGLContext(const bool initializeOpenGL33=true, const unsigned int multisamples=1u)
Creates the OpenGL context for this object.
void(*)(GLsizei, const GLuint *) glDeleteRenderbuffersFunction
Definition of the glDeleteRenderbuffers function pointer type.
Definition platform/gl/Context.h:65
void(*)(GLsizei, GLuint *) glGenVertexArraysFunction
Definition of the glGenVertexArrays function pointer type.
Definition platform/gl/Context.h:285
void(*)(GLenum) glActiveTextureFunction
Definition of the glActiveTexture function pointer type.
Definition platform/gl/Context.h:255
GLint(*)(GLuint, const GLchar *) glGetUniformLocationFunction
Definition of the glGetUniformLocation function pointer type.
Definition platform/gl/Context.h:200
void(*)(GLuint, GLuint) glAttachShaderFunction
Definition of the glAttachShader function pointer type.
Definition platform/gl/Context.h:135
virtual ~Context()
Releases the context.
void(*)(GLuint) glLinkProgramFunction
Definition of the glLinkProgram function pointer type.
Definition platform/gl/Context.h:145
void(*)(GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean) glTexImage2DMultisampleFunction
Definition of the glTexImage2DMultisample function pointer type.
Definition platform/gl/Context.h:270
bool isExtensionSupported(const std::string &extension) const
Returns whether a specific extension is supported.
Definition platform/gl/Context.h:607
void(*)(GLenum, GLsizei, GLenum, GLsizei, GLsizei) glRenderbufferStorageMultisampleFunction
Definition of the glRenderbufferStorageMultisample function pointer type.
Definition platform/gl/Context.h:80
void(*)(GLsizei, const GLuint *) glDeleteBuffersFunction
Definition of the glDeleteBuffers function pointer type.
Definition platform/gl/Context.h:105
void(*)(GLuint, GLsizei, const GLchar **, const GLint *) glShaderSourceFunction
Definition of the glShaderSource function pointer type.
Definition platform/gl/Context.h:170
void(*)(GLint, GLsizei, GLboolean, const GLfloat *) glUniformMatrix3fvFunction
Definition of the glUniformMatrix3fv function pointer type.
Definition platform/gl/Context.h:230
void(*)(GLenum) glGenerateMipmapFunction
Definition of the glGenerateMipmap function pointer type.
Definition platform/gl/Context.h:260
void(*)(GLuint, GLsizei, GLsizei *, GLchar *) glGetShaderInfoLogFunction
Definition of the glGetShaderInfoLog function pointer type.
Definition platform/gl/Context.h:190
std::set< std::string > StringSet
Definition of a set holding strings.
Definition platform/gl/Context.h:35
void(*)(GLenum, GLsizeiptr, const GLvoid *, GLenum) glBufferDataFunction
Definition of the glBufferData function pointer type.
Definition platform/gl/Context.h:115
void(*)(GLsizei, GLuint *) glGenFramebuffersFunction
Definition of the glGenFramebuffers function pointer type.
Definition platform/gl/Context.h:45
unsigned int minorVersion_
The minor version of this OpenGL context.
Definition platform/gl/Context.h:570
virtual bool isValid() const
Returns whether this context is valid.
GLuint(*)() glCreateProgramFunction
Definition of the glCreateProgram function pointer type.
Definition platform/gl/Context.h:120
void(*)(GLuint) glBindVertexArrayFunction
Definition of the glBindVertexArray function pointer type.
Definition platform/gl/Context.h:295
void(*)(GLsizei, GLuint *) glGenBuffersFunction
Definition of the glGenBuffers function pointer type.
Definition platform/gl/Context.h:100
void(*)(GLenum, GLenum, GLenum, GLenum) glBlendFuncSeparateFunction
Definition of the glBlendFuncSeparate function pointer type.
Definition platform/gl/Context.h:265
void(*)(GLenum, GLenum, GLsizei, GLsizei) glRenderbufferStorageFunction
Definition of the glRenderbufferStorage function pointer type.
Definition platform/gl/Context.h:75
unsigned int multisamples() const
Returns the number of multi samples that this context supports.
Definition platform/gl/Context.h:612
unsigned int minorVersion() const
Returns the minor OpenGL version of this context.
Definition platform/gl/Context.h:592
void(*)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) glBlitFramebufferFunction
Definition of the glBlitFramebuffer function pointer type.
Definition platform/gl/Context.h:90
void(*)(GLint, GLsizei, const GLfloat *) glUniform2fvFunction
Definition of the glUniform2fv function pointer type.
Definition platform/gl/Context.h:215
void(*)(GLuint, GLenum, GLint *) glGetProgramivFunction
Definition of the glGetProgramiv function pointer type.
Definition platform/gl/Context.h:175
void(*)(GLenum, GLenum, GLenum, GLuint, GLint) glFramebufferTexture2DFunction
Definition of the glFramebufferTexture2D function pointer type.
Definition platform/gl/Context.h:275
void(*)(GLenum, GLenum, GLenum, GLuint) glFramebufferRenderbufferFunction
Definition of the glFramebufferRenderbuffer function pointer type.
Definition platform/gl/Context.h:85
void(*)(GLuint) glUseProgramFunction
Definition of the glUseProgram function pointer type.
Definition platform/gl/Context.h:150
void(*)(GLenum, GLuint) glBindFramebufferFunction
Definition of the glBindFramebuffer function pointer type.
Definition platform/gl/Context.h:55
void(*)(GLint, GLint) glUniform1iFunction
Definition of the glUniform1i function pointer type.
Definition platform/gl/Context.h:205
const StringSet & supportedExtensions() const
Returns the set of supported extensions.
Definition platform/gl/Context.h:602
unsigned int majorVersion() const
Returns the major OpenGL version of this context.
Definition platform/gl/Context.h:587
void(*)(GLint, GLsizei, const GLfloat *) glUniform1fvFunction
Definition of the glUniform1fv function pointer type.
Definition platform/gl/Context.h:210
void(*)(GLsizei, const GLuint *) glDeleteFramebuffersFunction
Definition of the glDeleteFramebuffers function pointer type.
Definition platform/gl/Context.h:50
void(*)(GLsizei, const GLuint *) glDeleteVertexArraysFunction
Definition of the glDeleteVertexArrays function pointer type.
Definition platform/gl/Context.h:290
virtual void release()
Releases the context explicitly.
GLuint(*)(GLenum) glCreateShaderFunction
Definition of the glCreateShader function pointer type.
Definition platform/gl/Context.h:155
void(*)(GLuint) glEnableVertexAttribArrayFunction
Definition of the glEnableVertexAttribArray function pointer type.
Definition platform/gl/Context.h:240
void(*)(GLsizei, GLuint *) glGenRenderbuffersFunction
Definition of the glGenRenderbuffers function pointer type.
Definition platform/gl/Context.h:60
const GLubyte *(*)(GLenum, GLuint) glGetStringiFunction
Definition of the glGetStringi function pointer type.
Definition platform/gl/Context.h:40
virtual void makeCurrent(const bool state=true)=0
Makes the OpenGL rendering context of this framebuffer the calling thread's current rendering context...
bool compatibilityProfile_
True, if this context provides the compatibility profile.
Definition platform/gl/Context.h:573
void(*)(GLuint) glDisableVertexAttribArrayFunction
Definition of the glDisableVertexAttribArray function pointer type.
Definition platform/gl/Context.h:245
void(*)(GLuint) glDeleteProgramFunction
Definition of the glDeleteProgram function pointer type.
Definition platform/gl/Context.h:125
void(*)(GLenum, GLuint) glBindRenderbufferFunction
Definition of the glBindRenderbuffer function pointer type.
Definition platform/gl/Context.h:70
void(*)(GLuint, GLuint, const char *) glBindFragDataLocationFunction
Definition of the glBindFragDataLocation function pointer type.
Definition platform/gl/Context.h:280
void(*)(GLint, GLsizei, const GLfloat *) glUniform3fvFunction
Definition of the glUniform3fv function pointer type.
Definition platform/gl/Context.h:220
bool compatibilityProfile() const
Returns whether this context provides the compatibility profile or the core profile.
Definition platform/gl/Context.h:597
void(*)(GLint, GLsizei, const GLfloat *) glUniform4fvFunction
Definition of the glUniform4fv function pointer type.
Definition platform/gl/Context.h:225
void(*)(GLuint, GLenum, GLint *) glGetShaderivFunction
Definition of the glGetShaderiv function pointer type.
Definition platform/gl/Context.h:180
void(*)(GLuint, GLuint) glDetachShaderFunction
Definition of the glDetachShader function pointer type.
Definition platform/gl/Context.h:140
GLenum(*)(GLenum) glCheckFramebufferStatusFunction
Definition of the glCheckFramebufferStatus function pointer type.
Definition platform/gl/Context.h:95
StringSet extensions_
The set of supported extensions.
Definition platform/gl/Context.h:576
Thread::ThreadId threadId_
Definition platform/gl/Context.h:583
unsigned int majorVersion_
The major version of this OpenGL context.
Definition platform/gl/Context.h:567
void(*)(GLuint, GLsizei, GLsizei *, GLchar *) glGetProgramInfoLogFunction
Definition of the glGetProgramInfoLog function pointer type.
Definition platform/gl/Context.h:185
static HGLRC windowsCreateOpenGLContextHandle(HDC dc, const bool initializeOpenGL33, unsigned int &multisamples)
Creates a the OpennGL context handle on Windows platforms.
virtual bool releaseOpenGLContext()
Releases the OpenGL context of this framebuffer.
void(*)(GLint, GLsizei, GLboolean, const GLfloat *) glUniformMatrix4fvFunction
Definition of the glUniformMatrix4fv function pointer type.
Definition platform/gl/Context.h:235
unsigned int multisamples_
The number of multi samples of this context.
Definition platform/gl/Context.h:579
void(*)(GLuint) glCompileShaderFunction
Definition of the glCompileShader function pointer type.
Definition platform/gl/Context.h:165
virtual bool swapBuffers()
Swaps the foreground and background buffer if this context has two buffers.
void(*)(GLuint) glDeleteShaderFunction
Definition of the glDeleteShader function pointer type.
Definition platform/gl/Context.h:160
void(*)(GLenum, GLuint) glBindBufferFunction
Definition of the glBindBuffer function pointer type.
Definition platform/gl/Context.h:110
HGLRC(*)(HDC, HGLRC, const int *) wglCreateContextAttribsARBFunction
Definition platform/gl/Context.h:299
GLint(*)(GLuint, const GLchar *) glGetAttribLocationFunction
Definition of the glGetAttribLocation function pointer type.
Definition platform/gl/Context.h:195
Context()=default
Creates a new context.
void(*)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *) glVertexAttribPointerFunction
Definition of the glVertexAttribPointer function pointer type.
Definition platform/gl/Context.h:250
GLboolean(*)(GLuint) glIsProgramFunction
Definition of the glIsProgram function pointer type.
Definition platform/gl/Context.h:130
This class implements a platform independent wrapper for thread ids.
Definition Thread.h:122
The namespace covering the entire Ocean framework.
Definition Accessor.h:15