| 103 | } |
| 104 | |
| 105 | void GLES2StateCacheManager::bindGLBuffer(GLenum target, GLuint buffer) |
| 106 | { |
| 107 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 108 | auto ret = mActiveBufferMap.emplace(target, buffer); |
| 109 | if(ret.first->second != buffer) // Update the cached value if needed |
| 110 | { |
| 111 | ret.first->second = buffer; |
| 112 | ret.second = true; |
| 113 | } |
| 114 | |
| 115 | // Update GL |
| 116 | if(ret.second) |
| 117 | #endif |
| 118 | { |
| 119 | if(target == GL_FRAMEBUFFER) |
| 120 | { |
| 121 | OgreAssert(false, "not implemented"); |
| 122 | } |
| 123 | else if(target == GL_RENDERBUFFER) |
| 124 | { |
| 125 | OGRE_CHECK_GL_ERROR(glBindRenderbuffer(target, buffer)); |
| 126 | } |
| 127 | else |
| 128 | { |
| 129 | OGRE_CHECK_GL_ERROR(glBindBuffer(target, buffer)); |
| 130 | } |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | void GLES2StateCacheManager::deleteGLBuffer(GLenum target, GLuint buffer) |
| 135 | { |
no outgoing calls
no test coverage detected