July 2017
Beginner to intermediate
390 pages
10h 53m
English
We now have our shaders loaded into memory. The next step is to tell the system how to interpret the data and how to deal with the vertices. In other words, we need to tell the Input Assembler stage in the pipeline how to assemble the input.
Add the following code to the initialization routine:
InputElement[] vertexDesc = { new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0, InputClassification.PerVertexData, 0), new InputElement("COLOR", 0, Format.R32G32B32_Float, 12, 0, InputClassification.PerVertexData, 0) }; _inputLayout = ToDispose(new InputLayout(_deviceResources.D3DDevice, vertexShaderByteCode, vertexDesc));
Add the _inputLayout field to our class:
private InputLayout _inputLayout;
The input layout ...
Read now
Unlock full access