Jump to content
  • Advertisement

Archived

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

samosa

pixel mesurement

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

a while ago i bought a 2d book on directX, i found all of the initialization very confusing and it seemed like i had no control over what my program did, so following a friends advice i went to opengl, i am now programming a 2d breakout clone with opengl, ive gone back to that book as a source for 2d programming theory and implementaion, anyway, in that book they measure where sprites are and movement in pixels, opengl uses floats( 1.0f etc) which is a faily large unit(in 2d) does anyone know how i can set where a player is on the screen using pixels? like (320, 271) would be approx in the middle of a 2d 640X480 screen, any help would be appreciated, and if its all pointless and better to use opengl''s floats, plz just let me know, thanks ,Matt -= kill one your a murderer, kill thousands your a conquerer =-

Share this post


Link to post
Share on other sites
Advertisement
well, why not ?.
you can use absolute positions in with ortho projection.
maybe i dont understand your question, but you can specify 300,200 on the screen if you want to .

Its my duty, to please that booty ! - John Shaft

Share this post


Link to post
Share on other sites
use something like gluOrtho2d(0,640,0,480) now 320,240 is the middle of the screen
(check the faq for the correct way)

http://uk.geocities.com/sloppyturds/gotterdammerung.html

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.

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!