Jump to content
  • Advertisement
Sign in to follow this  
LordAsm

OpenGL How to draw a mouse cursor in OpenGL!?

This topic is 4816 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 sorry for the noobish question, but I'm a noob lol So down to business, I have a app that load a terrain in ortho view (isometric), and I want to make a mouse cursor.... I searched nehe's and found a tutorial but for some reason it didn't worked, and I needed a better explanation on how to achieve this. Ty!

Share this post


Link to post
Share on other sites
Advertisement
Use your windowing system api (or SDL) to get the mouse coordinates.

use that as the top left corner of a quad with a pointer texture on it.

update the position every frame (or every time you do your logic update)

Share this post


Link to post
Share on other sites
I think i expressed myself bad... sorry.

What I don't know is how to draw a textured quad in my screen independently of my actual camera. I dont know how to DRAW the mouse cursor in a 2d manner while keeping my ortho view the same.

About getting mouse coords, it's okay ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by LordAsm
What I don't know is how to draw a textured quad in my screen independently of my actual camera. I dont know how to DRAW the mouse cursor in a 2d manner while keeping my ortho view the same.
Don't keep it the same. Before you render your cursor (and other 2d stuff such as a HUD) switch to an orthographic projection with the same dimensions as the screen. Then you can just render in screen coordinates.

EDIT: If you need more info, look here.

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.

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!