use of com.google.gwt.webgl.client.WebGLTexture in project playn by threerings.
the class WebGLDemo method createTexture.
private WebGLTexture createTexture() {
WebGLTexture tex = gl.createTexture();
gl.bindTexture(TEXTURE_2D, tex);
gl.texParameteri(TEXTURE_2D, TEXTURE_MAG_FILTER, LINEAR);
gl.texParameteri(TEXTURE_2D, TEXTURE_MIN_FILTER, LINEAR);
gl.texParameteri(TEXTURE_2D, TEXTURE_WRAP_S, CLAMP_TO_EDGE);
gl.texParameteri(TEXTURE_2D, TEXTURE_WRAP_T, CLAMP_TO_EDGE);
return tex;
}
use of com.google.gwt.webgl.client.WebGLTexture in project playn by threerings.
the class WebGLDemo method createFramebuffer.
private WebGLFramebuffer createFramebuffer(int width, int height) {
WebGLTexture tex = createTexture();
fbuf = gl.createFramebuffer();
gl.texImage2D(TEXTURE_2D, 0, RGBA, width, height, 0, RGBA, UNSIGNED_BYTE, null);
WebGLRenderbuffer rbuf = gl.createRenderbuffer();
gl.bindRenderbuffer(RENDERBUFFER, rbuf);
gl.renderbufferStorage(RENDERBUFFER, RGBA4, width, height);
gl.framebufferTexture2D(FRAMEBUFFER, COLOR_ATTACHMENT0, TEXTURE_2D, tex, 0);
gl.framebufferRenderbuffer(FRAMEBUFFER, DEPTH_ATTACHMENT, RENDERBUFFER, rbuf);
gl.bindTexture(TEXTURE_2D, null);
gl.bindRenderbuffer(RENDERBUFFER, null);
gl.bindFramebuffer(FRAMEBUFFER, null);
return fbuf;
}
use of com.google.gwt.webgl.client.WebGLTexture in project libgdx by libgdx.
the class GwtGL20 method glGenTextures.
@Override
public void glGenTextures(int n, IntBuffer textures) {
for (int i = 0; i < n; i++) {
WebGLTexture texture = gl.createTexture();
int id = this.textures.add(texture);
textures.put(id);
}
}
use of com.google.gwt.webgl.client.WebGLTexture in project libgdx by libgdx.
the class GwtGL20 method glDeleteTexture.
@Override
public void glDeleteTexture(int id) {
WebGLTexture texture = this.textures.remove(id);
gl.deleteTexture(texture);
}
use of com.google.gwt.webgl.client.WebGLTexture in project libgdx by libgdx.
the class GwtGL20 method glDeleteTextures.
@Override
public void glDeleteTextures(int n, IntBuffer textures) {
for (int i = 0; i < n; i++) {
int id = textures.get();
WebGLTexture texture = this.textures.remove(id);
gl.deleteTexture(texture);
}
}
Aggregations