View previous topic :: View next topic |
Author |
Message |
silicondale
Joined: 15 Mar 2007 Posts: 252 Location: Matlock, Derbyshire, UK
|
Posted: Tue May 07, 2024 6:40 pm Post subject: OpenGL and mouse position |
|
|
How do I get mouse position x,y in a %og window? CLEARWIN_STRING@ gives MOUSE_LEFT_CLICK and MOUSE_RIGHT_CLICK callback reasons but CLEARWIN_INFO@(GRAPHICS_MOUSE_X) and Y return only zeros. Are there different parameters to be used for OpenGL, or is this something that is just not implemented ? _________________ (Steve Henley) |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 252 Location: Matlock, Derbyshire, UK
|
Posted: Tue May 07, 2024 8:44 pm Post subject: |
|
|
Answering my own question. Found a post from 2008 - John Horspool gave the answer - many thanks, John. I'll try it.
https://forums.silverfrost.com/viewtopic.php?p=4594&sid=d19d1f698516bc5ef2bf888e8685886b
Seems it's very simple if it still works
Code: | CALL GET_OPENGL_MOUSE_STATE@(mx,my,mflag)
|
where mx and my is cursor position (obviously!)
and:-
mflag=1 for left mouse button pressed
mflag=2 for right mouse button
mflag=3 for middle mouse button
mflag=16 for both left and right buttons pressed _________________ (Steve Henley) |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Fri May 10, 2024 4:14 pm Post subject: |
|
|
Ah. John Horspool. RIP. |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 252 Location: Matlock, Derbyshire, UK
|
Posted: Fri May 10, 2024 4:46 pm Post subject: |
|
|
Thanks for letting me know. That's sad. But the call still works.
However, I'm shelving the %og work despite the better quality graphics, and reverting to %gr - problem is the lack of Ftn95 documentation for OpenGL. I've made the example programs work OK, and have even managed to display a digital photo image using OpenGL (each pixel is a little coloured square), but without documentation it's an uphill struggle to do much more with it. _________________ (Steve Henley) |
|
Back to top |
|
|
LitusSaxonicum
Joined: 23 Aug 2005 Posts: 2393 Location: Yateley, Hants, UK
|
Posted: Fri May 10, 2024 9:06 pm Post subject: with exq |
|
|
Steve,
John Horspool was a regular and fantastically helpful contributor to this forum until shortly before he passed away from cancer. He made his living from a finite element stress analysis system with exquisite OpenGL graphics - graduated colours on 3D objects that could be rotated in real time etc. I wish that I'd met him in person.
Even though I don't need anything better than %gr graphics (including mouse interaction and hard copy), I have always envied the results obtainable with OpenGL. I really do wish some generous soul would write a comprehensible and simple guide - ideally, providing it free (Just as I wrote that 200 page intro to Clearwin+ for old-style Fortran programmers that is on this site if I'm allowed to brag).
Eddie |
|
Back to top |
|
|
silicondale
Joined: 15 Mar 2007 Posts: 252 Location: Matlock, Derbyshire, UK
|
Posted: Sat May 11, 2024 8:23 am Post subject: |
|
|
Wow! You are indeed allowed to brag, Eddie. That is an amazing body of work. To think that all these years I have been struggling with the old Salford manuals plus the ftn95.enh and cwplus.enh updates. _________________ (Steve Henley) |
|
Back to top |
|
|
|