![]() |
Gorgon Game Engine
|
This namespace contains underlying graphics library functions. More...
Namespaces | |
TextureUnit | |
UBOBindingPoint | |
Classes | |
class | FrameBuffer |
This is a frame buffer object that can be used for render to texture tasks. More... | |
class | QuadTextureCoords |
class | QuadVertices |
class | Shader |
Functions | |
void | Clear () |
Clears the window pointed by the active context. More... | |
void | CopyToTexture (Texture texture, const Containers::Image &data, Geometry::Bounds source, Geometry::Point target) |
Copies the data from the given image to the texture starting from specified boundary of the given target. More... | |
void | CopyToTexture (Texture texture, const Containers::Image &data, Geometry::Point target) |
Copies the data from the given image to the texture starting from the given target. More... | |
GLuint | CreateShader (GLenum type, const std::string &code, const std::string &name) |
void | debug_proc (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const void *) |
void | DestroyTexture (Texture texture) |
Destroys the given texture. More... | |
Texture | GenerateEmptyTexture (const Geometry::Size &size, Graphics::ColorMode mode) |
This function generates a texture from the given image data. More... | |
Texture | GenerateTexture (const Containers::Image &data) |
This function generates a texture from the given image data. More... | |
GLenum | getGLColorMode (Graphics::ColorMode mode) |
void | InsertDefines (std::string &code, const std::string &shader_defines) |
void | LoadFunctions () |
QuadVertices | operator* (const Geometry::Transform3D &transform, const QuadVertices &quad) |
void | RenderToScreen () |
Stops rendering to a texture and start rendering to a buffer. More... | |
void | RenderToTexture (FrameBuffer &buffer) |
Begins using the given frame buffer. More... | |
void | Resize (const Geometry::Size &size) |
Resizes the active context. More... | |
void | ResizeTexture (Texture texture, const Geometry::Size &size, Graphics::ColorMode mode) |
Resizes the given texture to the specified size. More... | |
void | SetDefaultBlending () |
Sets default blending parameters as current. More... | |
void | SetDefaultClear () |
Sets default clear parameters as current. More... | |
void | settexturedata (Texture tex, const Containers::Image &data) |
void | SetupContext (const Geometry::Size &size) |
Performs first time initialization on GL context. More... | |
unsigned int | SetupUBO (int size, int binding_point) |
void | UpdateTexture (Texture texture, const Containers::Image &data) |
Updates the given texture to contain the given data. More... | |
void | UpdateUBO (unsigned int ubo, int size, void const *const data) |
Variables | |
GLuint | activeprogram |
Gorgon::Utils::Logger | log |
The logger that is used for GL operations. Default is unset and will not log anything. Use Initialize... to begin logging. More... | |
This namespace contains underlying graphics library functions.
These functions are presented in a OS/Window manager generic way. However, direct access to GL functions might be necessary in many cases. In those cases you may include GL/OpenGL.h library header. This header might expose operating system dependent headers. In the future there might be more supported GL libraries. In that case, you should choose to include the library you wish to use.
void Clear | ( | ) |
Clears the window pointed by the active context.
void CopyToTexture | ( | Texture | texture, |
const Containers::Image & | data, | ||
Geometry::Bounds | source, | ||
Geometry::Point | target | ||
) |
Copies the data from the given image to the texture starting from specified boundary of the given target.
References getGLColorMode(), basic_Image< T_ >::GetMode(), basic_Image< T_ >::GetWidth(), basic_Bounds< T_ >::Height(), basic_Bounds< T_ >::Left, basic_Image< T_ >::RawData(), basic_Bounds< T_ >::Top, basic_Bounds< T_ >::Width(), basic_Point< T_ >::X, and basic_Point< T_ >::Y.
void CopyToTexture | ( | Texture | texture, |
const Containers::Image & | data, | ||
Geometry::Point | target | ||
) |
Copies the data from the given image to the texture starting from the given target.
References getGLColorMode(), basic_Image< T_ >::GetHeight(), basic_Image< T_ >::GetMode(), basic_Image< T_ >::GetWidth(), basic_Image< T_ >::RawData(), basic_Point< T_ >::X, and basic_Point< T_ >::Y.
GLuint Gorgon::GL::CreateShader | ( | GLenum | type, |
const std::string & | code, | ||
const std::string & | name | ||
) |
void Gorgon::GL::debug_proc | ( | GLenum | source, |
GLenum | type, | ||
GLuint | id, | ||
GLenum | severity, | ||
GLsizei | length, | ||
const GLchar * | message, | ||
const void * | |||
) |
void DestroyTexture | ( | Texture | texture | ) |
Destroys the given texture.
Texture GenerateEmptyTexture | ( | const Geometry::Size & | size, |
Graphics::ColorMode | mode | ||
) |
This function generates a texture from the given image data.
References getGLColorMode(), basic_Size< T_ >::Height, and basic_Size< T_ >::Width.
Texture GenerateTexture | ( | const Containers::Image & | data | ) |
This function generates a texture from the given image data.
References settexturedata().
GLenum Gorgon::GL::getGLColorMode | ( | Graphics::ColorMode | mode | ) |
void Gorgon::GL::InsertDefines | ( | std::string & | code, |
const std::string & | shader_defines | ||
) |
void Gorgon::GL::LoadFunctions | ( | ) |
References glActiveTexture, glAttachShader, glBindAttribLocation, glBindBuffer, glBindBufferBase, glBindFramebuffer, glBindRenderbuffer, glBindVertexArray, glBlendFuncSeparate, glBufferData, glBufferSubData, glCheckFramebufferStatus, glCompileShader, glCreateProgram, glCreateShader, glDebugMessageCallback, glDeleteBuffers, glDeleteFramebuffers, glDeleteProgram, glDeleteRenderbuffers, glDeleteShader, glDeleteVertexArrays, glDetachShader, glDrawBuffers, glEnableVertexAttribArray, glFramebufferRenderbuffer, glFramebufferTexture2D, glGenBuffers, glGenerateMipmap, glGenFramebuffers, glGenRenderbuffers, glGenVertexArrays, glGetAttribLocation, glGetProgramInfoLog, glGetProgramiv, glGetShaderInfoLog, glGetShaderiv, glGetUniformBlockIndex, glGetUniformLocation, glLinkProgram, glMapBuffer, glMapBufferRange, glRenderbufferStorage, glShaderSource, glUniform1f, glUniform1i, glUniform2fv, glUniform3fv, glUniform4fv, glUniformBlockBinding, glUniformMatrix3fv, glUniformMatrix3x2fv, glUniformMatrix4fv, glUniformMatrix4x2fv, glUniformMatrix4x3fv, glUnmapBuffer, glUseProgram, glVertexAttribIPointer, glVertexAttribPointer, and FrameBuffer::HardwareSupport.
QuadVertices Gorgon::GL::operator* | ( | const Geometry::Transform3D & | transform, |
const QuadVertices & | quad | ||
) |
void RenderToScreen | ( | ) |
Stops rendering to a texture and start rendering to a buffer.
References glBindFramebuffer.
void RenderToTexture | ( | FrameBuffer & | buffer | ) |
Begins using the given frame buffer.
References FrameBuffer::Use().
void Resize | ( | const Geometry::Size & | size | ) |
Resizes the active context.
References basic_Size< T_ >::Height, and basic_Size< T_ >::Width.
void ResizeTexture | ( | Texture | texture, |
const Geometry::Size & | size, | ||
Graphics::ColorMode | mode | ||
) |
Resizes the given texture to the specified size.
The data in the texture cannot be trusted after this call.
References getGLColorMode(), basic_Size< T_ >::Height, and basic_Size< T_ >::Width.
void SetDefaultBlending | ( | ) |
Sets default blending parameters as current.
References glBlendFuncSeparate.
void SetDefaultClear | ( | ) |
Sets default clear parameters as current.
void Gorgon::GL::settexturedata | ( | Texture | tex, |
const Containers::Image & | data | ||
) |
void SetupContext | ( | const Geometry::Size & | size | ) |
Performs first time initialization on GL context.
References Clear(), debug_proc(), Gorgon::OS::DisplayMessage(), GL_DEBUG_OUTPUT, glDebugMessageCallback, Resize(), SetDefaultBlending(), and SetDefaultClear().
unsigned int SetupUBO | ( | int | size, |
int | binding_point | ||
) |
References glBindBuffer, glBindBufferBase, glBufferData, and glGenBuffers.
void UpdateTexture | ( | Texture | texture, |
const Containers::Image & | data | ||
) |
Updates the given texture to contain the given data.
References settexturedata().
void UpdateUBO | ( | unsigned int | ubo, |
int | size, | ||
void const *const | data | ||
) |
References glBindBuffer, and glBufferSubData.
GLuint activeprogram |
The logger that is used for GL operations. Default is unset and will not log anything. Use Initialize... to begin logging.