Fixed buffers to work in newer versions of java

This commit is contained in:
josua 2020-10-04 23:11:41 +11:00
parent 39c6312f61
commit 7ebacd26a0
3 changed files with 5 additions and 2 deletions

View File

@ -8,4 +8,5 @@ org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=1.8

View File

@ -12,6 +12,7 @@ import static org.lwjgl.opengl.GL11.glTexImage2D;
import static org.lwjgl.opengl.GL11.glTexParameteri; import static org.lwjgl.opengl.GL11.glTexParameteri;
import static org.lwjgl.opengl.GL30.glGenerateMipmap; import static org.lwjgl.opengl.GL30.glGenerateMipmap;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
@ -324,7 +325,7 @@ public class TextureAtlas2D
ByteBuffer texmap_buff = ByteBuffer.allocateDirect(texmap_b.length); ByteBuffer texmap_buff = ByteBuffer.allocateDirect(texmap_b.length);
texmap_buff.put(texmap_b); texmap_buff.put(texmap_b);
texmap_buff.position(0); ((Buffer)texmap_buff).position(0);
texture = glGenTextures(); texture = glGenTextures();
glBindTexture(GL_TEXTURE_2D, texture); glBindTexture(GL_TEXTURE_2D, texture);

View File

@ -13,6 +13,7 @@ import static org.lwjgl.opengl.GL12.GL_TEXTURE_3D;
import static org.lwjgl.opengl.GL12.glTexImage3D; import static org.lwjgl.opengl.GL12.glTexImage3D;
import static org.lwjgl.opengl.GL30.glGenerateMipmap; import static org.lwjgl.opengl.GL30.glGenerateMipmap;
import java.nio.Buffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Comparator; import java.util.Comparator;
@ -361,7 +362,7 @@ public class TextureAtlas3D
ByteBuffer texmap_buff = ByteBuffer.allocateDirect(texmap_b.length); ByteBuffer texmap_buff = ByteBuffer.allocateDirect(texmap_b.length);
texmap_buff.put(texmap_b); texmap_buff.put(texmap_b);
texmap_buff.position(0); ((Buffer)texmap_buff).position(0);
texture = glGenTextures(); texture = glGenTextures();
glBindTexture(GL_TEXTURE_3D, texture); glBindTexture(GL_TEXTURE_3D, texture);