Revision: 3964
          http://vexi.svn.sourceforge.net/vexi/?rev=3964&view=rev
Author:   clrg
Date:     2010-11-29 23:37:16 +0000 (Mon, 29 Nov 2010)

Log Message:
-----------
Fix backbuffer not always being big enough

Modified Paths:
--------------
    trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java

Modified: trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java
===================================================================
--- trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java       
2010-11-29 15:39:38 UTC (rev 3963)
+++ trunk/org.vexi-core.main/src/main/java/org/vexi/plat/AWT.java       
2010-11-29 23:37:16 UTC (rev 3964)
@@ -542,6 +542,19 @@
             if (rootfill != root.fillcolor) {
                 setBackgroundColor();
             }
+            // REMARK: it is entirely possible that our initial estimation
+            // for the maximum window size is exceeded, so here we check for
+            // this condition and resize the backbuffer as necessary - and
+            // only do so during render to avoid rapid repeats during resize
+            AWTPixelBuffer buf = (AWTPixelBuffer)backbuffer;
+            if (buf.getWidth() < pendingWidth || buf.getHeight() < 
pendingHeight) {
+               int h = buf.getWidth() < pendingWidth ? pendingWidth : 
buf.getWidth();
+               int w = buf.getHeight() < pendingHeight ? pendingHeight : 
buf.getHeight();
+               AWTPixelBuffer new_backbuffer = 
(AWTPixelBuffer)Platform.createPixelBuffer(w, h, this);
+               new_backbuffer.i.getGraphics().drawImage(buf.i, 0, 0, null);
+               backbuffer = new_backbuffer;
+               dirty();
+            }
             super.render();
         }
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to