MCPcopy Create free account
hub / github.com/RavEngine/RavEngine / CreateBuffers

Method CreateBuffers

deps/LLGL/examples/Cpp/PBR/Example.cpp:89–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87private:
88
89 LLGL::VertexFormat CreateBuffers()
90 {
91 // Specify vertex format
92 LLGL::VertexFormat vertexFormat;
93 vertexFormat.AppendAttribute({ "position", LLGL::Format::RGB32Float });
94 vertexFormat.AppendAttribute({ "normal", LLGL::Format::RGB32Float });
95 vertexFormat.AppendAttribute({ "tangent", LLGL::Format::RGB32Float });
96 vertexFormat.AppendAttribute({ "bitangent", LLGL::Format::RGB32Float });
97 vertexFormat.AppendAttribute({ "texCoord", LLGL::Format::RG32Float });
98
99 // Load 3D models
100 std::vector<TexturedVertex> vertices;
101 meshes.push_back(LoadObjModel(vertices, "../../Media/Models/UVSphere.obj"));
102 meshes.push_back(LoadObjModel(vertices, "../../Media/Models/WiredBox.obj"));
103
104 // Create vertex and constant buffer
105 vertexBuffer = CreateVertexBuffer(GenerateTangentSpaceVertices(vertices), vertexFormat);
106 constantBuffer = CreateConstantBuffer(settings);
107
108 return vertexFormat;
109 }
110
111 void LoadShaders(const LLGL::VertexFormat& vertexFormat)
112 {

Callers

nothing calls this directly

Calls 4

LoadObjModelFunction · 0.85
AppendAttributeMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected