diff options
Diffstat (limited to 'source/modules/asura-core/graphics/gl.cpp')
-rw-r--r-- | source/modules/asura-core/graphics/gl.cpp | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/source/modules/asura-core/graphics/gl.cpp b/source/modules/asura-core/graphics/gl.cpp index 47476a7..54fadb7 100644 --- a/source/modules/asura-core/graphics/gl.cpp +++ b/source/modules/asura-core/graphics/gl.cpp @@ -30,13 +30,41 @@ namespace AsuraEngine { } + bool OpenGL::Init(const AEMath::Recti& view) + { + bool loaded = false; +#if ASURA_OPENGL_LOADER & ASURA_OPENGL_GLAD + if (!loaded) + loaded = gladLoadGL(); +#endif + if (!loaded) + return false; + state.viewport = view; + return true; + } + + void OpenGL::WipeError() + { + while (glGetError() != GL_NO_ERROR); + } + + bool OpenGL::HasError() + { + return glGetError() != GL_NO_ERROR; + } + + GLenum OpenGL::GetError() + { + return glGetError(); + } + void OpenGL::SetViewport(const Recti v) { glViewport(v.x, v.y, v.w, v.h); state.viewport = v; } - Recti OpenGL::GetViewport() + const Recti& OpenGL::GetViewport() { return state.viewport; } |