Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16647/src/net/sourceforge/bprocessor/gl/view
Modified Files:
GLPreviewPanel.java
Log Message:
added timer on GLPreviewPanel... may hurt performance so better sollution should be found
Index: GLPreviewPanel.java
===================================================================
RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/GLPreviewPanel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GLPreviewPanel.java 19 Nov 2007 17:57:32 -0000 1.2
--- GLPreviewPanel.java 20 Nov 2007 08:37:02 -0000 1.3
***************
*** 19,23 ****
--- 19,25 ----
import javax.media.opengl.GLEventListener;
import javax.media.opengl.glu.GLU;
+ import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
+ import javax.swing.Timer;
import net.sourceforge.bprocessor.gui.PreviewPanel;
***************
*** 57,61 ****
this.camera = new Camera("Preview", new double[]{0, 0, 0},
new double[]{10, 10, 10}, new double[]{0, 0, 1}, Camera.PERSPECTIVE);
! repaint();
}
--- 59,69 ----
this.camera = new Camera("Preview", new double[]{0, 0, 0},
new double[]{10, 10, 10}, new double[]{0, 0, 1}, Camera.PERSPECTIVE);
! Timer t = new Timer(150, new AbstractAction(){
! public void actionPerformed(java.awt.event.ActionEvent e) {
! repaint();
! };
! });
! t.setRepeats(true);
! t.start();
}
***************
*** 91,96 ****
this.aspect = (double)getWidth() / (double)getHeight();
- double w = gld.getWidth();
- double h = gld.getHeight();
gl.glClearColor(1, 1, 1, 0);
gl.glViewport(0, 0, getWidth(), getHeight());
--- 99,102 ----
***************
*** 146,150 ****
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glRenderMode(GL.GL_RENDER);
! gl.glRotated(5, 0 , 0, 1);
gl.glColor3fv(View.lineColor, 0);
gl.glLineWidth(1.0f);
--- 152,156 ----
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glRenderMode(GL.GL_RENDER);
! gl.glRotated(5, 0, 0, 1);
gl.glColor3fv(View.lineColor, 0);
gl.glLineWidth(1.0f);
***************
*** 158,162 ****
public void displayChanged(GLAutoDrawable gld, boolean arg1, boolean arg2) {
// TODO Auto-generated method stub
-
}
--- 164,167 ----
|