I have a fully procedural simple directX program which I would like to turn into proper oop design with structs and classess. I am a bit at a loss as what should go where in the setting up of this though.
Right now my program first initializes a window -> this can stay the same in the new code.
It then initalizes Direct3D. Where is the right place to stop this? at D3D11CreateDeviceAndSwapChain? My code goes up until OMSetRenderTargets.
It then initiates the 'scene' which is essentially the viewport.
It then initiates the objects which are just a bunch of predefined vertices making simple shapes.
Then finally Render() is called in a loop which draws my shapes after their translations and / or rotations have been calculated.
Now how would I go about turning this simple program into objects? I am confident I can make a program which will create a graphics 'object' and then initialize the directX window but I am at a loss as to how to store and call up the geometry.
Would something like a class 'geometry' that stores all the vertex buffers work? I would then like to chose what to draw with a command like square.draw(). The problem is I just can't visualize how this is done from my procedural program where the vertex descriptions and directx stuff is all together.
Edited by SteveHatcher, 19 December 2013 - 03:57 AM.