Jump to content
  • Advertisement
Sign in to follow this  

Graphics class hierarchy design

This topic is 2112 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



I am making a renderer and I have set some goals that i want to acheive because i find them ideal to get a clean design. But I have been thinking and trying to make them happen but I can't find a way. So I am turning to you all for some help and ideas.


- First I want to separate common, reusable code from platform specific code and I want to make it impossible for other than the responsible project to be able to include platform specific header like, opengl.h, d3d.h, ....

- Second I want to separate the "graphics object" ( like vertex buffer, mesh, device, texture) and the renderer algorithm ( deffered renderer, forward + renderer)


So those goal gave me 4 projects. Lets call them DefferedEngine, OglDefferedEngine, Graphics  and OglGrpahics. Those are actually 4 static lib that link in a GraphicsSystem dll. 


- Third the platform is known at compile time so I don't want virtual function. ( This is what caused most of my problems)



I tried the static polymorphism with CRTP but it is a nightmare... Everything that use the type trough the base class need to be templated. Imagine the device class each create function ( create vertex buffer, create index buffer, create texture) are actually templated with different return type.


I am pretty sure someone have to have done this before. how did you do it?


thanks alot



Share this post

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

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!