I completed a tutorial on rendering 2d triangles in directx. Now, I want to use my knowledge of rendering a single triangle to render multiple triangles, or for that matter multiple objects on screen.
Should I create a list/stack/vector of vertexbuffers and input layouts and then draw each object? Or is there a better approach to this?
My process would be:
- Setup directx, including vertex and pixel shaders
- Create vertex buffers for each shape that has to be drawn on the screen and store them in an array.
- Draw them to the render target for each frame(each frame)
- Present the render target(each frame)
Please assume very rudimentary knowledge of DirectX and graphics programming in general when answering.