MCPcopy Create free account
hub / github.com/davideberly/GeometricTools / Bind

Method Bind

GTE/Graphics/GL46/GL46InputLayoutManager.cpp:20–45  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20GL46InputLayout* GL46InputLayoutManager::Bind(GLuint programHandle,
21 GLuint vbufferHandle, VertexBuffer const* vbuffer)
22{
23 LogAssert(programHandle != 0, "Invalid input.");
24
25 if (vbuffer)
26 {
27 mMutex.lock();
28 VBPPair vbp(vbuffer, programHandle);
29 auto iter = mMap.find(vbp);
30 if (iter == mMap.end())
31 {
32 auto layout = std::make_shared<GL46InputLayout>(programHandle, vbufferHandle, vbuffer);
33 iter = mMap.insert(std::make_pair(vbp, layout)).first;
34 }
35 GL46InputLayout* inputLayout = iter->second.get();
36 mMutex.unlock();
37 return inputLayout;
38 }
39 else
40 {
41 // A null vertex buffer is passed when an effect wants to bypass the
42 // input assembler.
43 return nullptr;
44 }
45}
46
47bool GL46InputLayoutManager::Unbind(VertexBuffer const* vbuffer)
48{

Callers 1

DrawPrimitiveMethod · 0.45

Calls 1

endMethod · 0.80

Tested by

no test coverage detected