Advertisement Jump to content
Sign in to follow this  

2d problem

This topic is 4999 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 try to draw some 2D, I read the FAQ but I dont want to draw upside down=/ If I do: scalef(1,-1, 1); or glOrtho(0, vport[2],vport[3],0,-1,1) I loose one line at the top of my projection. Can i somehow fix this? If I translate it seems that DrawPixels/recti also is affected. So Ive no idea of to fix this strange problem, any ideas? thanks in advance

Share this post

Link to post
Share on other sites
I am confused on what you are asking? Do you mean you don't want the window coordinates in x,y to be reversed? If so just take the screen height - current Y position = new y

Share this post

Link to post
Share on other sites
I mean that I want them in "real" screen coordinates.
But its strange things happening.
for example DrawPixels/recti is postioned correct.
all vertices Ive tested is wrong except for QUADS they are drawn correct.
But lines aren't.

When I say wrong I mean that for QUADS y = 0 is drawn at line 0
But Lines that has a y = 0 is drawn at line -1

Ive set up my ortho like this:
glOrtho(0, screenWidth, screenHeight, 0, -1, 1);

I tried:
glOrtho(0, screenWidth, screenHeight, -1, -1, 1);
and in that case Lines are drawn correct.
But not QUADS and the DrawPixels.

I dont understand whats happening!
plz some info would be really nice!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!