MCPcopy Create free account
hub / github.com/arrayfire/forge / bindResources

Method bindResources

src/backend/opengl/font_impl.cpp:206–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

204}
205
206void 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
225void font_impl::unbindResources() const
226{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected