Examples of makeCurrent()


Examples of javax.media.opengl.GLContext.makeCurrent()

        tileRenderer.trPerspective(drawable.viewField, (float) imageWidth / (float) imageHeight, drawable.nearDistance, drawable.farDistance);

        //Get gl
        //GLContext oldContext = GLContext.getCurrent();
        GLContext context = pbuffer.getContext();
        if (context.makeCurrent() == GLContext.CONTEXT_NOT_CURRENT) {
            throw new RuntimeException("Error making pbuffer's context current");
        }
        GL gl = pbuffer.getGL();
        gl.glMatrixMode(GL.GL_MODELVIEW);
        gl.glLoadIdentity();
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

                }
            });

            // Linux-specific workaround: Reacquire the lock if necessary.
            if (glContext != null) {
                glContext.makeCurrent();
            }

            return checkForUpdateReturn;
        }
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

             glContext.setGLDrawable(glDrawble, true); // re-association

             // make current last current context
             if (currentContext != null) {
               currentContext.makeCurrent();
             }
      }
    }
    finally {
      surface.unlockSurface();
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

        boolean failed = false;
        int failCount = 0;
        int MAX_FAIL_COUNT = 5;
        do {
            failed = false;
            int res = glContext.makeCurrent();
            if (res == GLContext.CONTEXT_NOT_CURRENT) {
                // System.err.println("makeCurrent fail : " + failCount);
                failed = true;
                ++failCount;
                try {
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

           GLDrawable glDrawable = drawable(offDrawable);

          glDrawable.setRealized(true);

        GLContext glContext = glDrawable.createContext(null);
            glContext.makeCurrent();

            JoglContext ctx = new JoglContext(glContext);

            GL2 gl = glContext.getGL().getGL2();
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

    // The native method that sets this ctx to be the current one
    @Override
    boolean useCtx(Context ctx, Drawable drawable) {
        if (VERBOSE) System.err.println("JoglPipeline.useCtx()");
        GLContext context = context(ctx);
        int res = context.makeCurrent();
        return (res != GLContext.CONTEXT_NOT_CURRENT);
    }

    // Optionally release the context. Returns true if the context was released.
    @Override
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

        // Canvas hasn't been resized to a non-zero size by that point
        private void doQuery() {
            if (alreadyRan)
                return;
            GLContext context = glDrawable.createContext(null);
            int res = context.makeCurrent();
            if (res != GLContext.CONTEXT_NOT_CURRENT) {
                try {
                    chooser.init(context);
                } finally {
                    context.release();
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

        // fix the viewport when the user resizes the window
        glcanvas.addListener( SWT.Resize, new Listener() {
            public void handleEvent(Event event) {
                Rectangle rectangle = glcanvas.getClientArea();
                glcanvas.setCurrent();
                glcontext.makeCurrent();
                OneTriangle.setup( glcontext.getGL().getGL2(), rectangle.width, rectangle.height );
                glcontext.release();       
            }
        });
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

        // draw the triangle when the OS tells us that any part of the window needs drawing
        glcanvas.addPaintListener( new PaintListener() {
            public void paintControl( PaintEvent paintevent ) {
                Rectangle rectangle = glcanvas.getClientArea();
                glcanvas.setCurrent();
                glcontext.makeCurrent();
                OneTriangle.render(glcontext.getGL().getGL2(), rectangle.width, rectangle.height);
                glcanvas.swapBuffers();
                glcontext.release();       
            }
        });
View Full Code Here

Examples of javax.media.opengl.GLContext.makeCurrent()

        tileRenderer.trPerspective(drawable.viewField, (float) imageWidth / (float) imageHeight, drawable.nearDistance, drawable.farDistance);

        //Get gl
        //GLContext oldContext = GLContext.getCurrent();
        GLContext context = pbuffer.getContext();
        if (context.makeCurrent() == GLContext.CONTEXT_NOT_CURRENT) {
            throw new RuntimeException("Error making pbuffer's context current");
        }

        System.out.println("Disabling snapshot");
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.