Jump to content
  • Advertisement
Sign in to follow this  
Thaligar

abstraction or detail...

This topic is 4838 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, i thought now for couple of days if i should really make a renderer-interface class and derive my renderer from it, but, i'm not sure because if i implement the interface class i can 1.) try to catch every single detail from my api into the renderer (i'm using OGL, and if i do this i can stay at ogl without interface) or 2.) or make it so abstract that i can also easily implement a dx renderer but why (i mean at the moment i can't think of an dx implementation) should i lost all the details of ogl or completly copy the api interface and make a single interface class of it?? please post your opinion and help me with my decision, (well i think often, yeah it would be good to make it so abstract so i can easily change every module) thx in advance for your time (to think about it and to read this fat post) and also for your attandance and your help, greets tgar

Share this post


Link to post
Share on other sites
Advertisement
I think your abstraction is too fine grain, low-level if all you are going to do is wrap the API functions its going to be a pain. Abstract to a higher level like dealing with scene objects/entities. There will be instances of different types of objects/entities in a scene, a renderer would render those different types in different ways. A renderer could quite easily be an instance of the visitor pattern.

Share this post


Link to post
Share on other sites
Reduce the dependencies from the API (GL). Write your own (hyper simplified) renderer then it's more simple to reimplement it in two different 'flavours'.

In other words: it's impossible to keep each aspect of GL and DX in a unique virtual renderer unless you take the union of each set of functions (!!!).

The first tip is that I prefer! Try to create classes independent from the Graphic API (ie use your matrices, your viewport, your transform).

However in my experience a decent engine to do something is >90% API indepedent

Share this post


Link to post
Share on other sites
thanks for your replies,

so the renderer is only needed for let's say, render a model with given matrices and textures, prob. a spec. shader...

it seems to get a little bit clearer but i have to do some more research on that (and on the visitor pattern),

thanks for your time, and your opinions,
but be sure, i'll coming to ask again,
greets
tgar

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.

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!