v0.9.3: added casts to buffer methods to prevent JDK 9+ issues
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
@@ -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()){
|
||||
|
||||
Reference in New Issue
Block a user