当前位置: 首页>>代码示例>>Java>>正文


Java GLCapabilities.setNumSamples方法代码示例

本文整理汇总了Java中com.jogamp.opengl.GLCapabilities.setNumSamples方法的典型用法代码示例。如果您正苦于以下问题:Java GLCapabilities.setNumSamples方法的具体用法?Java GLCapabilities.setNumSamples怎么用?Java GLCapabilities.setNumSamples使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jogamp.opengl.GLCapabilities的用法示例。


在下文中一共展示了GLCapabilities.setNumSamples方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GltfViewerJogl

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
/**
 * Creates a new GltfViewerJogl
 */
public GltfViewerJogl()
{
    GLProfile profile = getGLProfile();
    logger.config("GLProfile: " + profile);

    GLCapabilities capabilities = new GLCapabilities(profile);
    capabilities.setNumSamples(2);
    capabilities.setSampleBuffers(true);
    
    glComponent = new GLCanvas(capabilities);
    glComponent.addGLEventListener(glEventListener);
    
    // Without setting the minimum size, the canvas cannot 
    // be resized when it is embedded in a JSplitPane
    glComponent.setMinimumSize(new Dimension(10, 10));
    
    glContext = new GlContextJogl();
}
 
开发者ID:javagl,项目名称:JglTF,代码行数:22,代码来源:GltfViewerJogl.java

示例2: createDrawable

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public GLAutoDrawable createDrawable(final Composite parent) {
	final GLProfile profile = GLProfile.getDefault();
	final GLCapabilities cap = new GLCapabilities(profile);
	cap.setDepthBits(24);
	// cap.setBackgroundOpaque(true);
	cap.setDoubleBuffered(true);
	cap.setHardwareAccelerated(true);
	cap.setSampleBuffers(true);
	cap.setAlphaBits(8);
	cap.setNumSamples(8);
	canvas = new GLCanvas(parent, SWT.NONE, cap, null);
	canvas.setAutoSwapBufferMode(true);
	final SWTGLAnimator animator = new SWTGLAnimator(canvas);
	// animator.setIgnoreExceptions(!GamaPreferences.Runtime.ERRORS_IN_DISPLAYS.getValue());
	animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
	canvas.addGLEventListener(this);
	final FillLayout gl = new FillLayout();
	canvas.setLayout(gl);
	return canvas;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:21,代码来源:Abstract3DRenderer.java

示例3: Shoot

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
Shoot()
{	
	System.out.printf("THREAD_COUNT:%4d\n", THREAD_COUNT);
	GLProfile glp = GLProfile.getDefault();
	GLCapabilities caps = new GLCapabilities(glp);
	caps.setSampleBuffers(true);
	caps.setNumSamples(8);
	
	canvas = new GLCanvas(caps);
	canvas.setSize(1000, 1000);
	canvas.addMouseListener(mcontrol);
	canvas.addKeyListener(kbcontrol);
	
	disp = new Display(this);
	disp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	disp.setSize(1000,1000);
	disp.add(canvas);
	disp.setVisible(true);
	disp.addKeyListener(kbcontrol);
	
	canvas.addGLEventListener(disp);
	animator = new FPSAnimator(canvas, 50);
	
	mtProjectiles = new MT_Generic<Projectile>(entityWrapper.projectiles, es);
	mtDynamics = new MT_Generic<Dynamic>(entityWrapper.dynamics, es);
	mtEntMov = new MT_EntMovement(entityWrapper.pathEnts, es);
	
	inst = this;
}
 
开发者ID:ben-j-c,项目名称:TopDownGame,代码行数:30,代码来源:Shoot.java

示例4: main

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public static void main(final String[] args) {
    final GLProfile glp = GLProfile.getGL2ES2();
    final GLCapabilities caps = new GLCapabilities(glp);
    caps.setAlphaBits(4);
    caps.setSampleBuffers(true);
    caps.setNumSamples(4);
    System.out.println("Requested: " + caps);

    final GLWindow window = GLWindow.create(caps);
    window.setPosition(10, 10);
    window.setSize(800, 400);
    window.setTitle("GPU UI Newt Demo 01");
    final RenderState rs = RenderState.createRenderState(SVertex.factory());
    final UIGLListener01 uiGLListener = new UIGLListener01 (0, rs, DEBUG, TRACE);
    uiGLListener.attachInputListenerTo(window);
    window.addGLEventListener(uiGLListener);
    window.setVisible(true);

    final Animator animator = new Animator();
    animator.setUpdateFPSFrames(60, System.err);
    animator.add(window);

    window.addKeyListener(new KeyAdapter() {
        public void keyPressed(final KeyEvent arg0) {
            if(arg0.getKeyCode() == KeyEvent.VK_F4) {
                window.destroy();
            }
        }
    });
    window.addWindowListener(new WindowAdapter() {
        public void windowDestroyed(final WindowEvent e) {
            animator.stop();
        }
    });

    animator.start();
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:38,代码来源:UINewtDemo01.java

示例5: test10RegionRendererMSAA01

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
@Test
public void test10RegionRendererMSAA01() throws InterruptedException {
    final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
    final GLCapabilities caps = new GLCapabilities(glp);
//    caps.setOnscreen(false);
    caps.setAlphaBits(4);
    caps.setSampleBuffers(true);
    caps.setNumSamples(4);

    final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
    final RenderState rs = RenderState.createRenderState(SVertex.factory());

    final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
    demo01Listener.attachInputListenerTo(window);
    window.addGLEventListener(demo01Listener);

    final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
    window.addGLEventListener(listener);

    listener.setTech(-20, 00, -300, 0f, 2);
    window.display();

    listener.setTech(-20, 00, -150, 0f, 3);
    window.display();

    listener.setTech(-20, 00,  -50, 0f, 4);
    window.display();

    destroyWindow(window);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:31,代码来源:TestRegionRendererNEWT01.java

示例6: test11RegionRendererMSAA02

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public void test11RegionRendererMSAA02() throws InterruptedException {
    if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
        // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
        // FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet!
        System.err.println("disabled on non desktop (x86) arch for now ..");
        return;
    }
    final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
    final GLCapabilities caps = new GLCapabilities(glp);
    caps.setAlphaBits(4);
    caps.setSampleBuffers(true);
    caps.setNumSamples(4);

    final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
    final RenderState rs = RenderState.createRenderState(SVertex.factory());

    final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false);
    demo01Listener.attachInputListenerTo(window);
    window.addGLEventListener(demo01Listener);

    final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
    window.addGLEventListener(listener);

    listener.setTech(-20, 00, -300, 0f, 2);
    window.display();

    listener.setTech(-20, 00, -150, 0f, 3);
    window.display();

    listener.setTech(-20, 00,  -50, 0f, 4);
    window.display();

    destroyWindow(window);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:35,代码来源:TestRegionRendererNEWT01.java

示例7: main

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public static void main(String[] args) {
    Frame frame = new Frame("Delaunay Triangulation Example");
    frame.setResizable(false);

    GLCapabilities caps = new GLCapabilities(GLProfile.get("GL2"));
    caps.setSampleBuffers(true);
    caps.setNumSamples(8);

    GLCanvas canvas = new GLCanvas(caps);

    DelaunayTriangulationExample ex = new DelaunayTriangulationExample();
    MouseListener lister = ex;
    canvas.addGLEventListener(ex);
    canvas.setPreferredSize(DIMENSION);
    canvas.addMouseListener(lister);

    frame.add(canvas);

    final FPSAnimator animator = new FPSAnimator(canvas, 25);

    frame.addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            new Thread(new Runnable() {
                public void run() {
                    animator.stop();
                    System.exit(0);
                }
            }).start();
        }
    });

    frame.setVisible(true);
    frame.pack();
    animator.start();
}
 
开发者ID:jdiemke,项目名称:delaunay-triangulator,代码行数:36,代码来源:DelaunayTriangulationExample.java

示例8: ClearGLWindow

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public ClearGLWindow(final String pWindowTitle,
		final int pDefaultWidth,
		final int pDefaultHeight,
		final String pGLVersion,
		final int pNumberOfSamples,
		final ClearGLEventListener pClearGLWindowEventListener) {
	mWindowTitle = pWindowTitle;
	mWindowDefaultWidth = pDefaultWidth;
	mWindowDefaultHeight = pDefaultHeight;

	mProjectionMatrix = new GLMatrix();
	mViewMatrix = new GLMatrix();

	final GLProfile lProfile = GLProfile.get(pGLVersion);
	System.out.println(this.getClass().getSimpleName() + ": "
			+ lProfile);
	final GLCapabilities lCapabilities = new GLCapabilities(lProfile);

	lCapabilities.setSampleBuffers(pNumberOfSamples > 1);
	lCapabilities.setNumSamples(pNumberOfSamples);
	lCapabilities.setDepthBits(24);
	lCapabilities.setHardwareAccelerated(true);

	final GLCapabilitiesChooser lMultisampleChooser = new MultisampleChooser();

	mWindow = NewtFactory.createWindow(lCapabilities);
	mGlWindow = GLWindow.create(mWindow);
	mGlWindow.setCapabilitiesChooser(lMultisampleChooser);
	mGlWindow.setTitle(pWindowTitle);

	pClearGLWindowEventListener.setClearGLWindow(this);
	mGlWindow.addGLEventListener(pClearGLWindowEventListener);
	mGlWindow.setSurfaceSize(pDefaultWidth, pDefaultHeight);
	mGlWindow.setAutoSwapBufferMode(true);

	// lAnimator.add(mClearGLWindow.getGLAutoDrawable());
}
 
开发者ID:ClearVolume,项目名称:ClearGL,代码行数:38,代码来源:ClearGLWindow.java

示例9: getGLCapabilities

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
private static GLCapabilities getGLCapabilities(GLProfile profile) {
    GLCapabilities capabilities = new GLCapabilities(profile);
    capabilities.setSampleBuffers(true);
    capabilities.setNumSamples(GLInfo.GLSAMPLES);
    return capabilities;
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:7,代码来源:GLHelper.java

示例10: AtsTexturePreview

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
private AtsTexturePreview() {
    // setDoubleBuffered(true);
    // setBorder(BorderFactory.createLoweredBevelBorder());

    // setBorder(BorderFactory.createLoweredBevelBorder());
    // setBorder(BorderFactory.createTitledBorder("title"));
    GLProfile glp = GLProfile.get(GLProfile.GL2);
    GLCapabilities caps = new GLCapabilities(glp);

    // caps.setDoubleBuffered(true);
    caps.setSampleBuffers(true);
    caps.setNumSamples(4);
    // glCaps.setStencilBits(8);
    // setBackground(Color.BLACK);
    // setPreferredSize(new Dimension(400,256));

    // setLayout(new GridLayout(1, 1, 3, 3));

    // setMinimumSize(new Dimension(0, 0));
    // setMaximumSize(new Dimension(0, 0));

    canvas_ = new GLJPanel(caps);

    canvas_.setPreferredSize(new Dimension(400, 256));

    setLayout(new BorderLayout());
    // setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    add(BorderLayout.CENTER, canvas_);

    // add(canvas_);

    canvas_.addMouseListener(this);
    canvas_.addMouseMotionListener(this);
    canvas_.addMouseWheelListener(this);

    canvas_.addGLEventListener(this);

    animator_ = new FPSAnimator(canvas_, 25);
    animator_.start();

}
 
开发者ID:jdiemke,项目名称:XPTS,代码行数:42,代码来源:AtsTexturePreview.java

示例11: testTextRendererImpl

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
void testTextRendererImpl(final Font[] fonts, final int renderModes, final int sampleCount, final boolean onlyIssues) throws InterruptedException, GLException, IOException {
    final GLProfile glp;
    if(forceGL3) {
        glp = GLProfile.get(GLProfile.GL3);
    } else if(forceES2) {
        glp = GLProfile.get(GLProfile.GLES2);
    } else {
        glp = GLProfile.getGL2ES2();
    }

    final GLCapabilities caps = new GLCapabilities( glp );
    caps.setAlphaBits(4);
    if( 0 < sampleCount && !Region.isVBAA(renderModes) ) {
        caps.setSampleBuffers(true);
        caps.setNumSamples(sampleCount);
    }
    caps.setOnscreen(false);
    System.err.println("Requested: "+caps);
    System.err.println("Requested: "+Region.getRenderModeString(renderModes));

    final int totalHeight = ( (int)fontSize + 1 ) * ( onlyIssues ? 3 : 6 ) * fonts.length;
    final NEWTGLContext.WindowContext winctx =
            NEWTGLContext.createWindow(caps, 800, totalHeight, true);
    final GLDrawable drawable = winctx.context.getGLDrawable();
    final GL2ES2 gl = winctx.context.getGL().getGL2ES2();

    Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());

    System.err.println("Chosen: "+winctx.window.getChosenCapabilities());

    final RenderState rs = RenderState.createRenderState(SVertex.factory());
    final RegionRenderer renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
    rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
    final TextRegionUtil textRenderUtil = new TextRegionUtil(renderModes);

    // init
    gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
    renderer.init(gl, 0);
    rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
    screenshot = new GLReadBufferUtil(false, false);

    // reshape
    gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());

    // renderer.reshapePerspective(gl, 45.0f, drawable.getWidth(), drawable.getHeight(), 0.1f, 1000.0f);
    renderer.reshapeOrtho(drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), 0.1f, 1000.0f);

    final int[] sampleCountIO = { sampleCount };
    // display
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    for(int i=0; i<fonts.length; i++) {
        final Font font = fonts[i];
        renderString(drawable, gl, renderer, font, textRenderUtil, font.getFullFamilyName(null).toString()+": "+issues, 0,  0==i?0:-1, -1000, sampleCountIO);
        if(!onlyIssues) {
            renderString(drawable, gl, renderer, font, textRenderUtil, "012345678901234567890123456789", 0,  -1, -1000, sampleCountIO);
            renderString(drawable, gl, renderer, font, textRenderUtil, "abcdefghijklmnopqrstuvwxyz", 0, -1, -1000, sampleCountIO);
            renderString(drawable, gl, renderer, font, textRenderUtil, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 0, -1, -1000, sampleCountIO);
        }
        renderString(drawable, gl, renderer, font, textRenderUtil, "", 0, -1, -1000, sampleCountIO);
        renderString(drawable, gl, renderer, font, textRenderUtil, "", 0, -1, -1000, sampleCountIO);
    }

    drawable.swapBuffers();
    printScreen(renderModes, drawable, gl, false, sampleCount);

    sleep();

    // dispose
    screenshot.dispose(gl);
    renderer.destroy(gl);

    NEWTGLContext.destroyWindow(winctx);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:74,代码来源:TestTextRendererNEWTBugXXXX.java

示例12: testImpl

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public void testImpl(final int sceneMSAASamples, final int graphMSAASamples, final int graphVBAASamples) throws InterruptedException {
    final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
    final GLCapabilities caps = new GLCapabilities(glp);
    caps.setAlphaBits(4);
    if( 0 < sceneMSAASamples ) {
        caps.setSampleBuffers(true);
        caps.setNumSamples(sceneMSAASamples);
    }
    System.err.println("Requested: "+caps+", graph[msaaSamples "+graphMSAASamples+", vbaaSamples "+graphVBAASamples+"]");

    final GLWindow window = createWindow("text-gvbaa"+graphVBAASamples+"-gmsaa"+graphMSAASamples+"-smsaa"+sceneMSAASamples, caps, 1024, 640);
    window.display();
    System.err.println("Chosen: "+window.getChosenGLCapabilities());
    if( WaitStartEnd ) {
        JunitTracer.waitForKey("Start");
    }

    final RenderState rs = RenderState.createRenderState(SVertex.factory());
    final int renderModes, sampleCount;
    if( graphVBAASamples > 0 ) {
        renderModes = Region.VBAA_RENDERING_BIT;
        sampleCount = graphVBAASamples;
    } else if ( graphMSAASamples > 0 ) {
        renderModes = Region.MSAA_RENDERING_BIT;
        sampleCount = graphMSAASamples;
    } else {
        renderModes = 0;
        sampleCount = 0;
    }
    final TextRendererGLEL textGLListener = new TextRendererGLEL(rs, renderModes, sampleCount);
    System.err.println(textGLListener.getFontInfo());

    window.addGLEventListener(textGLListener);

    final Animator anim = new Animator();
    anim.add(window);
    anim.start();
    anim.setUpdateFPSFrames(60, null);
    sleep();
    window.invoke(true, new GLRunnable() {
        @Override
        public boolean run(final GLAutoDrawable drawable) {
            try {
                textGLListener.printScreen(renderModes, drawable, "./", "TestTextRendererNEWT00-snap"+screenshot_num, false);
                screenshot_num++;
            } catch (final Exception e) {
                e.printStackTrace();
            }
            return true;
        }
    });
    anim.stop();
    if( WaitStartEnd ) {
        JunitTracer.waitForKey("Stop");
    }
    destroyWindow(window);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:58,代码来源:TestTextRendererNEWT00.java

示例13: testTextRendererImpl

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
void testTextRendererImpl(final int renderModes, final int sampleCount) throws InterruptedException, GLException, IOException {
    final GLProfile glp;
    if(forceGL3) {
        glp = GLProfile.get(GLProfile.GL3);
    } else if(forceES2) {
        glp = GLProfile.get(GLProfile.GLES2);
    } else {
        glp = GLProfile.getGL2ES2();
    }

    final GLCapabilities caps = new GLCapabilities( glp );
    caps.setAlphaBits(4);
    if( 0 < sampleCount && !Region.isVBAA(renderModes) ) {
        caps.setSampleBuffers(true);
        caps.setNumSamples(sampleCount);
    }
    System.err.println("Requested: "+caps);
    System.err.println("Requested: "+Region.getRenderModeString(renderModes));

    final NEWTGLContext.WindowContext winctx = NEWTGLContext.createWindow(caps, 800, 400, true);
    final GLDrawable drawable = winctx.context.getGLDrawable();
    final GL2ES2 gl = winctx.context.getGL().getGL2ES2();

    Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());

    System.err.println("Chosen: "+winctx.window.getChosenCapabilities());

    final RenderState rs = RenderState.createRenderState(SVertex.factory());
    final RegionRenderer renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
    rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
    final TextRegionUtil textRenderUtil = new TextRegionUtil(renderModes);

    // init
    gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
    renderer.init(gl, 0);
    rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
    screenshot = new GLReadBufferUtil(false, false);

    // reshape
    gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());

    // renderer.reshapePerspective(gl, 45.0f, drawable.getWidth(), drawable.getHeight(), 0.1f, 1000.0f);
    renderer.reshapeOrtho(drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), 0.1f, 1000.0f);

    final int[] sampleCountIO = { sampleCount };
    // display
    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
    if( null == customStr ) {
        renderString(drawable, gl, renderer, textRenderUtil, "012345678901234567890123456789", 0,  0, -1000, sampleCountIO);
        renderString(drawable, gl, renderer, textRenderUtil, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 0, -1, -1000, sampleCountIO);
        renderString(drawable, gl, renderer, textRenderUtil, "Hello World", 0, -1, -1000, sampleCountIO);
        renderString(drawable, gl, renderer, textRenderUtil, "4567890123456", 4, -1, -1000,sampleCountIO);
        renderString(drawable, gl, renderer, textRenderUtil, "I like JogAmp", 4, -1, -1000, sampleCountIO);

        int c = 0;
        renderString(drawable, gl, renderer, textRenderUtil, "GlueGen", c++, -1, -1000, sampleCountIO);
        renderString(drawable, gl, renderer, textRenderUtil, "JOAL", c++, -1, -1000, sampleCountIO);
        renderString(drawable, gl, renderer, textRenderUtil, "JOGL", c++, -1, -1000, sampleCountIO);
        renderString(drawable, gl, renderer, textRenderUtil, "JOCL", c++, -1, -1000, sampleCountIO);
    } else {
        renderString(drawable, gl, renderer, textRenderUtil, customStr, 0,  0, -1000, sampleCountIO);
    }
    drawable.swapBuffers();
    printScreen(renderModes, drawable, gl, false, sampleCount);

    sleep();

    // dispose
    screenshot.dispose(gl);
    renderer.destroy(gl);

    NEWTGLContext.destroyWindow(winctx);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:74,代码来源:TestTextRendererNEWT10.java

示例14: testTextRendererMSAA01

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
@Test
public void testTextRendererMSAA01() throws InterruptedException {
    final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
    final GLCapabilities caps = new GLCapabilities(glp);
    caps.setAlphaBits(4);
    caps.setSampleBuffers(true);
    caps.setNumSamples(4);
    System.err.println("Requested: "+caps);

    final GLWindow window = createWindow("text-vbaa0-msaa1", caps, 800, 400);
    window.display();
    System.err.println("Chosen: "+window.getChosenGLCapabilities());

    final RenderState rs = RenderState.createRenderState(SVertex.factory());
    final TextGLListener textGLListener = new TextGLListener(rs, 0, DEBUG, TRACE);
    textGLListener.attachInputListenerTo(window);
    window.addGLEventListener(textGLListener);

    if(textGLListener.setFontSet(FontFactory.UBUNTU, 0, 0)) {
        textGLListener.setTech(-400, -30, 0f, -1000, 0);
        window.display();
        sleep();

        textGLListener.setTech(-400, -30, 0,   -380, 0);
        window.display();
        sleep();

        textGLListener.setTech(-400, -20, 0,    -80, 0);
        window.display();
        sleep();
    }

    if(textGLListener.setFontSet(FontFactory.JAVA, 0, 0)) {
        textGLListener.setTech(-400, -30, 0f, -1000, 0);
        window.display();
        sleep();

        textGLListener.setTech(-400, -30, 0,   -380, 0);
        window.display();
        sleep();

        textGLListener.setTech(-400, -20, 0,    -80, 0);
        window.display();
        sleep();
    }

    destroyWindow(window);
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:49,代码来源:TestTextRendererNEWT01.java

示例15: main

import com.jogamp.opengl.GLCapabilities; //导入方法依赖的package包/类
public static void main(final String[] args) {
    int width = 800, height = 400;
    int x = 10, y = 10;

    boolean forceES2 = false;
    boolean forceES3 = false;
    boolean forceGL3 = false;
    boolean forceGLDef = false;

  
    System.err.println("forceES2   "+forceES2);
    System.err.println("forceES3   "+forceES3);
    System.err.println("forceGL3   "+forceGL3);
    System.err.println("forceGLDef "+forceGLDef);
    System.err.println("Desired win size "+width+"x"+height);
    System.err.println("Desired win pos  "+x+"/"+y);
    System.err.println("Scene MSAA Samples "+SceneMSAASamples);
    System.err.println("Graph MSAA Mode "+GraphMSAAMode);
    System.err.println("Graph VBAA Mode "+GraphVBAAMode);
    System.err.println("Graph Auto Mode "+GraphAutoMode+" no-AA dpi threshold");

    final GLProfile glp;
    if(forceGLDef) {
        glp = GLProfile.getDefault();
    } else if(forceGL3) {
        glp = GLProfile.get(GLProfile.GL3);
    } else if(forceES3) {
        glp = GLProfile.get(GLProfile.GLES3);
    } else if(forceES2) {
        glp = GLProfile.get(GLProfile.GLES2);
    } else {
        glp = GLProfile.getGL2ES2();
    }
    System.err.println("GLProfile: "+glp);
    final GLCapabilities caps = new GLCapabilities(glp);
    caps.setAlphaBits(4);
    if( SceneMSAASamples > 0 ) {
        caps.setSampleBuffers(true);
        caps.setNumSamples(SceneMSAASamples);
    }
    System.out.println("Requested: " + caps);

    final int rmode;
    if( GraphVBAAMode ) {
        rmode = Region.VBAA_RENDERING_BIT;
    } else if( GraphMSAAMode ) {
        rmode = Region.MSAA_RENDERING_BIT;
    } else {
        rmode = 0;
    }

    final GLWindow window = GLWindow.create(caps);
    window.setPosition(x, y);
    window.setSize(width, height);
    window.setTitle("GraphUI Newt Demo: graph["+Region.getRenderModeString(rmode)+"], msaa "+SceneMSAASamples);
    window.setSurfaceScale(reqSurfacePixelScale);
    final float[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new float[2]);

    final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
                                                                 new GPUUISceneGLListener0A(rmode, DEBUG, TRACE);

    window.addGLEventListener(sceneGLListener);
    sceneGLListener.attachInputListenerTo(window);

    final Animator animator = new Animator();
    animator.setUpdateFPSFrames(60, System.err);
    animator.add(window);

    window.addWindowListener(new WindowAdapter() {
        public void windowDestroyed(final WindowEvent e) {
            animator.stop();
        }
    });

    window.setVisible(true);
    animator.start();
}
 
开发者ID:philjord,项目名称:3DTools,代码行数:78,代码来源:GPUUISceneNewtDemo.java


注:本文中的com.jogamp.opengl.GLCapabilities.setNumSamples方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。