gdx api changes
- disable gdx-html build for now
This commit is contained in:
parent
5bb865a561
commit
1cec1bb0dc
@ -4,8 +4,8 @@ include ':vtm-android'
|
||||
include ':vtm-android-example'
|
||||
include ':vtm-gdx'
|
||||
include ':vtm-gdx-desktop'
|
||||
include ':vtm-gdx-html'
|
||||
include ':vtm-gdx-android'
|
||||
include ':vtm-android-app'
|
||||
include ':vtm-themes'
|
||||
//include ':vtm-gdx-html'
|
||||
//include ':vtm-ext-libs'
|
||||
|
@ -47,7 +47,7 @@ public class MainActivity extends AndroidApplication {
|
||||
Tile.SIZE = 400;
|
||||
|
||||
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
|
||||
cfg.useGL20 = true;
|
||||
//cfg.useGL20 = true;
|
||||
|
||||
new SharedLibraryLoader().load("vtm-jni");
|
||||
|
||||
|
@ -33,7 +33,6 @@ import org.lwjgl.opengl.GL14;
|
||||
import org.lwjgl.opengl.GL15;
|
||||
import org.lwjgl.opengl.GL20;
|
||||
|
||||
import com.badlogic.gdx.graphics.GL10;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
|
||||
/**
|
||||
@ -248,11 +247,11 @@ final class GdxGL20 implements org.oscim.backend.GL20 {
|
||||
}
|
||||
|
||||
public void glDrawElements(int mode, int count, int type, Buffer indices) {
|
||||
if (indices instanceof ShortBuffer && type == GL10.GL_UNSIGNED_SHORT)
|
||||
if (indices instanceof ShortBuffer && type == GL_UNSIGNED_SHORT)
|
||||
GL11.glDrawElements(mode, (ShortBuffer) indices);
|
||||
else if (indices instanceof ByteBuffer && type == GL10.GL_UNSIGNED_SHORT)
|
||||
else if (indices instanceof ByteBuffer && type == GL_UNSIGNED_SHORT)
|
||||
GL11.glDrawElements(mode, ((ByteBuffer) indices).asShortBuffer()); // FIXME yay...
|
||||
else if (indices instanceof ByteBuffer && type == GL10.GL_UNSIGNED_BYTE)
|
||||
else if (indices instanceof ByteBuffer && type == GL_UNSIGNED_BYTE)
|
||||
GL11.glDrawElements(mode, (ByteBuffer) indices);
|
||||
else
|
||||
throw new GdxRuntimeException("Can't use " + indices.getClass().getName()
|
||||
|
@ -66,7 +66,7 @@ public class GdxMapApp extends GdxMap {
|
||||
static protected LwjglApplicationConfiguration getConfig() {
|
||||
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
|
||||
cfg.title = "vtm-gdx";
|
||||
cfg.useGL20 = true;
|
||||
//cfg.useGL20 = true;
|
||||
cfg.width = 1280;
|
||||
cfg.height = 800;
|
||||
cfg.stencil = 8;
|
||||
|
@ -16,11 +16,11 @@
|
||||
*/
|
||||
package org.oscim.gdx.client;
|
||||
|
||||
import org.oscim.backend.GL20;
|
||||
import org.oscim.backend.canvas.Bitmap;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.GL10;
|
||||
import com.badlogic.gdx.graphics.Pixmap;
|
||||
import com.google.gwt.dom.client.ImageElement;
|
||||
import com.google.gwt.user.client.ui.Image;
|
||||
@ -79,7 +79,7 @@ public class GwtBitmap implements Bitmap {
|
||||
@Override
|
||||
public void uploadToTexture(boolean replace) {
|
||||
|
||||
Gdx.gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, pixmap.getGLInternalFormat(), pixmap.getWidth(),
|
||||
Gdx.gl.glTexImage2D(GL20.GL_TEXTURE_2D, 0, pixmap.getGLInternalFormat(), pixmap.getWidth(),
|
||||
pixmap.getHeight(), 0,
|
||||
pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels());
|
||||
|
||||
|
@ -20,9 +20,8 @@ import org.oscim.gdx.client.GwtGLAdapter;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.Graphics;
|
||||
import com.badlogic.gdx.graphics.GL10;
|
||||
import com.badlogic.gdx.graphics.GL11;
|
||||
import com.badlogic.gdx.graphics.GL20;
|
||||
import com.badlogic.gdx.graphics.GL30;
|
||||
import com.badlogic.gdx.graphics.GLCommon;
|
||||
import com.badlogic.gdx.utils.GdxRuntimeException;
|
||||
import com.google.gwt.canvas.client.Canvas;
|
||||
@ -112,34 +111,15 @@ public class GwtGraphics implements Graphics {
|
||||
return context;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGL11Available() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGL20Available() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GLCommon getGLCommon() {
|
||||
return gl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GL10 getGL10() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GL11 getGL11() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GL20 getGL20() {
|
||||
return gl;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -298,7 +278,7 @@ public class GwtGraphics implements Graphics {
|
||||
@Override
|
||||
public boolean supportsExtension(String extension) {
|
||||
if (extensions == null)
|
||||
extensions = Gdx.gl.glGetString(GL10.GL_EXTENSIONS);
|
||||
extensions = Gdx.gl.glGetString(GL20.GL_EXTENSIONS);
|
||||
return extensions.contains(extension);
|
||||
}
|
||||
|
||||
@ -350,4 +330,16 @@ public class GwtGraphics implements Graphics {
|
||||
public boolean isFullscreen() {
|
||||
return isFullscreenJSNI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isGL30Available() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GL30 getGL30() {
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user