Kirill: Better fix for mac issue
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7448 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
8ace54916f
commit
8406f0058e
@ -179,6 +179,7 @@ public class RenderContext {
|
||||
boundFBO = 0;
|
||||
boundRB = 0;
|
||||
boundDrawBuf = -1;
|
||||
boundReadBuf = -1;
|
||||
boundElementArrayVBO = 0;
|
||||
boundVertexArray = 0;
|
||||
boundArrayVBO = 0;
|
||||
|
@ -202,14 +202,14 @@ public class LwjglRenderer implements Renderer {
|
||||
|
||||
// Fix issue in TestRenderToMemory when GL_FRONT is the main
|
||||
// buffer being used.
|
||||
// initialDrawBuf = glGetInteger(GL_DRAW_BUFFER);
|
||||
// initialReadBuf = glGetInteger(GL_READ_BUFFER);
|
||||
initialDrawBuf = glGetInteger(GL_DRAW_BUFFER);
|
||||
initialReadBuf = glGetInteger(GL_READ_BUFFER);
|
||||
|
||||
// XXX: This has to be GL_BACK for canvas on Mac
|
||||
// Since initialDrawBuf is GL_FRONT for pbuffer, gotta
|
||||
// change this value later on ...
|
||||
initialDrawBuf = GL_BACK;
|
||||
initialReadBuf = GL_BACK;
|
||||
// initialDrawBuf = GL_BACK;
|
||||
// initialReadBuf = GL_BACK;
|
||||
|
||||
int spaceIdx = versionStr.indexOf(" ");
|
||||
if (spaceIdx >= 1) {
|
||||
@ -418,14 +418,15 @@ public class LwjglRenderer implements Renderer {
|
||||
context.reset();
|
||||
boundShader = null;
|
||||
lastFb = null;
|
||||
|
||||
initialDrawBuf = glGetInteger(GL_DRAW_BUFFER);
|
||||
initialReadBuf = glGetInteger(GL_READ_BUFFER);
|
||||
}
|
||||
|
||||
public void resetGLObjects() {
|
||||
objManager.resetObjects();
|
||||
statistics.clearMemory();
|
||||
context.reset();
|
||||
boundShader = null;
|
||||
lastFb = null;
|
||||
invalidateState();
|
||||
}
|
||||
|
||||
public void cleanup() {
|
||||
|
@ -35,6 +35,8 @@ package com.jme3.system.lwjgl;
|
||||
import com.jme3.system.AppSettings;
|
||||
import com.jme3.system.JmeCanvasContext;
|
||||
import com.jme3.system.JmeContext.Type;
|
||||
import com.jme3.system.JmeSystem;
|
||||
import com.jme3.system.JmeSystem.Platform;
|
||||
import java.awt.Canvas;
|
||||
import java.util.concurrent.BrokenBarrierException;
|
||||
import java.util.concurrent.CyclicBarrier;
|
||||
@ -281,7 +283,11 @@ public class LwjglCanvas extends LwjglAbstractDisplay implements JmeCanvasContex
|
||||
try {
|
||||
// NOTE: On Windows XP, not calling setParent(null)
|
||||
// freezes the application.
|
||||
// On Mac it freezes the application.
|
||||
if (JmeSystem.getPlatform() == Platform.Windows32
|
||||
|| JmeSystem.getPlatform() == Platform.Windows64){
|
||||
Display.setParent(null);
|
||||
}
|
||||
} catch (LWJGLException ex) {
|
||||
logger.log(Level.SEVERE, "Encountered exception when setting parent to null", ex);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user