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


Java GLProfile类代码示例

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


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

示例1: main

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public static void main(String[] args) {
    GLProfile glp = GLProfile.get("GL3");

    GLCapabilities caps = new GLCapabilities(glp);

    GLWindow glWindow = GLWindow.create(caps);
    glWindow.setSize(800, 600);
    glWindow.setVisible(true);

    glWindow.addWindowListener(new WindowAdapter() {
        public void windowDestroyNotify(WindowEvent e) {
            System.exit(0);
        }
    });

    FPSAnimator animator = new FPSAnimator(glWindow, 60);
    animator.start();
}
 
开发者ID:bensmith87,项目名称:jogl_gradle,代码行数:19,代码来源:Main.java

示例2: startNewWindows

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public void startNewWindows() {

	      //getting the capabilities object of GL2 profile
	      final GLProfile profile = GLProfile.get( GLProfile.GL2 );
	      GLCapabilities capabilities = new GLCapabilities(profile);

	      // The canvas
	      final GLCanvas glcanvas = new GLCanvas( capabilities );
	      triview = new Triangulation3DViewer(chip.getCanvas());
	      glcanvas.addGLEventListener( triview);
	      glcanvas.setSize( 800, 800 );

	      //creating frame
	      final JFrame frame = new JFrame (" triangulation 3D renderer");

	      //adding canvas to it
	      frame.getContentPane().add( glcanvas );
	      frame.setSize(frame.getContentPane().getPreferredSize() );
	      frame.setVisible( true );
	   }
 
开发者ID:SensorsINI,项目名称:jaer,代码行数:21,代码来源:trackerForJoints.java

示例3: isSupported

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
@Override
public boolean isSupported() {
	if (Utils.forceEngine != null && Utils.forceEngine != "gpu")
		return false;
	if (Utils.headlessOverride)
		return false;
	boolean available = false;
	boolean errored = false;
	try {
		available = GLProfile.isAvailable(GLProfile.GL2ES2);
	} catch (Exception ex) {
		errored = true;
		System.err.println("OpenGL Error: "+ex.getMessage());
	}
	if (!available && !errored) {
		System.err.println(GLProfile.glAvailabilityToString());
	}
	return available;
}
 
开发者ID:XDrake99,项目名称:WarpPI,代码行数:20,代码来源:GPUEngine.java

示例4: main

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public static void main(String[] args) {
	// getting the capabilities object of GL2 profile
	final GLProfile profile = GLProfile.get(GLProfile.GL2);
	GLCapabilities glc = new GLCapabilities(profile);
	final GLCanvas glCanvas = new GLCanvas(glc);

	GameIntro b = new GameIntro();
	glCanvas.addGLEventListener(b);
	glCanvas.setSize(1300, 800);
	// creating frame
	final JFrame frame = new JFrame("Welcome to Heavy Evil");
	// adding canvas to it
	frame.getContentPane().add(glCanvas);
	frame.setSize(frame.getContentPane().getPreferredSize());
	frame.setVisible(true);

	final FPSAnimator animator = new FPSAnimator(glCanvas, 120, true);
	animator.start();
	
	glCanvas.isDoubleBuffered();

}
 
开发者ID:GettingNifty,项目名称:Heavy-Evil,代码行数:23,代码来源:GameIntro.java

示例5: createGlContextDebugString

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
/**
 * Create a string with debug information about the given GL instance
 * 
 * @param glBase The GL instance
 * @return The string
 */
private String createGlContextDebugString(GL glBase)
{
    StringBuilder sb = new StringBuilder();
    sb.append("GLProfile: " + getGLProfile()).append("\n");
    
    sb.append("Availability:").append("\n");
    for (String profile : GLProfile.GL_PROFILE_LIST_ALL)
    {
        sb.append("  " + profile + " : " + 
            GLProfile.isAvailable(profile)).append("\n");
    }
    sb.append("Context information:\n" + 
        glBase.getContext().toString()).append("\n");
    return sb.toString();
}
 
开发者ID:javagl,项目名称:JglTF,代码行数:22,代码来源:GltfViewerJogl.java

示例6: GltfViewerJogl

import com.jogamp.opengl.GLProfile; //导入依赖的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

示例7: getProfile

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
/**
 * @return supported GL profile
 */
public static GLProfile getProfile() {
	GLProfile glp = null;
	if (GLProfile.isAvailable(GLProfile.GL3)) {
		Console.println("TDME::Proposing GL3");
		glp = GLProfile.get(GLProfile.GL3);
	} else
	if (GLProfile.isAvailable(GLProfile.GL2)) {
		Console.println("TDME::Proposing GL2");
		glp = GLProfile.get(GLProfile.GL2);
	} else
	if (GLProfile.isAvailable(GLProfile.GLES2)) {
		Console.println("TDME::Proposing GLES2");
		glp = GLProfile.get(GLProfile.GLES2);
	} else {
		Console.println("TDME::No suiting OpenGL profile available!");
		return null;
	}
	Console.println("TDME::Proposing " + glp + ", GL2 = " + glp.isGL2() + ", GLES2 = " + glp.isGLES2() + ", GL3 = " + glp.isGL3());
	return glp;
}
 
开发者ID:andreasdr,项目名称:tdme,代码行数:24,代码来源:Engine.java

示例8: GLRenderer

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
GLRenderer(WindowConfig wc, int width, int height, GLKamera cam, boolean pFullscreen, boolean pNoDecoration) {
	wconf = wc;
	aCam = cam;
	win = Window.createWindowFactory(wconf.isAWT());

	GLProfile glp = GLProfile.getDefault();
	GLCapabilities caps = new GLCapabilities(glp);

	caps.setHardwareAccelerated(true);
	caps.setDoubleBuffered(wconf.doubleBuffering);
	caps.setDepthBits(24);

	win.createWindow(caps, width, height);
	win.setFullscreen(pFullscreen);
	win.setDecoration(pNoDecoration);

	win.getAutoDrawable().addGLEventListener(this);
	animator = win.getAnimator();
	animator.start();
	animator.setUpdateFPSFrames(wconf.doubleBuffering ? 60:2000, null);
	win.startDisplay();
	currentLighting = !wconf.globalLighting;
	renderItemMap = new ConcurrentHashMap<GLTextureImpl, CopyOnWriteArrayList<DisplayItem>>(10);
	objectNameMap = new ConcurrentHashMap<Integer, GLObjekt>(100);
}
 
开发者ID:trent2,项目名称:bGLOOP,代码行数:26,代码来源:GLRenderer.java

示例9: takeScreenshot

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
private void takeScreenshot(GL gl) {
	GLProfile glp = GLProfile.getDefault();

	// take screenshot
	AWTGLReadBufferUtil screenshot = new AWTGLReadBufferUtil(glp, false);
	BufferedImage bi = screenshot.readPixelsToBufferedImage(gl, true);

	File f;
	if(screenshotFilename == null)
		f = new File(
			    wconf.screenshotPrefix + "-"
			  + getNextScreenshotNumber(wconf.screenshotFormat, wconf.screenshotPrefix)
			  + "." + wconf.screenshotFormat
			);
		else
			f = new File(screenshotFilename);

	try {
		ImageIO.write(bi, wconf.screenshotFormat, f);
		log.info("Screenshot taken and saved to " + f.getCanonicalPath());
	} catch (IOException e) {
		e.printStackTrace();
	}
}
 
开发者ID:trent2,项目名称:bGLOOP,代码行数:25,代码来源:GLRenderer.java

示例10: createDrawable

import com.jogamp.opengl.GLProfile; //导入依赖的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

示例11: main

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public static void main(String[] args) {

        Display display = NewtFactory.createDisplay(null);
        Screen screen = NewtFactory.createScreen(display, 0);
        GLProfile glProfile = GLProfile.get(GLProfile.GL3);
        GLCapabilities glCapabilities = new GLCapabilities(glProfile);
        glWindow = GLWindow.create(screen, glCapabilities);

        glWindow.setSize(1044, 768);
        glWindow.setPosition(100, 50);
        glWindow.setUndecorated(false);
        glWindow.setAlwaysOnTop(false);
        glWindow.setFullscreen(false);
        glWindow.setPointerVisible(true);
        glWindow.confinePointer(false);
        glWindow.setTitle("Tutorial 09 - Interpolation");
        glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
        glWindow.setVisible(true);

        Tutorial09 tutorial09 = new Tutorial09();
        glWindow.addGLEventListener(tutorial09);

        animator = new Animator(glWindow);
        animator.start();
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:26,代码来源:Tutorial09.java

示例12: main

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public static void main(String[] args) {

        Display display = NewtFactory.createDisplay(null);
        Screen screen = NewtFactory.createScreen(display, 0);
        GLProfile glProfile = GLProfile.get(GLProfile.GL3);
        GLCapabilities glCapabilities = new GLCapabilities(glProfile);
        glWindow = GLWindow.create(screen, glCapabilities);

        glWindow.setSize(1044, 768);
        glWindow.setPosition(100, 50);
        glWindow.setUndecorated(false);
        glWindow.setAlwaysOnTop(false);
        glWindow.setFullscreen(false);
        glWindow.setPointerVisible(true);
        glWindow.confinePointer(false);
        glWindow.setTitle("Tutorial 05 - Uniform Variables");
        glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
        glWindow.setVisible(true);

        Tutorial05 tutorial05 = new Tutorial05();
        glWindow.addGLEventListener(tutorial05);

        animator = new Animator(glWindow);
        animator.start();
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:26,代码来源:Tutorial05.java

示例13: main

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public static void main(String[] args) {

        Display display = NewtFactory.createDisplay(null);
        Screen screen = NewtFactory.createScreen(display, 0);
        GLProfile glProfile = GLProfile.get(GLProfile.GL3);
        GLCapabilities glCapabilities = new GLCapabilities(glProfile);
        glWindow = GLWindow.create(screen, glCapabilities);

        glWindow.setSize(1034, 768);
        glWindow.setPosition(100, 50);
        glWindow.setUndecorated(false);
        glWindow.setAlwaysOnTop(false);
        glWindow.setFullscreen(false);
        glWindow.setPointerVisible(true);
        glWindow.confinePointer(false);
        glWindow.setTitle("Tutorial 03 - First triangle");
        glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
        glWindow.setVisible(true);

        Tutorial03 tutorial03 = new Tutorial03();
        glWindow.addGLEventListener(tutorial03);

        animator = new Animator(glWindow);
        animator.start();
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:26,代码来源:Tutorial03.java

示例14: main

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public static void main(String[] args) {

        Display display = NewtFactory.createDisplay(null);
        Screen screen = NewtFactory.createScreen(display, 0);
        GLProfile glProfile = GLProfile.get(GLProfile.GL3);
        GLCapabilities glCapabilities = new GLCapabilities(glProfile);
        glWindow = GLWindow.create(screen, glCapabilities);

        glWindow.setSize(1044, 768);
        glWindow.setPosition(100, 50);
        glWindow.setUndecorated(false);
        glWindow.setAlwaysOnTop(false);
        glWindow.setFullscreen(false);
        glWindow.setPointerVisible(true);
        glWindow.confinePointer(false);
        glWindow.setTitle("Tutorial 08 - Scaling Transformation");
        glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
        glWindow.setVisible(true);

        Tutorial08 tutorial08 = new Tutorial08();
        glWindow.addGLEventListener(tutorial08);

        animator = new Animator(glWindow);
        animator.start();
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:26,代码来源:Tutorial08.java

示例15: main

import com.jogamp.opengl.GLProfile; //导入依赖的package包/类
public static void main(String[] args) {

        Display display = NewtFactory.createDisplay(null);
        Screen screen = NewtFactory.createScreen(display, 0);
        GLProfile glProfile = GLProfile.get(GLProfile.GL3);
        GLCapabilities glCapabilities = new GLCapabilities(glProfile);
        glWindow = GLWindow.create(screen, glCapabilities);

        glWindow.setSize(1044, 768);
        glWindow.setPosition(100, 50);
        glWindow.setUndecorated(false);
        glWindow.setAlwaysOnTop(false);
        glWindow.setFullscreen(false);
        glWindow.setPointerVisible(true);
        glWindow.confinePointer(false);
        glWindow.setTitle("Tutorial 04 - Shaders");
        glWindow.setContextCreationFlags(GLContext.CTX_OPTION_DEBUG);
        glWindow.setVisible(true);

        Tutorial04 tutorial04 = new Tutorial04();
        glWindow.addGLEventListener(tutorial04);

        animator = new Animator(glWindow);
        animator.start();
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:26,代码来源:Tutorial04.java


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