Examples of GLCapabilities


Examples of javax.media.opengl.GLCapabilities

        int tileHeight = height / 12;
        int imageWidth = width;
        int imageHeight = height;

        //Caps
        GLCapabilities caps = new GLCapabilities();
        caps.setAlphaBits(8);
        caps.setDoubleBuffered(false);
        caps.setHardwareAccelerated(true);
        caps.setSampleBuffers(true);
        caps.setNumSamples(antiAliasing);

        //Buffer
        GLPbuffer pbuffer = GLDrawableFactory.getFactory().createGLPbuffer(caps, null, tileWidth, tileHeight, null);
        BufferedImage image = null;
        if (transparentBackground) {
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

    protected abstract void reshape3DScene(GL gl);

    protected abstract void setCameraPosition(GL gl, GLU glu);

    protected GLCapabilities getCaps() {
        GLCapabilities caps = new GLCapabilities();
        try {
            caps.setAlphaBits(8);    //if NOT opaque
            caps.setDoubleBuffered(true);
            caps.setHardwareAccelerated(true);

            //FSAA
            int antialisaing = vizController.getVizConfig().getAntialiasing();
            if (antialisaing == 0) {
                caps.setSampleBuffers(false);
            } else if (antialisaing == 2) {
                caps.setSampleBuffers(true);
                caps.setNumSamples(2);
            } else if (antialisaing == 4) {
                caps.setSampleBuffers(true);
                caps.setNumSamples(4);
            } else if (antialisaing == 8) {
                caps.setSampleBuffers(true);
                caps.setNumSamples(8);
            } else if (antialisaing == 16) {
                caps.setSampleBuffers(true);
                caps.setNumSamples(16);
            }
        } catch (javax.media.opengl.GLException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

public class ViewerGLCanvas extends GLCanvas {

  public ViewerGLCanvas(Data data, MessageManager messageManager, RenderOptions renderOptions) {

    super(new GLCapabilities(GLProfile.getDefault()));
   
    setSize(800, 600);
    setIgnoreRepaint(true);

    addGLEventListener(new ViewerGLEventListener(data, messageManager, renderOptions));
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

   
    if (! factory.canCreateGLPbuffer(null, profile)) {
      throw new Error("Cannot create GLPbuffer for OpenGL output!");
    }
   
    GLCapabilities cap = new GLCapabilities(profile);
    cap.setDoubleBuffered(false);
       
    pBufferSizeX = min(canvasLimit, expectedMaxSizeX);
    pBufferSizeY = min(canvasLimit, expectedMaxSizeY);
       
    pBuffer = factory.createGLPbuffer(null,
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

  public static final int INIT_HEIGHT = 600;

  private final TestbedController controller;

  public JoglPanel(final TestbedModel model, final TestbedController controller) {
    super(new GLCapabilities(GLProfile.getDefault()));
    this.controller = controller;
    setSize(600, 600);
    setPreferredSize(new Dimension(600, 600));
    setAutoSwapBufferMode(true);
    addGLEventListener(this);
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

    getContentPane().setLayout(new BorderLayout());

    /* Cria um objeto GLCapabilities para especificar
     * o n�mero de bits por pixel para RGBA
     */
    GLCapabilities glCaps = new GLCapabilities();
    glCaps.setRedBits(8);
    glCaps.setBlueBits(8);
    glCaps.setGreenBits(8);
    glCaps.setAlphaBits(8);

    /* Cria um canvas, adiciona ao frame e objeto "ouvinte"
     * para os eventos Gl, de mouse e teclado
     */
    GLCanvas canvas = new GLCanvas(glCaps);
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

            }

            // Make our GLPbuffer...
            final GLProfile profile = _capsUtil.getProfile();
            final GLDrawableFactory fac = GLDrawableFactory.getFactory(profile);
            final GLCapabilities caps = new GLCapabilities(profile);
            caps.setHardwareAccelerated(true);
            caps.setDoubleBuffered(true);
            caps.setAlphaBits(_settings.getAlphaBits());
            caps.setDepthBits(_settings.getDepthBits());
            caps.setNumSamples(_settings.getSamples());
            caps.setSampleBuffers(_settings.getSamples() != 0);
            caps.setStencilBits(_settings.getStencilBits());
            caps.setDoubleBuffered(false);
            caps.setOnscreen(false);
            caps.setPBuffer(true);
            _offscreenDrawable = fac.createOffscreenAutoDrawable(null, caps, null, _width, _height, _parentContext);
            _context = _offscreenDrawable.getContext();

            _context.makeCurrent();
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

    getContentPane().setLayout(new BorderLayout());

    /* Cria um objeto GLCapabilities para especificar
     * o n�mero de bits por pixel para RGBA
     */
    GLCapabilities glCaps = new GLCapabilities();
    glCaps.setRedBits(8);
    glCaps.setBlueBits(8);
    glCaps.setGreenBits(8);
    glCaps.setAlphaBits(8);

    /* Cria um canvas, adiciona ao frame e objeto "ouvinte"
     * para os eventos Gl, de mouse e teclado
     */
   
 
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

     * of the selected UI Component you wish to cutomize in design mode.
     * @return Returns customized GLCapabilities.
     */
    private GLCapabilities createGLCapabilites() {
       
        GLCapabilities capabilities = new GLCapabilities();
        capabilities.setHardwareAccelerated(true);

        // try to enable 2x anti aliasing - should be supported on most hardware
        capabilities.setNumSamples(2);
        capabilities.setSampleBuffers(true);
       
        return capabilities;
    }
View Full Code Here

Examples of javax.media.opengl.GLCapabilities

    //AbstractGraphicsDevice device = awtConfig.getScreen().getDevice();      // throws exception
    // Alternative: default graphics device
        AbstractGraphicsDevice device = GLDrawableFactory.getDesktopFactory().getDefaultDevice();

    // Offscreen Canvas3D's capabilites, determined in 'getBestConfiguration'
    GLCapabilities canvasCaps = (GLCapabilities)awtConfig.getChosenCapabilities();

    // For further investigations : the user's GraphicsConfigTemplate3D (not used yet)
    GraphicsConfigTemplate3D gct3D = gcInf0.getGraphicsConfigTemplate3D();


        // Assuming that the offscreen drawable will/can support the chosen GLCapabilities
      // of the offscreen Canvas3D

        final GLCapabilities offCaps = new GLCapabilities(profile);
        offCaps.copyFrom(canvasCaps);

        // double bufffering only if scene antialiasing is required/preferred and supported
        if (offCaps.getSampleBuffers() == false) {
          offCaps.setDoubleBuffered(false);
          offCaps.setNumSamples(0);
        }

        // Never stereo
        offCaps.setStereo(false);

        // Set preferred offscreen drawable : framebuffer object (FBO) or pbuffer
        offCaps.setFBO(true); // switches to pbuffer if FBO is not supported
    // caps.setPBuffer(true);

    // !! a 'null' capability chooser; JOGL doesn't call a chooser for offscreen drawable

    // If FBO : 'offDrawable' is of type javax.media.opengl.GLFBODrawable
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.