MCPcopy Create free account
hub / github.com/OGRECave/ogre / bind

Method bind

RenderSystems/GLSupport/src/OgreGLVertexArrayObject.cpp:47–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 }
46
47 void GLVertexArrayObject::bind(GLRenderSystemCommon* rs)
48 {
49 if(mCreatorContext && mCreatorContext != rs->_getCurrentContext()) // VAO is unusable with current context, destroy it
50 {
51 if(mVAO != 0)
52 rs->_destroyVao(mCreatorContext, mVAO);
53 mCreatorContext = 0;
54 mVAO = 0;
55 mNeedsUpdate = true;
56 }
57 if(!mCreatorContext && rs->getCapabilities()->hasCapability(RSC_VAO)) // create VAO lazy or recreate after destruction
58 {
59 mCreatorContext = rs->_getCurrentContext();
60 mVAO = rs->_createVao();
61 mNeedsUpdate = true;
62 }
63 rs->_bindVao(mCreatorContext, mVAO);
64 }
65
66 bool GLVertexArrayObject::needsUpdate(VertexBufferBinding* vertexBufferBinding,
67 size_t vertexStart)

Callers

nothing calls this directly

Calls 3

_destroyVaoMethod · 0.45
_createVaoMethod · 0.45
_bindVaoMethod · 0.45

Tested by

no test coverage detected