| 148 | } |
| 149 | |
| 150 | void GLStateCacheManager::bindGLBuffer(GLenum target, GLuint buffer) |
| 151 | { |
| 152 | #ifdef OGRE_ENABLE_STATE_CACHE |
| 153 | auto ret = mActiveBufferMap.emplace(target, buffer); |
| 154 | if(ret.first->second != buffer) // Update the cached value if needed |
| 155 | { |
| 156 | ret.first->second = buffer; |
| 157 | ret.second = true; |
| 158 | } |
| 159 | |
| 160 | // Update GL |
| 161 | if(ret.second) |
| 162 | #endif |
| 163 | { |
| 164 | if(target == GL_FRAMEBUFFER) |
| 165 | { |
| 166 | OgreAssert(false, "not implemented"); |
| 167 | } |
| 168 | else if(target == GL_RENDERBUFFER) |
| 169 | { |
| 170 | glBindRenderbufferEXT(target, buffer); |
| 171 | } |
| 172 | else |
| 173 | { |
| 174 | glBindBuffer(target, buffer); |
| 175 | } |
| 176 | } |
| 177 | |
| 178 | } |
| 179 | |
| 180 | void GLStateCacheManager::deleteGLBuffer(GLenum target, GLuint buffer) |
| 181 | { |
no outgoing calls
no test coverage detected