gwt: allow to create empty textures..
This commit is contained in:
parent
19bd1dab9f
commit
5b58898975
@ -43,14 +43,19 @@ public class GwtGLAdapter extends GwtGL20 implements GL20 {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void glTexImage2D(int target, int level, int internalformat, int width, int height,
|
public void glTexImage2D(int target, int level, int internalformat, int width, int height,
|
||||||
int border, int format, int type,
|
int border, int format, int type, Buffer pixels) {
|
||||||
Buffer pixels) {
|
|
||||||
|
if (pixels == null) {
|
||||||
|
gl.texImage2D(target, level, internalformat,
|
||||||
|
width, height, border, format,
|
||||||
|
type, null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Pixmap pixmap = Pixmap.pixmaps.get(((IntBuffer) pixels).get(0));
|
Pixmap pixmap = Pixmap.pixmaps.get(((IntBuffer) pixels).get(0));
|
||||||
if (pixmap != null) {
|
if (pixmap != null) {
|
||||||
// Gdx.app.log("GwtGL20", "load texture "+ target + " "+ width + " " + height + " " + type + " " + format);
|
|
||||||
gl.texImage2D(target, level, internalformat, format, type, pixmap.getCanvasElement());
|
gl.texImage2D(target, level, internalformat, format, type, pixmap.getCanvasElement());
|
||||||
} else if (format == GL20.GL_ALPHA) {
|
} else if (format == GL20.GL_ALPHA) {
|
||||||
// Gdx.app.log("GwtGL20", "load byte texture " + width + " " + height + " " + type + " " + format);
|
|
||||||
int tmp[] = new int[(width * height) >> 2];
|
int tmp[] = new int[(width * height) >> 2];
|
||||||
((IntBuffer) pixels).get(tmp);
|
((IntBuffer) pixels).get(tmp);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user