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


Java GLProfile.getDefault方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: Shoot

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

示例5: createGLWindow

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
public static GLWindow createGLWindow() {
    GLProfile profile = GLProfile.getDefault();
    GLCapabilities capabilities = getGLCapabilities(profile);
    GLWindow window = GLWindow.create(capabilities);

    // GUI events can lead to context destruction and invalidation of GL objects and state
    window.setSharedAutoDrawable(getSharedDrawable(profile, capabilities));

    return window;
}
 
开发者ID:Helioviewer-Project,项目名称:JHelioviewer-SWHV,代码行数:11,代码来源:GLHelper.java

示例6: getGlProfile

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
private GLProfile getGlProfile() {
    switch (profile) {
        case ES:
            switch (major) {
                case 1:
                    return GLProfile.get(GLProfile.GL2ES1);
                case 2:
                    return GLProfile.get(GLProfile.GL2ES2);
                case 3:
                    return GLProfile.get(GLProfile.GL4ES3);
                default:
                    return GLProfile.getDefault();
            }
        case CORE:
            switch (major) {
                case 1:
                    return GLProfile.get(GLProfile.GL2);
                case 2:
                    return GLProfile.get(GLProfile.GL2);
                case 3:
                    if (profile == Profile.COMPATIBILITY) {
                        return GLProfile.get(GLProfile.GL3bc);
                    } else {
                        return GLProfile.get(GLProfile.GL3);
                    }
                case 4:
                    if (profile == Profile.COMPATIBILITY) {
                        return GLProfile.get(GLProfile.GL4bc);
                    } else {
                        return GLProfile.get(GLProfile.GL4);
                    }
            }
    }
    return GLProfile.getDefault();
}
 
开发者ID:java-opengl-labs,项目名称:jogl-samples,代码行数:36,代码来源:Test.java

示例7: main

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
public static void main(String[] args)
	{
		
		System.setProperty("sun.awt.noerasebackground", "true");
		
		SimpleScene scene = new SimpleScene();

		Button button = new Button(20, 20, 50, 20, "123456");
		button.setFontSize(60);
		MoveablePanel panel = new MoveablePanel(10, 10, 300, 300);
		panel.setName("Yellow Panel");
		panel.setBackground(Color.YELLOW);
		panel.addChild(button);
//		//Label label = new Label("Test Label", 100, 100);
//		//panel.addChild(label);
//		//CheckBox cb = new CheckBox(250, 100);
//		//ComboBox cb = new ComboBox(250, 100);
//		//panel.addChild(cb);
		scene.addChild(panel);
		
		GLProfile glp = GLProfile.getDefault();
		GLCapabilities caps = new GLCapabilities(glp);
		GLCanvas canvas = new GLCanvas(caps);
		canvas.addGLEventListener(scene);
		
		JFrame frame = new JFrame("A Window");
		frame.setSize(700, 700);
		frame.setVisible(true);
		frame.add(canvas);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		canvas.addMouseListener(scene);
		canvas.addMouseMotionListener(scene);
		
		FPSAnimator animator = new FPSAnimator(canvas, 60);
		animator.start();
		
	}
 
开发者ID:carterg,项目名称:GLGUI,代码行数:38,代码来源:Test.java

示例8: KashikiGLCanvas

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
public KashikiGLCanvas() {
  super(new GLCapabilities(GLProfile.getDefault()));
  setFocusable(true);
  setFocusTraversalKeysEnabled(false);
  addKeyListener(new DocumentKeyListener());
  addKeyListener(new LoggingKeyListener());
  addGLEventListener(new KashikiFrame());
  new FPSAnimator(this, 30).start();
}
 
开发者ID:mitoma,项目名称:kashiki,代码行数:10,代码来源:KashikiGLCanvas.java

示例9: GlCapabilities

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
public GlCapabilities() {
  super(GLProfile.getDefault());
}
 
开发者ID:MinesJTK,项目名称:jtk,代码行数:4,代码来源:GlCapabilities.java

示例10: main

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

		boolean fullScreen = args.length > 0 && args[0].equals("-fullscreen");
		GLProfile glp = GLProfile.getDefault();
		GLCapabilities caps = new GLCapabilities(glp.get(GLProfile.GL3));
		caps.setAlphaBits(8);
		final StarchartCanvas canvas = new StarchartCanvas(caps);
		FPSAnimator animator = new FPSAnimator(canvas, 120);

		ToolBar bar = new ToolBar();

		final JFrame frame = new JFrame("Java Planetarium");
		frame.setLayout(new BorderLayout());

		JPanel panel = new JPanel(new BorderLayout());
		panel.add(canvas);

		TimeMenu tm = new TimeMenu();
		tm.setVisible(false);

		if(fullScreen){
			frame.setExtendedState(JFrame.MAXIMIZED_BOTH);
			frame.setUndecorated(true);
		}

		frame.setContentPane(panel);
		frame.add(bar, BorderLayout.SOUTH);
		//frame.pack();

		frame.setSize(width, height);
		frame.setVisible(true);
		animator.start();




		frame.addWindowListener(new WindowAdapter(){
			public void windowClosing(WindowEvent e){
				canvas.destroy();
				System.exit(0);
			}
		});
	}
 
开发者ID:Haurentziu,项目名称:Java-Planetarium,代码行数:44,代码来源:Main.java

示例11: main

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
public static void main(String[] args){
		try {
			UIManager.setLookAndFeel("com.jtattoo.plaf.hifi.HiFiLookAndFeel");
			//UIManager.getLookAndFeelDefaults().put("defaultFont", new Font("Arial", Font.BOLD, 14));

			//UIManager.setLookAndFeel("com.jtattoo.plaf.noire.NoireLookAndFeel");
		}
		catch (Exception ex){
			ex.printStackTrace();
		}

		fullScreen = args.length > 0 && args[0].equals("-fullscreen");
		Observer observer = new Observer();

		SplashDialog splash = new SplashDialog();
		splash.setVisible(true);

		GLProfile glp = GLProfile.getDefault();
		GLCapabilities caps = new GLCapabilities(glp.get(GLProfile.GL3));
		caps.setAlphaBits(8);
		canvas = new StarchartCanvas(caps, observer);

		FPSAnimator animator = new FPSAnimator(canvas, 120);
		ToolBar bar = new ToolBar(observer);

		frame.setLayout(new BorderLayout());

		JPanel panel = new JPanel(new BorderLayout());
		panel.add(canvas);

		timeMenu = new TimeMenu(frame, observer);
		timeMenu.setVisible(false);

		locationMenu = new LocationMenu(frame, observer);
		locationMenu.setVisible(false);

		/*satelliteMenu = new SatelliteMenu();
		satelliteMenu.setVisible(true);
**/
		final Toolkit toolkit = Toolkit.getDefaultToolkit();
		final Dimension screenSize = toolkit.getScreenSize();
		final int x = (screenSize.width - DEFAULT_WIDTH) / 2;
		final int y = (screenSize.height - DEFAULT_HEIGHT) / 2;
		frame.setLocation(x, y);

		setSize();

		panel.add(bar, BorderLayout.SOUTH);
		frame.setContentPane(panel);

		animator.start();
		frame.setVisible(true);
		splash.close();

		frame.addWindowListener(new WindowAdapter(){
			public void windowClosing(WindowEvent e){
				exit();
			}
		});
	}
 
开发者ID:Haurentziu,项目名称:Java-Planetarium,代码行数:61,代码来源:Main.java

示例12: initGL

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
private void initGL() {
    GLProfile gLProfile = GLProfile.getDefault();

    GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

    glWindow = GLWindow.create(gLCapabilities);

    newtCanvasAWT = new NewtCanvasAWT(glWindow);

    glWindow.setSize(imageWidth, imageHeight);

    glWindow.addGLEventListener(this);

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

示例13: initGL

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
private void initGL() {

        GLProfile gLProfile = GLProfile.getDefault();

        GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

        glWindow = GLWindow.create(gLCapabilities);

        newtCanvasAWT = new NewtCanvasAWT(glWindow);

        glWindow.setSize(imageWidth, imageHeight);

        glWindow.addGLEventListener(this);

        animator = new Animator(glWindow);
        animator.setRunAsFastAsPossible(true);
        animator.start();

        Vec3 cameraPos = new Vec3(0f, 0f, -3f);
        Quat quat = new Quat(0f, 0f, 0f, 1f);

        viewPole = new ViewPole(new ViewData(cameraPos, quat, 10f), new ViewScale(90f/250f, 0.2f));
    }
 
开发者ID:java-opengl-labs,项目名称:ogl-dev,代码行数:24,代码来源:Tutorial15.java

示例14: initGL

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
private void initGL() {

        GLProfile gLProfile = GLProfile.getDefault();

        GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

        glWindow = GLWindow.create(gLCapabilities);

        newtCanvasAWT = new NewtCanvasAWT(glWindow);

        glWindow.setSize(imageWidth, imageHeight);

        glWindow.addGLEventListener(this);
        glWindow.addMouseListener(viewPole);
        glWindow.addKeyListener(new KeyListener());

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

示例15: initGL

import com.jogamp.opengl.GLProfile; //导入方法依赖的package包/类
private void initGL() {

        GLProfile gLProfile = GLProfile.getDefault();

        GLCapabilities gLCapabilities = new GLCapabilities(gLProfile);

        glWindow = GLWindow.create(gLCapabilities);

        newtCanvasAWT = new NewtCanvasAWT(glWindow);

        glWindow.setSize(imageWidth, imageHeight);

        glWindow.addGLEventListener(this);

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


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