diff options
Diffstat (limited to 'src/libjin/graphics/je_gl.cpp')
-rw-r--r-- | src/libjin/graphics/je_gl.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/libjin/graphics/je_gl.cpp b/src/libjin/graphics/je_gl.cpp index 68678e2..745bbb2 100644 --- a/src/libjin/graphics/je_gl.cpp +++ b/src/libjin/graphics/je_gl.cpp @@ -37,6 +37,21 @@ namespace JinEngine glColor4ub(r, g, b, a); } + void OpenGL::enable(GLenum cap) + { + glEnable(cap); + } + + void OpenGL::disable(GLenum cap) + { + glDisable(cap); + } + + void OpenGL::setClearColor(GLubyte r, GLubyte g, GLubyte b, GLubyte a) + { + glClearColor(r / 255.f, g / 255.f, b / 255.f, a / 255.f); + } + void OpenGL::popColor() { memcpy(&mColor, &mPrecolor, sizeof(mPrecolor)); @@ -60,6 +75,11 @@ namespace JinEngine glBindTexture(GL_TEXTURE_2D, texture); } + GLuint OpenGL::curTexture() + { + return mTexture; + } + void OpenGL::deleteTexture(GLuint texture) { glDeleteTextures(1, &texture); @@ -86,6 +106,54 @@ namespace JinEngine glActiveTexture(GL_TEXTURE0 + unit); } + + void OpenGL::drawArrays(GLenum mode, GLint first, GLsizei count) + { + glDrawArrays(mode, first, count); + } + + void OpenGL::drawBuffer(GLenum mode) + { + + } + + void OpenGL::drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) + { + + } + + void OpenGL::enableClientState(GLenum arr) + { + glEnableClientState(arr); + } + + void OpenGL::disableClientState(GLenum arr) + { + glDisableClientState(arr); + } + + GLuint OpenGL::genFrameBuffer() + { + GLuint fbo; + glGenFramebuffers(1, &fbo); + return fbo; + } + + void OpenGL::bindFrameBuffer(GLuint fbo) + { + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + } + + void OpenGL::ortho(int w, float radio) + { + glOrtho(0, w, w*radio, 0, -1, 1); + } + + void OpenGL::orthox(int w, int h) + { + glOrtho(0, w, h, 0, -1, 1); + } + void OpenGL::setColor(Channel r, Channel g, Channel b, Channel a) { setColor(Color(r, g, b, a)); |