swoolcock / diddy

An Open Source Framework that includes a set of extra functions and APIs for the Monkey language.
MIT License
21 stars 4 forks source link

Moving the cursor outside of the game's bounds while dragging GUI windows results in a crash when compiling for GLFW and XNA #18

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile and run the GUI example with GLFW or XNA as the target.
2. Drag one of the GUI windows, moving the cursor outside of the application's 
window.
3. Experience a crash.

What is the expected output? What do you see instead?
- I'd expect it to act as it does when building for HTML5 (**or lock to the 
side of the window while continuing to drag accordingly**).

What version of the product are you using? On what operating system?
- Monkey v42(b) + Diddy r190, compiling on Windows 7 Ultimate x64.

Please provide any additional information below.
- This seems like it'll be a pretty easy fix. ;)

Original issue reported on code.google.com by Cheese...@gmail.com on 5 Jul 2011 at 6:19

GoogleCodeExporter commented 9 years ago
Bah... I'll have to configure the GLFW and XNA targets on my PC now...
I've been cheating by developing for HTML5 and getting therevills to test it 
after I check in the code... >_>
With HTML5 (and Flash, I think), when you move the mouse out of the game window 
while dragging, Monkey automatically sets MouseDown as false (which fires off 
an IMouseListener.MouseReleased event.
If this doesn't happen, the ComponentAtPoint method detects that you've moved 
the mouse outside of the desktop and will return Null (since there's no 
component there).  It assumes that the mouse is now over no component, and sets 
mouseThisComponent to Null.  Obviously this breaks when it tries to do 
something with it in DoMouse.
The fix will likely be to trick it into reusing the last component.  I'll 
include it in the big GUI update (soon!)

Original comment by samah...@gmail.com on 5 Jul 2011 at 6:31

GoogleCodeExporter commented 9 years ago
Another big GUI update? o.0
Sounds exciting. You're on a roll!

Anyways, if you need me to test anything specific, I'll be more than happy to 
do so.

Thanks!
- Brandon.

Original comment by Cheese...@gmail.com on 5 Jul 2011 at 6:37

GoogleCodeExporter commented 9 years ago
Something else I noticed (but won't report as a bug considering the planned 
update):

GUI windows glitch up when using a virtual resolution but not rendering them 
within it. All you have to do is drag them to the right or bottom borders and 
their graphics stop drawing!

I've attached a modification of the GUI example that showcases the issue.

Original comment by Cheese...@gmail.com on 5 Jul 2011 at 7:07

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed the null check, and the vres stuff - it was to do with scissors.

Original comment by samah...@gmail.com on 5 Jul 2011 at 9:38