Jump to content
  • Advertisement
  • entries
  • comments
  • views

Direct3D wrappers

Sign in to follow this  


Just been working on the nice thin Direct3D wrapper for the actual proper version of the new project.

I decided this time that since I only ever have one graphics device, there is no real point in having a GraphicsDevice class other than a similar warm fuzzy singleton-esque feeling, so instead the device is just wrapped by functions in a namespace.

I've also been looking into DrawPrimitiveUP over proper vertex buffers. According to this, it would appear that for relatively small batches of vertices, there is no significant advantage of using a vertex buffer over DrawPrimitiveUP() with a std::vector.

There are clear advantages to just using a std::vector - no more worrying about maximum buffer sizes (within reason), one less class wrapper to write and one less Direct3D resource for either me or Direct3D to manage in the event of device loss.

I note there is also a DrawIndexedPrimitiveUP(), although I'm doubtful that for batches of the kind of size that a mainly textured quad based project will use would reap any significant benefit from using this. Nice to have it in mind for a potential future optimisation if the need arises.

As I suspected when I started on Direc3D a year or so ago, rewritting the Direct3D wrapping code each time I've started a new project has gradually made me more and more comfortable with Direct3D directly, without me really noticing me learning.

The original point of learning Direct3D for 2D games was to get comfortable enough with the basic principles to make the move to 3D more feasible - I think I'm pretty much there now, so hopefully after this current project is either finished or dies, I can start to think seriously about a 3D game.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 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!