com.jme3.renderer.Renderer.resetGLObjects()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(99)

本文整理了Java中com.jme3.renderer.Renderer.resetGLObjects方法的一些代码示例,展示了Renderer.resetGLObjects的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Renderer.resetGLObjects方法的具体详情如下:
包路径:com.jme3.renderer.Renderer
类名称:Renderer
方法名:resetGLObjects

Renderer.resetGLObjects介绍

[英]Resets all previously used NativeObject on this Renderer. The state of the native objects is reset in such way, that using them again will cause the renderer to reupload them. Call this method when you know the GL context is going to shutdown.
[中]重置此渲染器上以前使用的所有NativeObject。本机对象的状态被重置,再次使用它们将导致渲染器重新加载它们。当您知道GL上下文将要关闭时,调用此方法。

代码示例

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

/**
 * Makes sure the pbuffer is available and ready for use
 */
protected void makePbufferAvailable() throws LWJGLException{
  if (pbuffer != null && pbuffer.isBufferLost()){
    logger.log(Level.WARNING, "PBuffer was lost!");
    pbuffer.destroy();
    pbuffer = null;
  }
  
  if (pbuffer == null) {
    pbuffer = new Pbuffer(1, 1, acquirePixelFormat(true), null);
    pbuffer.makeCurrent();
    logger.log(Level.FINE, "OGL: Pbuffer has been created");
    
    // Any created objects are no longer valid
    if (!runningFirstTime){
      renderer.resetGLObjects();
    }
  }
  
  pbuffer.makeCurrent();
  if (!pbuffer.isCurrent()){
    throw new LWJGLException("Pbuffer cannot be made current");
  }
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

||pixelFormat.getStencilBits() != pf.getStencilBits()
        ||pixelFormat.getSamples() != pf.getSamples())){
renderer.resetGLObjects();
Display.destroy();
pixelFormatChanged = true;

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

/**
 * Makes sure the pbuffer is available and ready for use
 */
protected void makePbufferAvailable() throws LWJGLException{
  if (pbuffer != null && pbuffer.isBufferLost()){
    logger.log(Level.WARNING, "PBuffer was lost!");
    pbuffer.destroy();
    pbuffer = null;
  }
  
  if (pbuffer == null) {
    pbuffer = new Pbuffer(1, 1, acquirePixelFormat(true), null);
    pbuffer.makeCurrent();
    logger.log(Level.FINE, "OGL: Pbuffer has been created");
    
    // Any created objects are no longer valid
    if (!runningFirstTime){
      renderer.resetGLObjects();
    }
  }
  
  pbuffer.makeCurrent();
  if (!pbuffer.isCurrent()){
    throw new LWJGLException("Pbuffer cannot be made current");
  }
}

代码示例来源:origin: us.ihmc.thirdparty.jme/jme3-lwjgl

||pixelFormat.getStencilBits() != pf.getStencilBits()
        ||pixelFormat.getSamples() != pf.getSamples())){
renderer.resetGLObjects();
Display.destroy();
pixelFormatChanged = true;

相关文章