gdx api changes

- disable gdx-html build for now
This commit is contained in:
Hannes Janetzek 2014-03-03 20:14:43 +01:00
parent 5bb865a561
commit 1cec1bb0dc
6 changed files with 23 additions and 32 deletions

View File

@ -4,8 +4,8 @@ include ':vtm-android'
include ':vtm-android-example' include ':vtm-android-example'
include ':vtm-gdx' include ':vtm-gdx'
include ':vtm-gdx-desktop' include ':vtm-gdx-desktop'
include ':vtm-gdx-html'
include ':vtm-gdx-android' include ':vtm-gdx-android'
include ':vtm-android-app' include ':vtm-android-app'
include ':vtm-themes' include ':vtm-themes'
//include ':vtm-gdx-html'
//include ':vtm-ext-libs' //include ':vtm-ext-libs'

View File

@ -47,7 +47,7 @@ public class MainActivity extends AndroidApplication {
Tile.SIZE = 400; Tile.SIZE = 400;
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration(); AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useGL20 = true; //cfg.useGL20 = true;
new SharedLibraryLoader().load("vtm-jni"); new SharedLibraryLoader().load("vtm-jni");

View File

@ -33,7 +33,6 @@ import org.lwjgl.opengl.GL14;
import org.lwjgl.opengl.GL15; import org.lwjgl.opengl.GL15;
import org.lwjgl.opengl.GL20; import org.lwjgl.opengl.GL20;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.utils.GdxRuntimeException; 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) { 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); 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... 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); GL11.glDrawElements(mode, (ByteBuffer) indices);
else else
throw new GdxRuntimeException("Can't use " + indices.getClass().getName() throw new GdxRuntimeException("Can't use " + indices.getClass().getName()

View File

@ -66,7 +66,7 @@ public class GdxMapApp extends GdxMap {
static protected LwjglApplicationConfiguration getConfig() { static protected LwjglApplicationConfiguration getConfig() {
LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration(); LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
cfg.title = "vtm-gdx"; cfg.title = "vtm-gdx";
cfg.useGL20 = true; //cfg.useGL20 = true;
cfg.width = 1280; cfg.width = 1280;
cfg.height = 800; cfg.height = 800;
cfg.stencil = 8; cfg.stencil = 8;

View File

@ -16,11 +16,11 @@
*/ */
package org.oscim.gdx.client; package org.oscim.gdx.client;
import org.oscim.backend.GL20;
import org.oscim.backend.canvas.Bitmap; import org.oscim.backend.canvas.Bitmap;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.Pixmap; import com.badlogic.gdx.graphics.Pixmap;
import com.google.gwt.dom.client.ImageElement; import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.Image;
@ -79,7 +79,7 @@ public class GwtBitmap implements Bitmap {
@Override @Override
public void uploadToTexture(boolean replace) { 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.getHeight(), 0,
pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels()); pixmap.getGLFormat(), pixmap.getGLType(), pixmap.getPixels());

View File

@ -20,9 +20,8 @@ import org.oscim.gdx.client.GwtGLAdapter;
import com.badlogic.gdx.Gdx; import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Graphics; 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.GL20;
import com.badlogic.gdx.graphics.GL30;
import com.badlogic.gdx.graphics.GLCommon; import com.badlogic.gdx.graphics.GLCommon;
import com.badlogic.gdx.utils.GdxRuntimeException; import com.badlogic.gdx.utils.GdxRuntimeException;
import com.google.gwt.canvas.client.Canvas; import com.google.gwt.canvas.client.Canvas;
@ -112,34 +111,15 @@ public class GwtGraphics implements Graphics {
return context; return context;
} }
@Override
public boolean isGL11Available() {
return false;
}
@Override
public boolean isGL20Available() {
return true;
}
@Override @Override
public GLCommon getGLCommon() { public GLCommon getGLCommon() {
return gl; return gl;
} }
@Override
public GL10 getGL10() {
return null;
}
@Override
public GL11 getGL11() {
return null;
}
@Override @Override
public GL20 getGL20() { public GL20 getGL20() {
return gl; return null;
} }
@Override @Override
@ -298,7 +278,7 @@ public class GwtGraphics implements Graphics {
@Override @Override
public boolean supportsExtension(String extension) { public boolean supportsExtension(String extension) {
if (extensions == null) if (extensions == null)
extensions = Gdx.gl.glGetString(GL10.GL_EXTENSIONS); extensions = Gdx.gl.glGetString(GL20.GL_EXTENSIONS);
return extensions.contains(extension); return extensions.contains(extension);
} }
@ -350,4 +330,16 @@ public class GwtGraphics implements Graphics {
public boolean isFullscreen() { public boolean isFullscreen() {
return isFullscreenJSNI(); return isFullscreenJSNI();
} }
@Override
public boolean isGL30Available() {
// TODO Auto-generated method stub
return false;
}
@Override
public GL30 getGL30() {
// TODO Auto-generated method stub
return null;
}
} }