/** * Create a tesselator which triangulates all {@link SimpleAccessGeometry} of a {@link GeometryQualityModel}. * * @param useDirectBuffers * to use direct buffers instead of heap buffers. */ public Tesselator( boolean useDirectBuffers ) { glu = new GLU(); this.useDirectBuffers = useDirectBuffers; }
GeometryCallBack( SimpleAccessGeometry geom ) { this.geom = geom; glu = new GLU(); tesselatedVertices = new LinkedList<Vertex>(); }
@Override public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) { GL2 gl2 = arg0.getGL().getGL2(); gl2.glMatrixMode(GL2.GL_PROJECTION); gl2.glLoadIdentity(); // coordinate system origin at lower left with width and height same as the window GLU glu = new GLU(); glu.gluOrtho2D(0.0f, getWidth(), 0.0f, getHeight()); gl2.glMatrixMode(GL2.GL_MODELVIEW); gl2.glLoadIdentity(); gl2.glViewport(0, 0, getWidth(), getHeight()); controller.updateExtents(arg3 / 2, arg4 / 2); } }
public static void testGlError(GL4 gl) { if (gl != null) { int error = gl.glGetError(); if (error != 0) { RuntimeException e = new RuntimeException( "OpenGL Error " + error + ": " + (new GLU()).gluErrorString(error)); e.printStackTrace(); System.exit(-1); } } }
this.copyrightScale = copyrightScale; this.sceneLatitude = sceneLatitude; glu = new GLU(); this.request = request; this.viewParams = request.getViewParameters();
public void checkCardError() throws Ardor3dException { final GL gl = GLContext.getCurrentGL(); final GLU glu = new GLU(); try { final int errorCode = gl.glGetError(); if (errorCode != GL.GL_NO_ERROR) { throw new GLException(glu.gluErrorString(errorCode)); } } catch (final GLException exception) { throw new Ardor3dException("Error in opengl: " + exception.getMessage(), exception); } }
@Override public void init(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); // get the OpenGL graphics context glu = new GLU(); // get GL Utilities gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // set background (clear) color gl.glClearDepth(1.0f); // set clear depth value to farthest gl.glEnable(GL.GL_DEPTH_TEST); // enables depth testing gl.glDepthFunc(GL.GL_LEQUAL); // the type of depth test to do gl.glHint(GL2ES1.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST); // best // perspective // correction gl.glShadeModel(GLLightingFunc.GL_SMOOTH); // blends colors nicely, and // smoothes out // lighting time = System.currentTimeMillis(); }
@Override public void init(GLAutoDrawable drawable) { GL2 gl = drawable.getGL().getGL2(); if(DEBUG) { gl = new DebugGL2(gl); drawable.setGL(gl); } // As we aren't really rendering models, but just drawing, // We do not need to set up a lot. gl.glClearColor(1f, 1f, 1f, 1f); gl.glDisable(GL.GL_DEPTH_TEST); gl.glDisable(GL.GL_CULL_FACE); glu = new GLU(); shared.camera = new Simple1DOFCamera(glu); shared.camera.addCameraListener(new CameraListener() { @Override public void cameraChanged() { canvas.display(); } }); // Setup arcball: arcball = new Arcball1DOFAdapter(shared.camera); shared.textrenderer = new TextRenderer(new Font(Font.SANS_SERIF, Font.BOLD, 36)); // Ensure listeners. switchState(state); }
@Override public void display(GLAutoDrawable glad) { GL2 gl = (GL2)glad.getGL(); gl.glBlendFunc(GL_SRC_ALPHA, blends[iBlend]); gl.glMatrixMode(GL2.GL_PROJECTION); gl.glLoadIdentity(); new GLU().gluOrtho2D(-width / 2 - 1, width / 2 + 1, -height/2 - 1, height/2 + 1); gl.glMatrixMode(GL2.GL_MODELVIEW); gl.glBindBuffer(GL_ARRAY_BUFFER, vbo[0]); if (useOpenGLContext) { queue.finish(); } else { //interleavedColorAndPositionsMem.map(queue, CLMem.MapFlags.Read); interleavedColorAndPositionsMem.read(queue, interleavedColorAndPositionsTemp, true); gl.glBufferSubData(GL_ARRAY_BUFFER, 0, (int)interleavedColorAndPositionsTemp.getValidBytes(), interleavedColorAndPositionsTemp.getByteBuffer()); //interleavedColorAndPositionsMem.unmap(queue, interleavedColorAndPositionsTemp); } gl.glClear(GL_COLOR_BUFFER_BIT); gl.glColor3f(1.0f, 1.0f, 1.0f); //gl.glEnableClientState(GL_VERTEX_ARRAY); //gl.glEnableClientState(GL_COLOR_ARRAY); //gl.glColorPointer(4, GL_UNSIGNED_BYTE, elementSize, gl.glInterleavedArrays(GL2.GL_C4UB_V2F, elementSize, 0); gl.glDrawArrays(GL_POINTS, 0, particlesCount); gl.glBindBuffer(GL_ARRAY_BUFFER, 0); if (!paused) updateKernelArgs(); }