Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Graphics class hierarchy design


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 monamimani   Members   -  Reputation: 134

Like
0Likes
Like

Posted 02 October 2013 - 07:12 PM

Hi,

 

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

 

Emmanuel



Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS