v0.9.3: added casts to buffer methods to prevent JDK 9+ issues

This commit is contained in:
Evan Debenham
2021-05-09 17:19:15 -04:00
parent 9412eb81f4
commit ef8750b326
15 changed files with 51 additions and 34 deletions

View File

@@ -23,6 +23,7 @@ package com.watabou.glwrap;
import com.badlogic.gdx.Gdx;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.FloatBuffer;

View File

@@ -24,6 +24,7 @@ package com.watabou.glwrap;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Pixmap;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
@@ -108,7 +109,7 @@ public class Texture {
order( ByteOrder.nativeOrder() ).
asIntBuffer();
imageBuffer.put( pixels );
imageBuffer.position( 0 );
((Buffer)imageBuffer).position( 0 );
Gdx.gl.glTexImage2D(
Gdx.gl.GL_TEXTURE_2D,
@@ -130,7 +131,7 @@ public class Texture {
allocateDirect( w * h ).
order( ByteOrder.nativeOrder() );
imageBuffer.put( pixels );
imageBuffer.position( 0 );
((Buffer)imageBuffer).position( 0 );
Gdx.gl.glPixelStorei( Gdx.gl.GL_UNPACK_ALIGNMENT, 1 );

View File

@@ -23,6 +23,7 @@ package com.watabou.glwrap;
import com.badlogic.gdx.Gdx;
import java.nio.Buffer;
import java.nio.FloatBuffer;
import java.util.ArrayList;
@@ -74,7 +75,7 @@ public class Vertexbuffer {
public void updateGLData(){
if (updateStart == -1) return;
vertices.position(updateStart);
((Buffer)vertices).position(updateStart);
bind();
if (updateStart == 0 && updateEnd == vertices.limit()){