44import java .util .LinkedHashMap ;
55import java .util .List ;
66import java .util .Map ;
7-
87import com .jogamp .opengl .GL4 ;
98
109/**
@@ -46,7 +45,8 @@ public boolean hasColorAttachment() {
4645 return backingTextures .size () > 0 ;
4746 }
4847
49- private void addFloatBufferInternal (final GL4 gl , final String name , final int channelCount , final int channelDepth ) {
48+ private void addFloatBufferInternal (final GL4 gl , final String name , final int channelCount ,
49+ final int channelDepth ) {
5050 if (!initialized ) {
5151 return ;
5252 }
@@ -76,14 +76,15 @@ public void addFloatRGBuffer(final GL4 gl, final String name, final int channelD
7676 }
7777
7878 public void addFloatRGBBuffer (final GL4 gl , final String name , final int channelDepth ) {
79- addFloatBufferInternal (gl , name , 3 , channelDepth );
79+ addFloatBufferInternal (gl , name , 3 , channelDepth );
8080 }
8181
8282 public void addFloatRGBABuffer (final GL4 gl , final String name , final int channelDepth ) {
83- addFloatBufferInternal (gl , name , 4 , channelDepth );
83+ addFloatBufferInternal (gl , name , 4 , channelDepth );
8484 }
8585
86- private void addUnsignedByteBufferInternal (final GL4 gl , final String name , final int channelCount , final int channelDepth ) {
86+ private void addUnsignedByteBufferInternal (final GL4 gl , final String name , final int channelCount ,
87+ final int channelDepth ) {
8788 if (!initialized ) {
8889 return ;
8990 }
@@ -105,9 +106,9 @@ private void addUnsignedByteBufferInternal(final GL4 gl, final String name, fina
105106 }
106107
107108
108- public void addUnsignedByteRBuffer (final GL4 gl , final String name , final int channelDepth ) {
109- addUnsignedByteBufferInternal (gl , name , 1 , channelDepth );
110- }
109+ public void addUnsignedByteRBuffer (final GL4 gl , final String name , final int channelDepth ) {
110+ addUnsignedByteBufferInternal (gl , name , 1 , channelDepth );
111+ }
111112
112113 public void addUnsignedByteRGBuffer (final GL4 gl , final String name , final int channelDepth ) {
113114 addUnsignedByteBufferInternal (gl , name , 2 , channelDepth );
@@ -118,7 +119,7 @@ public void addUnsignedByteRGBBuffer(final GL4 gl, final String name, final int
118119 }
119120
120121 public void addUnsignedByteRGBABuffer (final GL4 gl , final String name , final int channelDepth ) {
121- addUnsignedByteBufferInternal (gl , name , 4 , channelDepth );
122+ addUnsignedByteBufferInternal (gl , name , 4 , channelDepth );
122123 }
123124
124125 public void addDepthBuffer (final GL4 gl , final String name , final int depth ) {
@@ -179,13 +180,13 @@ public void setReadBuffers(final GL4 gl) {
179180 public int bindTexturesToUnitsWithOffset (final GL4 gl , final int offset ) {
180181 int totalUnits = 0 ;
181182
182- for (Map .Entry <String , GLTexture > entry : backingTextures .entrySet ()) {
183+ for (Map .Entry <String , GLTexture > entry : backingTextures .entrySet ()) {
183184 gl .glActiveTexture (GL4 .GL_TEXTURE0 + offset + totalUnits );
184185 gl .glBindTexture (GL4 .GL_TEXTURE_2D , entry .getValue ().getId ());
185186 totalUnits ++;
186187 }
187188
188- for (Map .Entry <String , GLTexture > entry : depthBuffers .entrySet ()) {
189+ for (Map .Entry <String , GLTexture > entry : depthBuffers .entrySet ()) {
189190 gl .glActiveTexture (GL4 .GL_TEXTURE0 + offset + totalUnits );
190191 gl .glBindTexture (GL4 .GL_TEXTURE_2D , entry .getValue ().getId ());
191192 totalUnits ++;
@@ -197,7 +198,7 @@ public int bindTexturesToUnitsWithOffset(final GL4 gl, final int offset) {
197198 public List <Integer > getTextureIds (final GL4 gl ) {
198199 final ArrayList <Integer > list = new ArrayList <>();
199200
200- for (Map .Entry <String , GLTexture > entry : backingTextures .entrySet ()) {
201+ for (Map .Entry <String , GLTexture > entry : backingTextures .entrySet ()) {
201202 list .add (entry .getValue ().getId ());
202203 }
203204
@@ -218,7 +219,7 @@ public void resize(final GL4 gl, final int newWidth, final int newHeight) {
218219 final LinkedHashMap <String , GLTexture > newBackingTextures = new LinkedHashMap <>();
219220 final LinkedHashMap <String , GLTexture > newDepthBuffers = new LinkedHashMap <>();
220221
221- for (Map .Entry <String , GLTexture > entry : backingTextures .entrySet ()) {
222+ for (Map .Entry <String , GLTexture > entry : backingTextures .entrySet ()) {
222223 final GLTexture newT = new GLTexture (gl ,
223224 entry .getValue ().getNativeType (),
224225 entry .getValue ().getChannels (),
@@ -235,7 +236,7 @@ public void resize(final GL4 gl, final int newWidth, final int newHeight) {
235236 0 );
236237 }
237238
238- for (Map .Entry <String , GLTexture > entry : depthBuffers .entrySet ()) {
239+ for (Map .Entry <String , GLTexture > entry : depthBuffers .entrySet ()) {
239240 final GLTexture newT = new GLTexture (gl ,
240241 entry .getValue ().getNativeType (),
241242 -1 ,
@@ -289,17 +290,19 @@ public String toString() {
289290 info = new StringBuilder ("GLFramebuffer " + framebufferId [0 ] + "\n |\n " );
290291
291292 for (final GLTexture att : backingTextures .values ()) {
292- info .append (String .format ("+-\t Color Attachment %s, %dx%d/%d*%d, 0x%s\n " , Integer .toHexString (att .getId ()),
293- att .getWidth (), att .getHeight (), att .getChannels (), att .getBitsPerChannel (),
294- Integer .toHexString (att .getInternalFormat ())));
293+ info .append (
294+ String .format ("+-\t Color Attachment %s, %dx%d/%d*%d, 0x%s\n " , Integer .toHexString (att .getId ()),
295+ att .getWidth (), att .getHeight (), att .getChannels (), att .getBitsPerChannel (),
296+ Integer .toHexString (att .getInternalFormat ())));
295297 }
296298
297299 info .append ("|\n " );
298300
299301 for (final GLTexture att : depthBuffers .values ()) {
300- info .append (String .format ("+-\t Depth Attachment %s, %dx%d/%d*%d, 0x%s\n " , Integer .toHexString (att .getId ()),
301- att .getWidth (), att .getHeight (), att .getChannels (), att .getBitsPerChannel (),
302- Integer .toHexString (att .getInternalFormat ())));
302+ info .append (
303+ String .format ("+-\t Depth Attachment %s, %dx%d/%d*%d, 0x%s\n " , Integer .toHexString (att .getId ()),
304+ att .getWidth (), att .getHeight (), att .getChannels (), att .getBitsPerChannel (),
305+ Integer .toHexString (att .getInternalFormat ())));
303306 }
304307 }
305308 return info .toString ();
0 commit comments