Examples of glViewport()


Examples of javax.media.opengl.GL.glViewport()

            viewportX = ((width - viewportW) / 2);
            viewportY = ((height - viewportH) / 2);

            GL gl = drawable.getGL();

            gl.glViewport(viewportX, viewportY, viewportW, viewportH);
            gl.glGetIntegerv(GL.GL_VIEWPORT, viewport);//Update viewport buffer

            gl.glMatrixMode(GL.GL_PROJECTION);
            gl.glLoadIdentity();
            glu.gluPerspective(viewField, aspectRatio, nearDistance, farDistance);
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

          if (height <= 0) { // avoid a divide by zero error!
              height = 1;
          }
                   
          gl.glViewport(0, 0, width, height);
         
          renderOptions.projection =
            renderOptions.projection.withAspectRatio((double)width / height);
         
    }
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

    if (height <= 0) // avoid a divide by zero error!
      height = 1;
    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glViewport(0, 0, width, height);
    glu.gluPerspective(45.0f, aspect, 1.0, 20.0);
    gl.glMatrixMode(GL.GL_MODELVIEW);
    gl.glLoadIdentity();

    System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

                vport.getScreenRect().setGeometry(event.x, event.y,
                        bounds.width, bounds.height);
                canvas.setCurrent();
                context.makeCurrent();
                GL gl = context.getGL();
                gl.glViewport(event.x, event.y, bounds.width, bounds.height);
                for (AbstractLayer l : world.getLayers())
                    l.setSize(bounds.width, bounds.height);
                context.release();
                repaint();
            }
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

    gl.glMatrixMode(GL.GL_PROJECTION);
    gl.glLoadIdentity();
    gl.glFrustum (-1.77777*zoom, 1.777777*zoom, -1.0*zoom, 1.0*zoom, 4.0, 100.0);  
    this.height = h; this.width = w;
    this.drawHeight = (int)((double)width/1.77777);
    gl.glViewport (0, (int)((height-drawHeight)/2.0), (int)width, (int)drawHeight);
    //double[] proj = new double[16];
    gl.glGetDoublev(GL.GL_PROJECTION_MATRIX, proj, 0);
  }
 
 
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

        gl.glLoadIdentity();
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glPushMatrix();
        gl.glLoadIdentity();

        gl.glViewport(0, 0, glDrawable.getWidth(), glDrawable.getHeight());

        // Store enabled state and disable lighting, texture mapping and the depth buffer
        gl.glPushAttrib(GL.GL_ENABLE_BIT);
        gl.glDisable(GL.GL_BLEND);
        gl.glDisable(GL.GL_LIGHTING);
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

        if (height <= 0) { // avoid a divide by zero error!
       
            height = 1;
        }
        final float h = (float) width / (float) height;
        gl.glViewport(0, 0, width, height);
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(45.0f, h, 1.0, 20.0);
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

    // The native method for setting the Viewport.
    @Override
    void setViewport(Context ctx, int x, int y, int width, int height) {
        if (VERBOSE) System.err.println("JoglPipeline.setViewport()");
        GL gl = context(ctx).getGL();
        gl.glViewport(x, y, width, height);
    }

    // used for display Lists
    @Override
    void newDisplayList(Context ctx, int displayListId) {
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

        final GL gl = gLDrawable.getGL();

        if (height <= 0) // avoid a divide by zero error!
            height = 1;
        final float h = (float) width / (float) height;
        gl.glViewport(0, 0, width, height);
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glLoadIdentity();
        glu.gluPerspective(45.0f, h, 1f, 100.0);
       
        //gl.glOrtho(-100.0f, 100.0f, -100.0f, 100.0f, -500.0f, 500.0f);     
View Full Code Here

Examples of javax.media.opengl.GL.glViewport()

        gl.glLoadIdentity();
        gl.glMatrixMode(GL.GL_PROJECTION);
        gl.glPushMatrix();
        gl.glLoadIdentity();

        gl.glViewport(0, 0, glDrawable.getWidth(), glDrawable.getHeight());

        // Store enabled state and disable lighting, texture mapping and the depth buffer
        gl.glPushAttrib(GL.GL_ENABLE_BIT);
        gl.glDisable(GL.GL_BLEND);
        gl.glDisable(GL.GL_LIGHTING);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.