Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Would this GLCanvas idea work?  (Read 652 times)
0 Members and 1 Guest are viewing this topic.
Offline planaria

JGO n00b
*

Posts: 20



« on: 2004-01-06 13:00:30 »

Would this work for solving the Z-order problem with GLCanvas and Swing lightweight components?

Two Swing components, one hosting a GLCanvas.  The two components are overlapping and hence the GLCanvas always shows through.

Try this? :
When the GLCanvas component loses focus, make a bitmap of some sort of the openGL displayed bits, then unload the GLCanvas from its Swing container ( e.g. getContentPane().remove(glcanvas) ), then display the static bitmap image.

When the GLCanvas component gains focus again, simply clear the bitmap and reload the GLCanvas.

I've tried doing the unload/reload of the GLCanvas and it works pretty well (a little flicker though).  I'm trying to get the bitmap part to work right now.

One problem I see is that the background windows could not be dynamically updating their images without gaining focus first.

I'd like to hear anyone's opinion of this and suggestions.  Also, I'm still trying to figure out how to create the Image from the GLCanvas.

Mark


Offline GKW

Sr. Member
**

Posts: 453


Revenge is mine!


« Reply #1 on: 2004-01-09 14:45:08 »

I have no idea if that will work or not but you will need to call glReadPixels to get the frame buffer and then you will just need to use that data as the input for a bufferedimage.
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.089 seconds with 21 queries.