• Advertisement

Archived

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

Showing the mouse cursor

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

Now I have been codeing with OpenGL for some time, and ive only recently broke down and learned Win32 API stuff (been useing glut), My question is, how can I display the windows mouse cursor when I enter full screen, I replaced my own commands that had anything to do with the mouse with nehe''s, but the normal ShowCursor(true) dosent work. I could draw a cursor with gl, and use an ortho perspective the size of the window, but displaying the default cursor would have to run faster than makeing those state changes. I also thought of useing glDrawPixels(), but that might be even slower than rendering a single textured poly.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Sorry...

Thanks!
John William Blair


"The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of the darkness. For he is truly his brother''s keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee."


Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Sorry!!

Thanks!
John William Blair


"The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he who, in the name of charity and good will, shepherds the weak through the valley of the darkness. For he is truly his brother''s keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee."



http://members.home.com/chucklez/wtc/memorialsmall.gif

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Stop it...

You know it is possible to delete your messages, just click the "Edit" link in the upper-right corner of a post and check the "delete this message" checkbox, then click the "modify" button.

Share this post


Link to post
Share on other sites
Well, if you''re not getting a cursor when you send a call to ShowCursor(true), then you might want to check where you declare the WNDClass for your window. There should be a parameter that you set, hCursor (I believe), that stores a handle to the cursor to use for that window. If you''re setting that to NULL, then you''ll not get a cursor when you call ShowCursor(true). If you are already setting that to a cursor handle, then I''m not sure what''s going on. I''m not sure how to change the cursor afterwords either.

J.W.

Share this post


Link to post
Share on other sites
Yeah, im doing this

wc.hCursor = LoadCursor(NULL,IDC_ARROW);

And yes i call the function ShowCursor(true);

and no, i dont see a cursor.

Share this post


Link to post
Share on other sites
Oops, didnt read the part where you alredy tried that, sorry for suggesting something you already tried. =/

-=[ Megahertz ]=-

Share this post


Link to post
Share on other sites
Ok... One last thing to check. According to MSDN ShowCursor() updates an internal display counter, which when >= 0 the cursor will be shown, and when < 0 the cursor won''t be shown. The current value of this display counter is the return value of ShowCursor(), so I would suggest checking that value, to see if it''s really trying to display the cursor. If that doesn''t shed any light on the situation, then I don''t know what to check from there.

Good luck,

j.w.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
brr, don''t try to use that win crap with your applications, they don''t work never way you *really* want, maybe sometimes, but usually not. and yes, create your own routines for rasterizing mouse cursors.

Share this post


Link to post
Share on other sites
Thats what i did, i figured i could never get the number or looks for the cursors out of win.

Look at my display list problem thread please, it has to do with the mouse cursor rendering.

Share this post


Link to post
Share on other sites
Hi Eber

I''ve been thinking about this sort of thing off and on for a few weeks and these are some of the conclusions i''ve arrived at from my occasional experiments:

1.forget the std mouse - use ShowCursor(FALSE) to kill it off at app start.
2. Since a triangle seems to be quickest to draw (and presumably to texture?) then go for that.
3. Mouse messages (moves & clicks) can seem to be intermittent so it''s probably best to have some kind of boolean variable that''s true when the mouse move etc is fired and false once you''ve finished processing it - in much the same way as WM_KEY***
events are handled in NeHe''s excellent tutorials, just test the variable value in each ''draw'' cycle.
4.In non-ortho (normal?) gl fullscreen window I was only able to empirically determine the boundaries for my mouse ''cursor'' (which is a fancy way of saying I tried heaps of things until I got it to sort of work!). I also found it to be a bit slow when other things were happening too so perhaps using a separate thread might be in order (I never tried that). Apparently there are some gl functions that can get values for the display size that could be used for mapping mouse movements - I think they have been mentioned on this forum before but, unfortunately, I can''t remember those function names.

Anyway, that''s just some thoughts/observations on the subject from someone that doesn''t know too much about openGL. Hopefully someone else can help or clarify these points.

Share this post


Link to post
Share on other sites
what i did was set up an ortho view with the dimensions of the window, and use that with the mouse position to draw the cursor in the right spot, the only problem lay in the fact that windows assumes 0,0 to be on the top left, and gl is the bottom left, therefore you have to invert the mouse coords whenever you interface with opengl.

Share this post


Link to post
Share on other sites

  • Advertisement