Skip to content

Commit a3056ea

Browse files
authored
Update GLRenderer.java
1 parent 389d91a commit a3056ea

File tree

1 file changed

+20
-28
lines changed

1 file changed

+20
-28
lines changed

jme3-core/src/main/java/com/jme3/renderer/opengl/GLRenderer.java

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2024 jMonkeyEngine
2+
* Copyright (c) 2009-2025 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -129,7 +129,7 @@ public GLRenderer(GL gl, GLExt glext, GLFbo glfbo) {
129129
this.glext = glext;
130130
this.texUtil = new TextureUtil(gl, gl2, glext);
131131
}
132-
132+
133133
/**
134134
* Enable/Disable default automatic generation of mipmaps for framebuffers
135135
* @param v Default is true
@@ -159,14 +159,14 @@ public void pushDebugGroup(String name) {
159159
}
160160
}
161161

162-
162+
163163

164164
@Override
165165
public Statistics getStatistics() {
166166
return statistics;
167167
}
168168

169-
@Override
169+
@Override
170170
public EnumSet<Caps> getCaps() {
171171
return caps;
172172
}
@@ -223,7 +223,7 @@ private void loadCapabilitiesES() {
223223
String version = gl.glGetString(GL.GL_VERSION);
224224
int oglVer = extractVersion(version);
225225
if (isWebGL(version)) {
226-
caps.add(Caps.WebGL);
226+
caps.add(Caps.WebGL);
227227
}
228228
caps.add(Caps.GLSL100);
229229
caps.add(Caps.OpenGLES20);
@@ -709,7 +709,7 @@ public void initialize() {
709709
}else if(gl instanceof GLES_30){
710710
((GLES_30)gl).glGenVertexArrays(intBuf16);
711711
int vaoId = intBuf16.get(0);
712-
((GLES_30)gl).glBindVertexArray(vaoId);
712+
((GLES_30)gl).glBindVertexArray(vaoId);
713713
} else{
714714
throw new UnsupportedOperationException("Core profile not supported");
715715
}
@@ -1288,7 +1288,7 @@ private boolean isValidNumber(FloatBuffer fb) {
12881288
}
12891289
return true;
12901290
}
1291-
1291+
12921292
private boolean isValidNumber(Vector2f v) {
12931293
return isValidNumber(v.x) && isValidNumber(v.y);
12941294
}
@@ -1453,7 +1453,7 @@ protected void updateShaderBufferBlock(final Shader shader, final ShaderBufferBl
14531453

14541454
final BufferObject bufferObject = bufferBlock.getBufferObject();
14551455
final BufferType bufferType = bufferBlock.getType();
1456-
1456+
14571457

14581458
if (bufferObject.isUpdateNeeded()) {
14591459
if (bufferType == BufferType.ShaderStorageBufferObject) {
@@ -1483,7 +1483,7 @@ protected void updateShaderBufferBlock(final Shader shader, final ShaderBufferBl
14831483
}
14841484
if (bufferBlock.getLocation() != NativeObject.INVALID_ID) {
14851485
gl3.glUniformBlockBinding(shaderId, bufferBlock.getLocation(), bindingPoint);
1486-
}
1486+
}
14871487
}
14881488
break;
14891489
}
@@ -1613,7 +1613,7 @@ public void updateShaderSourceData(ShaderSource source) {
16131613
}
16141614

16151615
}
1616-
1616+
16171617
if (linearizeSrgbImages) {
16181618
stringBuf.append("#define SRGB 1\n");
16191619
}
@@ -1746,7 +1746,7 @@ public void updateShaderData(Shader shader) {
17461746
public void setShader(Shader shader) {
17471747
if (shader == null) {
17481748
throw new IllegalArgumentException("Shader cannot be null");
1749-
} else {
1749+
} else {
17501750
if (shader.isUpdateNeeded()) {
17511751
updateShaderData(shader);
17521752
}
@@ -2126,12 +2126,12 @@ public void setReadDrawBuffers(FrameBuffer fb) {
21262126
final int MRT_OFF = 100;
21272127

21282128
if (fb != null) {
2129-
2129+
21302130
if (fb.getNumColorBuffers() == 0) {
21312131
// make sure to select NONE as draw buf
21322132
// no color buffer attached.
2133-
gl2.glDrawBuffer(GL.GL_NONE);
2134-
gl2.glReadBuffer(GL.GL_NONE);
2133+
gl2.glDrawBuffer(GL.GL_NONE);
2134+
gl2.glReadBuffer(GL.GL_NONE);
21352135
} else {
21362136
if (fb.getNumColorBuffers() > limits.get(Limits.FrameBufferAttachments)) {
21372137
throw new RendererException("Framebuffer has more color "
@@ -2243,7 +2243,7 @@ private void readFrameBufferWithGLFormat(FrameBuffer fb, ByteBuffer byteBuf, int
22432243
}
22442244

22452245
setFrameBuffer(fb);
2246-
2246+
22472247

22482248
} else {
22492249
setFrameBuffer(null);
@@ -2722,7 +2722,7 @@ public void setTexture(int unit, Texture tex) throws TextureUnitException {
27222722
if (unit < 0 || unit >= RenderContext.maxTextureUnits) {
27232723
throw new TextureUnitException();
27242724
}
2725-
2725+
27262726
Image image = tex.getImage();
27272727
if (image.isUpdateNeeded() || (image.isGeneratedMipmapsRequired() && !image.isMipmapsGenerated())) {
27282728
// Check NPOT requirements
@@ -2753,7 +2753,7 @@ public void setTexture(int unit, Texture tex) throws TextureUnitException {
27532753
if (tex.getName() != null) glext.glObjectLabel(GL.GL_TEXTURE, tex.getImage().getId(), tex.getName());
27542754
}
27552755
}
2756-
2756+
27572757
@Override
27582758
public void setTextureImage(int unit, TextureImage tex) throws TextureUnitException {
27592759
if (unit < 0 || unit >= RenderContext.maxTextureUnits) {
@@ -2766,7 +2766,7 @@ public void setTextureImage(int unit, TextureImage tex) throws TextureUnitExcept
27662766
tex.bindImage(gl4, texUtil, unit);
27672767
}
27682768
}
2769-
2769+
27702770
@Override
27712771
public void setUniformBufferObject(int bindingPoint, BufferObject bufferObject) {
27722772
if (bufferObject.isUpdateNeeded()) {
@@ -3490,19 +3490,11 @@ public void setMainFrameBufferSrgb(boolean enableSrgb) {
34903490
setFrameBuffer(null);
34913491

34923492
if (enableSrgb) {
3493-
if (
3494-
// Workaround: getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT) causes error 1280 (invalid enum) on macos
3495-
JmeSystem.getPlatform().getOs() != Platform.Os.MacOS
3496-
&& !getBoolean(GLExt.GL_FRAMEBUFFER_SRGB_CAPABLE_EXT)
3497-
) {
3498-
logger.warning("Driver claims that default framebuffer " + "is not sRGB capable. Enabling anyway.");
3499-
}
3500-
35013493
gl.glEnable(GLExt.GL_FRAMEBUFFER_SRGB_EXT);
3502-
3503-
logger.log(Level.FINER, "SRGB FrameBuffer enabled (Gamma Correction)");
3494+
logger.log(Level.INFO, "SRGB FrameBuffer enabled (Gamma Correction)");
35043495
} else {
35053496
gl.glDisable(GLExt.GL_FRAMEBUFFER_SRGB_EXT);
3497+
logger.log(Level.INFO, "SRGB FrameBuffer disabled (Gamma Correction)");
35063498
}
35073499
}
35083500

0 commit comments

Comments
 (0)