MCPcopy Create free account
hub / github.com/LukasBanana/LLGL / CreateBuffers

Method CreateBuffers

examples/Cpp/Animation/Example.cpp:99–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97private:
98
99 LLGL::VertexFormat CreateBuffers()
100 {
101 // Specify vertex format
102 LLGL::VertexFormat vertexFormat;
103 vertexFormat.AppendAttribute({ "position", LLGL::Format::RGB32Float });
104 vertexFormat.AppendAttribute({ "normal", LLGL::Format::RGB32Float });
105 vertexFormat.AppendAttribute({ "texCoord", LLGL::Format::RG32Float });
106 vertexFormat.SetStride(sizeof(TexturedVertex));
107
108 // Load 3D models
109 std::vector<TexturedVertex> vertices;
110 meshStairsTop = LoadObjModel(vertices, "PenroseStairs-Top.obj");
111 meshStairsBottom = LoadObjModel(vertices, "PenroseStairs-Bottom.obj");
112 meshBall = LoadObjModel(vertices, "IcoSphere.obj");
113
114 meshStairsTop.color = { 1.0f, 1.0f, 1.0f, 1.0f };
115 meshStairsBottom.color = { 1.0f, 1.0f, 0.0f, 0.0f };
116
117 // Create vertex, index, and constant buffer
118 vertexBuffer = CreateVertexBuffer(vertices, vertexFormat);
119 constantBuffer = CreateConstantBuffer(settings);
120
121 return vertexFormat;
122 }
123
124 void CreateTextures()
125 {

Callers

nothing calls this directly

Calls 3

LoadObjModelFunction · 0.85
AppendAttributeMethod · 0.80
SetStrideMethod · 0.45

Tested by

no test coverage detected