本文整理汇总了Java中com.jogamp.opengl.GL2.glFlush方法的典型用法代码示例。如果您正苦于以下问题:Java GL2.glFlush方法的具体用法?Java GL2.glFlush怎么用?Java GL2.glFlush使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jogamp.opengl.GL2
的用法示例。
在下文中一共展示了GL2.glFlush方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/** Called when the canvas is updated. To update the display, call either
* <code>repaint()</code> or <code>display()</code>.
* @param drawable the Open GL context.
*/
@Override
public synchronized void display(GLAutoDrawable drawable) {
GL2 gl = getGL().getGL2();
if (reshapePending) {
reshapePending = false;
reshape(drawable, 0, 0, getWidth(), getHeight());
}
try {
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
displayPixmap(drawable);
drawText(gl);
gl.glFlush();
} catch (GLException e) {
log.warning(e.toString());
}
}
示例2: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
/**
* Called when the canvas is updated. To update the display, call either
* <code>repaint()</code> or <code>display()</code>.
*
* @param drawable the Open GL context.
*/
@Override
public synchronized void display(GLAutoDrawable drawable) {
GL2 gl = getGL().getGL2();
// gl.getContext().makeCurrent();
checkGLError(gl, "before display in ID");
if (reshapePending) {
reshapePending = false;
reshape(drawable, 0, 0, getWidth(), getHeight());
}
try {
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
displayPixmap(drawable);
drawText(gl);
gl.glFlush();
} catch (GLException e) {
log.warning(e.toString());
}
checkGLError(gl, "after setDefaultProjection in ID");
}
示例3: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL().getGL2();
g.setColor(Color.WHITE);
//Transform by Camera
g.updateCamera(camera);
//Draw Billboard
texture.enable(gl);
texture.bind(gl);
g.drawBillboard(billboard);
texture.disable(gl);
DirectionUtil.rotateAround(sphereCenter, billboard.center, rotationAxis, angle);
billboard.turnTo(sphereCenter);
gl.glPushMatrix();
g.setColor(Color.BLUE);
g.drawSphere(1, sphereCenter.x, sphereCenter.y, sphereCenter.z);
gl.glPopMatrix();
gl.glFlush();
}
示例4: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL().getGL2();
g.setColor(Color.WHITE);
//Transform by Camera
g.updateCamera(camera);
//Draw Billboard
texture.enable(gl);
texture.bind(gl);
g.drawBillboard(billboard);
texture.disable(gl);
gl.glFlush();
}
示例5: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
resetScene(graphics);
//Draw Scene
drawFloor(gl);
resetScene(graphics);
angleXY = leftMarker.angleXY(originMarker);
angleXZ = leftMarker.angleXZ(originMarker);
angleYZ = leftMarker.angleYZ(originMarker);
//Angle XY turn in Z
gl.glRotated(angleXY, 0, 0, 1);
drawTile(gl, leftMarker.getX(), leftMarker.getY(), tileSize, marker);
gl.glFlush();
}
示例6: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
//TODO TEST
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glClearColor(1f, 1f, 1f, 1);
//Transform by Camera
lookCamera(graphics);
//Draw Scene
drawAxis(gl);
drawFloor(gl);
gl.glFlush();
}
示例7: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL().getGL2();
//TODO TEST
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glClearColor(1f, 1f, 1f, 1);
//Transform by Aim
g.aimCamera(view.getAim());
//Draw Scene
drawAxis(gl);
drawFloor(gl);
gl.glFlush();
}
示例8: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
updateControls(0);
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL().getGL2();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glClearColor(1f, 1f, 1f, 1);
//Transform by Aim
g.aimCamera(aim);
skyBox.draw(g);
gl.glFlush();
}
示例9: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
view.update(0);
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL().getGL2();
gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
gl.glClearColor(1f, 1f, 1f, 1);
//Transform by Aim
g.aimCamera(view.getAim());
//Draw Scene
g.setColor(Color.BLACK);
g.drawGrid(1, 150, 150);
logo.renderWireframe(gl);
gl.glFlush();
}
示例10: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
if(wireFrame) {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
} else {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
}
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
//gl.glColor3f(1.0f, 1.0f, 0f);
g.setColor(color);
gl.glLoadIdentity(); /* clear the matrix */
/* viewing transformation */
g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gl.glScalef(1.0f, 2.0f, 1.0f); /* modeling transformation */
g.drawCylinder(1, 2);
gl.glFlush();
}
示例11: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
if(wireFrame) {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
} else {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
}
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
//gl.glColor3f(1.0f, 1.0f, 0f);
g.setColor(color);
gl.glLoadIdentity(); /* clear the matrix */
/* viewing transformation */
g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gl.glScalef(1.0f, 2.0f, 1.0f); /* modeling transformation */
g.drawSphere(1.0);
gl.glFlush();
}
示例12: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL2();
if(wireFrame) {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
} else {
gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
}
gl.glClear(GL2.GL_COLOR_BUFFER_BIT);
//gl.glColor3f(1.0f, 1.0f, 0f);
g.setColor(color);
gl.glLoadIdentity(); /* clear the matrix */
/* viewing transformation */
g.getGLU().gluLookAt(0.0, 0.0, 5.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
gl.glScalef(1.0f, 2.0f, 1.0f); /* modeling transformation */
g.drawCube(1.0);
gl.glFlush();
}
示例13: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public synchronized void display(GLAutoDrawable drawable) {
if (raceTrack != null) {
LinkedList<Point2D.Float> allpoints = raceTrack.getSmoothPoints(stepsize);
ListIterator<Point2D.Float> it = allpoints.listIterator();
GL2 gl = getGL().getGL2();
gl.glClear(GL.GL_COLOR_BUFFER_BIT);
gl.glLineWidth(1.0f);
gl.glColor3f(0,1,0);
gl.glBegin(GL.GL_LINE_LOOP);
while (it.hasNext()) {
Point2D p = it.next();
gl.glVertex2d((2*p.getX())-1, (2*p.getY())-1);
}
gl.glEnd();
if (myCar != null) {
// Move car
myCar.drive();
// Display car
myCar.displayCar(gl);
} else {
System.out.println("No car defined!");
}
gl.glFlush();
}
}
示例14: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL().getGL2();
//Transform by Camera
g.updateCamera(camera);
//Draw Scene
drawFloor(gl);
gl.glFlush();
}
示例15: display
import com.jogamp.opengl.GL2; //导入方法依赖的package包/类
@Override
public void display(Graphics3D graphics) {
AWTGraphics3D g = (AWTGraphics3D) graphics;
GL2 gl = g.getGL().getGL2();
//Transform by Camera
g.updateCamera(camera);
//Draw Scene
drawFloor(gl);
gl.glFlush();
}