buttons in opengl

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Post Reply
DuGaming
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 4
Joined: Sat Oct 16, 2010 8:01 am

buttons in opengl

Post by DuGaming »

How would you use sdl to get mouse input in opengl? To be more specific how do you convert event.motion.x to opengls coordinate system or vice versa?
User avatar
MrDeathNote
ES Beta Backer
ES Beta Backer
Posts: 594
Joined: Sun Oct 11, 2009 9:57 am
Current Project: cocos2d-x project
Favorite Gaming Platforms: SNES, Sega Megadrive, XBox 360
Programming Language of Choice: C/++
Location: Belfast, Ireland
Contact:

Re: buttons in opengl

Post by MrDeathNote »

SDL and OpenGL use the same x coords. OpenGL will let you define the coordinate system you use. But if you need to invert the y just take the screen height and subtract the y value of your mouse event.
http://www.youtube.com/user/MrDeathNote1988

Image
Image

"C makes it easy to shoot yourself in the foot. C++ makes it
harder, but when you do, it blows away your whole leg." - Bjarne Stroustrup
Post Reply