Jump to content
  • Advertisement
Sign in to follow this  
SteveHatcher

Converting procedural directX program to objects...

This topic is 1702 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

 

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.

 

Thanks

Edited by SteveHatcher

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!