| 204 | } |
| 205 | |
| 206 | void font_impl::bindResources(int pWindowId) |
| 207 | { |
| 208 | if (mVAOMap.find(pWindowId) == mVAOMap.end()) { |
| 209 | size_t sz = 2*sizeof(float); |
| 210 | GLuint vao; |
| 211 | glGenVertexArrays(1, &vao); |
| 212 | glBindVertexArray(vao); |
| 213 | glEnableVertexAttribArray(0); |
| 214 | glEnableVertexAttribArray(1); |
| 215 | glBindBuffer(GL_ARRAY_BUFFER, mVBO); |
| 216 | glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, gl::GLsizei(2*sz), 0); |
| 217 | glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, gl::GLsizei(2*sz), reinterpret_cast<void*>(sz)); |
| 218 | /* store the vertex array object corresponding to |
| 219 | * the window instance in the map */ |
| 220 | mVAOMap[pWindowId] = vao; |
| 221 | } |
| 222 | glBindVertexArray(mVAOMap[pWindowId]); |
| 223 | } |
| 224 | |
| 225 | void font_impl::unbindResources() const |
| 226 | { |
nothing calls this directly
no outgoing calls
no test coverage detected