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


Java Animator.setRunAsFastAsPossible方法代码示例

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


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

示例1: OpenGLViewer

import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
public OpenGLViewer (String title){
	super(title);
	panel = new GLJPanel();
	panel.addGLEventListener(this);
	panel.setPreferredSize(new Dimension(width, height));
	edu.stanford.rsl.conrad.cuda.MouseControl mouseControl = new edu.stanford.rsl.conrad.cuda.MouseControl(this);
	panel.addMouseMotionListener(mouseControl);
	panel.addMouseWheelListener(mouseControl);
	this.add(panel);
	pack();
	setVisible(true);
	boolean animate = true;
	if (animate) {
		animator = new Animator(panel);
		animator.setRunAsFastAsPossible(true);
		animator.start();
	}

	addWindowListener(new WindowAdapter()
	{
		public void windowClosing(WindowEvent e)
		{
			runExit();
		}
	});
}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:27,代码来源:OpenGLViewer.java

示例2: JCudaDriverVolumeRendererJOGL

import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
/**
 * Creates a new JCudaTextureSample that displays the given volume
 * data, which has the specified size.
 * 
 * @param volumeData The volume data
 * @param sizeX The size of the data set in X direction
 * @param sizeY The size of the data set in Y direction
 * @param sizeZ The size of the data set in Z direction
 */
public JCudaDriverVolumeRendererJOGL(GLCapabilities capabilities,
    byte volumeData[], int sizeX, int sizeY, int sizeZ)
{
    this.simpleInteraction = new SimpleInteraction();
    
    h_volume = volumeData;
    volumeSize.x = sizeX;
    volumeSize.y = sizeY;
    volumeSize.z = sizeZ;

    width = 800;
    height = 800;

    // Initialize the GL component 
    glComponent = new GLCanvas(capabilities);
    glComponent.addGLEventListener(this);
    
    // Initialize the mouse controls
    MouseControl mouseControl = simpleInteraction.getMouseControl();
    glComponent.addMouseMotionListener(mouseControl);
    glComponent.addMouseWheelListener(mouseControl);

    // Create the main frame
    frame = new JFrame("JCuda 3D texture volume rendering sample");
    frame.addWindowListener(new WindowAdapter()
    {
        @Override
        public void windowClosing(WindowEvent e)
        {
            runExit();
        }
    });
    frame.setLayout(new BorderLayout());
    glComponent.setPreferredSize(new Dimension(width, height));
    frame.add(glComponent, BorderLayout.CENTER);
    frame.add(createControlPanel(), BorderLayout.SOUTH);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    
    // Create and start the animator
    animator = new Animator(glComponent);
    animator.setRunAsFastAsPossible(true);
    animator.start();
}
 
开发者ID:jcuda,项目名称:jcuda-samples,代码行数:55,代码来源:JCudaDriverVolumeRendererJOGL.java

示例3: JCudaDriverSimpleJOGL

import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
/**
 * Creates a new JCudaDriverSimpleJOGL.
 * 
 * @param The JOGL OpenGL capabilities
 */
public JCudaDriverSimpleJOGL(GLCapabilities capabilities)
{
    simpleInteraction = new SimpleInteraction();
    
    // Initialize the GL component and the animator
    GLCanvas glComponent = new GLCanvas(capabilities);
    glComponent.setFocusable(true);
    glComponent.addGLEventListener(this);

    // Initialize the mouse and keyboard controls
    MouseControl mouseControl = simpleInteraction.getMouseControl();
    glComponent.addMouseMotionListener(mouseControl);
    glComponent.addMouseWheelListener(mouseControl);
    KeyboardControl keyboardControl = new KeyboardControl();
    glComponent.addKeyListener(keyboardControl);

    // Create the main frame 
    frame = new JFrame("JCuda / JOGL interaction sample");
    frame.addWindowListener(new WindowAdapter()
    {
        @Override
        public void windowClosing(WindowEvent e)
        {
            runExit();
        }
    });
    frame.setLayout(new BorderLayout());
    glComponent.setPreferredSize(new Dimension(800, 800));
    frame.add(glComponent, BorderLayout.CENTER);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    glComponent.requestFocus();

    // Create and start the animator
    animator = new Animator(glComponent);
    animator.setRunAsFastAsPossible(false);
    animator.start();
    
}
 
开发者ID:jcuda,项目名称:jcuda-samples,代码行数:46,代码来源:JCudaDriverSimpleJOGL.java

示例4: start

import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
public void start(){

		// Initialize the GL component 
		glComponentL = new GLJPanel();
		glComponentL.addGLEventListener(this);
		if (stereoMode)
		{
			glComponentR = new GLJPanel();
			glComponentR.addGLEventListener(this);
		}

		// Initialize the mouse controls
		MouseControl mouseControl = new MouseControl(this);
		glComponentL.addMouseMotionListener(mouseControl);
		glComponentL.addMouseWheelListener(mouseControl);


		frame.addWindowListener(new WindowAdapter()
		{
			public void windowClosing(WindowEvent e)
			{
				runExit();
			}
		});
		frame.setLayout(new BorderLayout());
		glComponentL.setPreferredSize(new Dimension(width, height));
		JPanel p = new JPanel(new GridLayout(1,1));
		p.add(glComponentL);
		if (stereoMode)
		{
			p.setLayout(new GridLayout(1,2));
			p.add(glComponentR);
		}
		frame.add(p, BorderLayout.CENTER);
		frame.add(createControlPanel(), BorderLayout.SOUTH);
		frame.pack();
		frame.setVisible(true);

		// Create and start the animator
		boolean animate = true;
		if (animate) {
			animatorL = new Animator(glComponentL);
			animatorL.setRunAsFastAsPossible(true);
			animatorL.start();
			if (stereoMode)
			{
				animatorR = new Animator(glComponentR);
				animatorR.setRunAsFastAsPossible(true);
				animatorR.start();
			}
		}
	}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:53,代码来源:JCudaDriverTextureSample.java

示例5: start

import com.jogamp.opengl.util.Animator; //导入方法依赖的package包/类
public void start(){

		// Initialize the GL component 
		glComponentL = new GLJPanel();
		glComponentL.addGLEventListener(this);
		if (stereoMode)
		{
			glComponentR = new GLJPanel();
			glComponentR.addGLEventListener(this);
		}

		// Initialize the mouse controls
		MouseControl mouseControl = new MouseControl(this);
		glComponentL.addMouseMotionListener(mouseControl);
		glComponentL.addMouseWheelListener(mouseControl);


		frame.addWindowListener(new WindowAdapter()
		{
			public void windowClosing(WindowEvent e)
			{
				runExit();
			}
		});
		frame.setLayout(new BorderLayout());
		glComponentL.setPreferredSize(new Dimension(width, height));
		JPanel p = new JPanel(new GridLayout(1,1));
		p.add(glComponentL);
		if (stereoMode)
		{
			p.setLayout(new GridLayout(1,2));
			p.add(glComponentR);
		}
		frame.add(p, BorderLayout.CENTER);
		frame.add(this.createControlPanel(), BorderLayout.SOUTH);
		frame.pack();
		frame.setVisible(true);

		// Create and start the animator
		boolean animate = true;
		if (animate) {
			animatorL = new Animator(glComponentL);
			animatorL.setRunAsFastAsPossible(true);
			animatorL.start();
			if (stereoMode)
			{
				animatorR = new Animator(glComponentR);
				animatorR.setRunAsFastAsPossible(true);
				animatorR.start();
			}
		}
	}
 
开发者ID:akmaier,项目名称:CONRAD,代码行数:53,代码来源:OpenCLTextureRendering.java

示例6: initGL

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

示例7: initGL

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

示例8: initGL

import com.jogamp.opengl.util.Animator; //导入方法依赖的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.util.Animator.setRunAsFastAsPossible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。