Package javax.media.opengl

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


//    grabDepthBuffer = false;

    navtime_ctime = new Date();
    navtime_nowtime = new Date();

        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        gl.glShadeModel(GL.GL_SMOOTH); // try setting this to GL_FLAT and
                                       // see what happens.
    drawable.addMouseListener(this);
    drawable.addMouseMotionListener(this);
    drawable.addMouseWheelListener(this);
View Full Code Here


        context.makeCurrent();
        try {
            res.init();
            GL gl = context.getGL();
            gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
            gl.glClearColor(0.1f, 0.2f, 0.1f, 1);

            gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER,
                    GL.GL_NEAREST);
            gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER,
                    GL.GL_LINEAR);
View Full Code Here

      System.exit(1);
    }
   
    GL gl = drawable.getGL();
    gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE);
    gl.glClearColor(0.1f, 0.2f, 0.1f, 1);
   
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
    gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
   
    _fps = new FPSCounter(drawable,14)
View Full Code Here

    // Perform ratio time-steps on the model
    callback.tick();

    // Clear buffer, etc.
    GL gl = drawable.getGL();
    gl.glClearColor(1.0f, 1.0f,1.0f, 1.0f);
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT);
    gl.glMatrixMode(GL.GL_MODELVIEW);
   
    gl.glLoadIdentity();
   
View Full Code Here

            ContextManager.getCurrentContext().enforceStates(_enforcedStates);

            if (_bgColorDirty) {
                final GL gl = GLContext.getCurrentGL();

                gl.glClearColor(_backgroundColor.getRed(), _backgroundColor.getGreen(), _backgroundColor.getBlue(),
                        _backgroundColor.getAlpha());
                _bgColorDirty = false;
            }
        }
        _active++;
View Full Code Here

            _neededClip = _parentRenderer.isClipTestEnabled();
            if (_neededClip) {
                _parentRenderer.pushEmptyClip();
            }

            gl.glClearColor(_backgroundColor.getRed(), _backgroundColor.getGreen(), _backgroundColor.getBlue(),
                    _backgroundColor.getAlpha());
            gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, _fboID);
            ContextManager.getCurrentContext().pushEnforcedStates();
            ContextManager.getCurrentContext().clearEnforcedStates();
            ContextManager.getCurrentContext().enforceStates(_enforcedStates);
View Full Code Here

    protected void deactivate() {
        final GL gl = GLContext.getCurrentGL();

        if (_active == 1) {
            final ReadOnlyColorRGBA bgColor = _parentRenderer.getBackgroundColor();
            gl.glClearColor(bgColor.getRed(), bgColor.getGreen(), bgColor.getBlue(), bgColor.getAlpha());
            gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, 0);
            ContextManager.getCurrentContext().popEnforcedStates();

            if (_neededClip) {
                _parentRenderer.popClip();
View Full Code Here

        // Enable VSync
        gl.setSwapInterval(1);

        // Setup the drawing area and shading mode
        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
        gl.glShadeModel(GL.GL_SMOOTH); // try setting this to GL_FLAT and see what happens.
    }

    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
        GL gl = drawable.getGL();
View Full Code Here

    public void init(GLAutoDrawable gLDrawable) {
        final GL gl = gLDrawable.getGL();
        NEModelManager.gl = gl;
        //-----------------------------------------SetUp OGL-----------------------------------------------//
        //gl.glShadeModel(GL.GL_SMOOTH);              // Enable Smooth Shading
        gl.glClearColor(0, 0, 0, 1);    // Black Background
        gl.glClearDepth(1.0f);                      // Depth Buffer Setup
        gl.glEnable(GL.GL_DEPTH_TEST);              // Enables Depth Testing
        gl.glDepthFunc(GL.GL_LEQUAL);                // The Type Of Depth Testing To Do
       
        gl.glHint(GL.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST)// Really Nice Perspective Calculations
View Full Code Here

     renderer = new TextRenderer(
         new Font("SansSerif", Font.BOLD, 10)
      );
   
    final GL gl = glDrawable.getGL();
    gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

    gl.glClearDepth(1.0);                  //Enable Clearing of the Depth buffer
    gl.glDepthFunc(GL.GL_LEQUAL);              //Type of Depth test
    gl.glEnable(GL.GL_DEPTH_TEST);              //Enable Depth Testing
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.