Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

CnCMasta

function naming...

This topic is 5667 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 folkz! i need a little help in naming my function... 1. the function disables and enables a state, how would you name it? (i.e. setDepthState()). 2. the function switches between 3D-Perspective and 2D-Ortho mode, the function should be named like "setXXX" how would you name it? mfg cNc

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
why are you createing new funcs that opengl already has????

Share this post


Link to post
Share on other sites
this function will be implemented in my engine-class, and, you don`t need to give the function a parameter, it works with static variables...i only don`t know how to name it ;(

mfg cNc

Share this post


Link to post
Share on other sites
For the first, I would make a generic function if possible (e.g. SetGraphicsState) that handles all possible state changes. This is a pain to implement (I''ve tried), but I personally think it''s the cleanest. I use a special type of materials to manage most state changes now though.

For the latter, I used SetProjection in my last game. It seems pretty intuitive, since perspective and orthographic are two types of projection. However, you might want to consider further abstracting the matrix functions, creating accessors like SetMatrixMode and SetPerspective, since SetProjection could limit ultimate access to the matrix. Just a suggestion.

Later,
ZE.

//email me.//zealouselixir software.//msdn.//n00biez.//
miscellaneous links

Share this post


Link to post
Share on other sites

  • 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!