Jump to content
  • Advertisement
Sign in to follow this  
  • entries
  • comments
  • views

Citizen: Graphics API isolation.

Sign in to follow this  
Staffan E


Citizen: Graphics API isolation.

Since last time I posted I've worked on the graphics system, trying to isolate as much API-specific code as possible. Before I began my GraphicsDevice class which is the graphics system motor was littered with DirectX9-specific code, and some of it even leaked out into the calling application. I'd like to keep my options open for multiple API support later on, like DX10 and/or OpenGL, so this really had to go.

My solution to this was to make GraphicsDevice into an interface (IGraphicsDevice) that exposes common graphics operations to the application. The interface is then implemented by D3D9Device which encapsulates all DX9-specific calls. This restructure wasn't entirely painless. I had to write some helper classes to port things like coordinates from DX9 to non-DX9, and I'm still in a process of adjusting which methods should be known by IGraphicsDevice and which should be internal to D3D9Device.

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!