Jump to content
  • Advertisement
Sign in to follow this  
janisoft27

Game API Question II

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

Hello all To the guys who responsed to the my orginal post Game Api thanks alot. I had a follow up question. this maybe a more of an implementation question but any ideas would be greatly appreciated. I do not have a "render" class. Things ie models,sprites and textures are responsible for there own rendering. individual calls are made inside of main or a state, if the application is implemented as a state machine. So my question is should i abstract a class such as CTexture to make an abstract class CTexture and child classes cDirectXtexture and cOpengl texture. Then make apps to take a command line param or a config param that tells it what api to use and then use that child class to handle it. Does this make sense or i am i completely off base with my implemenation and idea

Share this post


Link to post
Share on other sites
Advertisement
Presentation and simulation are different functions.

An "object" really is mostly about the game data (i e, simulation) -- the presentation part should not be coupled, because that will lead to all kinds of hard-to-maintain code.

Typically, you'll build a scene presentation layer, where the object just expresses its wishes; say by saying "please render this <abstract geometry handle> using this <abstract material description> transformed using <position, orientation, and animation data>". The presentation layer then just adds a record of this request, and when time comes to actually draw, it issues the geometry to the graphics card. That way, you can easily multi-pass the scene, for example for shadowing, or for RTT effects.

The presentation layer also needs ways for objects to obtain <abstract geometry handle> and <abstract material handle>, of course. (These pieces are typically called "model loaders" :-)

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!