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  
  Refresh, restart JOGL  (Read 862 times)
0 Members and 1 Guest are viewing this topic.
Offline 2DGL

JGO n00b
*

Posts: 1


Java games rock!


« on: 2004-10-22 20:35:16 »

Hi.
I'm trying to write a simple molecule viewer with JOGL.  The first time I load a PDB file that contains the coordinate of the atoms,  instantiate the JOGL and add the GLCanvas to the content pane of a JFrame,  everything is working right. But when I use an JFileChooser to load another  molecule file,  nothing changes and when I resize the windows the canvas does not refresh correctly. The path to the file is correct.

I instantiate a new GLCanvas and a new Renderer class, that contains the display() method and implements the GLEventListner, and these problems with refresh occur.

I tried to reuse the GLCanvas I instantiated the first time, but  if I pass the molecule, with the coordinates to the Render class,  NullPointerException occurs.

Does anybody have any idea about this problem? Do I have to "refresh" the state of the OpenGL  to display something different from the moment of its creation, and if so, how do I do this "refresh"?

Thanks
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.095 seconds with 21 queries.