Skip to content

Commit

Permalink
Always assume MacOS to be sRGB capable.
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Jan 18, 2022
1 parent ba3f594 commit f27b663
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
import com.jme3.shader.*;
import com.jme3.shader.Shader.ShaderSource;
import com.jme3.shader.Shader.ShaderType;
import com.jme3.system.JmeSystem;
import com.jme3.system.Platform;
import com.jme3.texture.FrameBuffer;
import com.jme3.texture.FrameBuffer.RenderBuffer;
import com.jme3.texture.Image;
Expand Down Expand Up @@ -3268,9 +3270,12 @@ public void setMainFrameBufferSrgb(boolean enableSrgb) {
setFrameBuffer(null);

if (enableSrgb) {
if (!getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT)) {
logger.warning("Driver claims that default framebuffer "
+ "is not sRGB capable. Enabling anyway.");
if (
// Workaround: getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT) causes error 1280 (invalid enum) on macos
JmeSystem.getPlatform().getOs() != Platform.Os.MacOS
&& !getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT)
) {
logger.warning("Driver claims that default framebuffer " + "is not sRGB capable. Enabling anyway.");
}

gl.glEnable(GLExt.GL_FRAMEBUFFER_SRGB_EXT);
Expand Down

0 comments on commit f27b663

Please sign in to comment.