diff options
author | chai <chaifix@163.com> | 2018-11-25 11:28:59 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2018-11-25 11:28:59 +0800 |
commit | 25b394738f08bc2e7b23f8343096f8296b46c633 (patch) | |
tree | 886a81c260b7381e0355c077ef780d7e93200de1 /src/libjin/graphics/je_gl.cpp | |
parent | 89a7d8e2923776e59130b4d5c5e5f82ed425e828 (diff) |
*gl
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)); |