當前位置: 首頁>>代碼示例>>Java>>正文


Java GLEventListener類代碼示例

本文整理匯總了Java中javax.media.opengl.GLEventListener的典型用法代碼示例。如果您正苦於以下問題:Java GLEventListener類的具體用法?Java GLEventListener怎麽用?Java GLEventListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GLEventListener類屬於javax.media.opengl包,在下文中一共展示了GLEventListener類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: savePicture

import javax.media.opengl.GLEventListener; //導入依賴的package包/類
private void savePicture(String path, Component tc, GLEventListener canvas, int width, int height) {
>>>>>>> refs/remotes/origin/development
        if (path.contains(".png")) {
        } else {
            path = path + ".png";
        }

<<<<<<< HEAD
        int i = gl.glGetError();
=======
        
        if(filePath == null){
            //selection of folder wasn't approved, nothing happens
            return;
        }
>>>>>>> 7ce8ff9f35e26af83f0400dac86de86a7720aa2f
        
        savePicture(filePath, tc, canvas, width, height);
        
    }
 
開發者ID:Fidentis,項目名稱:Analyst,代碼行數:21,代碼來源:ResultExports.java

示例2: setCanvasProvider

import javax.media.opengl.GLEventListener; //導入依賴的package包/類
protected void setCanvasProvider(CanvasProvider canvasProvider) {
final GLCanvas              oldCanvas = getCanvas();
final GLEventListener glEventListener = getGlEventListener();
if(oldCanvas != null)
    oldCanvas.removeGLEventListener(glEventListener);
       this.canvasProvider = canvasProvider;
       if(canvasProvider != null){
           final GLCanvas                  canvas = canvasProvider.getCanvas();
           final GL                            gl = canvas.getGL();
           final Class<? extends GL> desiredClass = getGLClass();
           if(! desiredClass.isAssignableFrom(gl.getClass())){
       	throw new IllegalArgumentException(
       		"CanvasProvider gives a "+gl.getClass().getName()+
       		" but expected a GL instance of type "+desiredClass.getName());}
           canvas.addGLEventListener(glEventListener);
           }
   }
 
開發者ID:jtrfp,項目名稱:terminal-recall,代碼行數:18,代碼來源:CanvasBoundGLExecutor.java

示例3: exportVisualResults

import javax.media.opengl.GLEventListener; //導入依賴的package包/類
/**
     * Exports visual results to disk. Creates snapshot of given canvas
     * @param tc - GUI component which opens the dialog (usually active project)
     * @param canvas - canvas containing results to be saved
     * @param width - max width of the picture
     * @param height - max height of the picture
     */
    public void exportVisualResults(Component tc, GLEventListener canvas, int width, int height){        
        String filePath = DialogUtils.instance().openDialogueSaveFile(tc, "PNG images", FILE_EXTENSIONS_PIC, false);
<<<<<<< HEAD

        if (filePath == null) {
            //selection of folder wasn't approved, nothing happens
            return;
        }

        savePicture(filePath, tc, canvas, width, height);

<<<<<<< HEAD
    }
 
開發者ID:Fidentis,項目名稱:Analyst,代碼行數:21,代碼來源:ResultExports.java

示例4: init

import javax.media.opengl.GLEventListener; //導入依賴的package包/類
private void init(){
	this.wd.initDrawable(this);
	this.setView(new BasicView());
	this.setInputHandler(new AWTInputHandler());
	this.addGLEventListener((GLEventListener) wd);
       this.setMinimumSize(new Dimension());
}
 
開發者ID:vcucek,項目名稱:WildPlot,代碼行數:8,代碼來源:WindowGLCanvas.java

示例5: NeonNewtWindow

import javax.media.opengl.GLEventListener; //導入依賴的package包/類
/**
 * Constructor for this class. Sets up the window and enables common
 * features like anti-aliasing and hardware acceleration.
 * 
 * @param forceGL2ES2
 *            Force GL2ES2 support (default on), currently Unused
 * @param inputHandler
 *            A predefined InputHandler that is added as event handler for
 *            input events.
 * @param glEventListener
 *            A predefined GLEventListener that is added as event handler
 *            for openGL events.
 * @param width
 *            The initial window width.
 * @param height
 *            The initial window height.
 * @param windowTitle
 *            The window title.
 */
public NeonNewtWindow(boolean forceGL2ES2, InputHandler inputHandler, final GLEventListener glEventListener,
        int width, int height, String windowTitle) {

    GLProfile.initSingleton();

    final GLProfile glp;
    glp = GLProfile.get(GLProfile.GL3);

    // Set up the GL context
    final GLCapabilities caps = new GLCapabilities(glp);
    caps.setBackgroundOpaque(true);
    caps.setHardwareAccelerated(true);
    caps.setDoubleBuffered(true);

    // Add Anti-Aliasing
    caps.setSampleBuffers(true);
    caps.setAlphaBits(4);
    caps.setNumSamples(4);

    GLWindow window = GLWindow.create(caps);

    window.addGLEventListener(glEventListener);
    window.addWindowListener(new QuitListener());
    window.setAutoSwapBufferMode(true);
    window.setSize(width, height);
    window.setTitle(windowTitle);
    window.addMouseListener(inputHandler);
    window.addKeyListener(inputHandler);

    Animator animator = new Animator();
    animator.add(window);
    animator.start();
    animator.setUpdateFPSFrames(60, null);

    window.setVisible(true);

}
 
開發者ID:NLeSC,項目名稱:Neon,代碼行數:57,代碼來源:NeonNewtWindow.java

示例6: getGlEventListener

import javax.media.opengl.GLEventListener; //導入依賴的package包/類
protected GLEventListener getGlEventListener() {
if(glEventListener == null)
    glEventListener = new DefaultGLEventListener();
       return glEventListener;
   }
 
開發者ID:jtrfp,項目名稱:terminal-recall,代碼行數:6,代碼來源:CanvasBoundGLExecutor.java

示例7: setGlEventListener

import javax.media.opengl.GLEventListener; //導入依賴的package包/類
protected void setGlEventListener(GLEventListener glEventListener) {
    this.glEventListener = glEventListener;
}
 
開發者ID:jtrfp,項目名稱:terminal-recall,代碼行數:4,代碼來源:CanvasBoundGLExecutor.java


注:本文中的javax.media.opengl.GLEventListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。