Jump to content
  • Advertisement
Sign in to follow this  
nightcracker

Critical library design question

This topic is 2552 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'm designing and implementing a Python OpenGL toolkit with fast 2D sprite support, very much like pyglet (yet with a completely different approach, for example with a lot of code written in C for speed).

But I'm really in the dark about what coordinate system to use. AFAIK most 2D libraries and software uses a top-left origin (with y increasing meaning going DOWN) while OpenGL uses a bottom-left origin by default. Also, AFAIK there are no performance arguments against either solution, since the conversion is trivial.

So what is the best origin for a 2D graphics library, bottom-left or top-left?

Share this post


Link to post
Share on other sites
Advertisement
It is an arbitrary convention. You might as well toss a coin.

I prefer +Y meaning UP, because it matches with standard mathematics. Then again, I like to use the centre of the screen as my origin, which I find convenient for doing small test programs (you need to do almost no work to get stuff drawn in the middle of the screen).

Share this post


Link to post
Share on other sites
You said it yourself, this is entirely subjective and neither is really better than the other. Just pick one and go with it.

If you're planning on having users who are already familiar with similar libraries it may be to your benefit to do the same as they do, although any half-decent programmer will have no trouble either way.

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!