v0.7.4b: Initial LibGDX commit! more details below:
Large sections of game logic are now working through libgdx instead of android libraries. There is still work to do but this is the first major step. Big changes include: - Graphics code is now through LibGDX (except for text rendering) - Initialization and screen-handling logic is now mostly through LibGDX - Audio is now through LibGDX - Input handling is now through LibGDX - Most misc functions are now through LibGDX
This commit is contained in:
@@ -21,22 +21,20 @@
|
||||
|
||||
package com.watabou.glwrap;
|
||||
|
||||
import android.opengl.GLES20;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
|
||||
public class Framebuffer {
|
||||
|
||||
public static final int COLOR = GLES20.GL_COLOR_ATTACHMENT0;
|
||||
public static final int DEPTH = GLES20.GL_DEPTH_ATTACHMENT;
|
||||
public static final int STENCIL = GLES20.GL_STENCIL_ATTACHMENT;
|
||||
public static final int COLOR = Gdx.gl.GL_COLOR_ATTACHMENT0;
|
||||
public static final int DEPTH = Gdx.gl.GL_DEPTH_ATTACHMENT;
|
||||
public static final int STENCIL = Gdx.gl.GL_STENCIL_ATTACHMENT;
|
||||
|
||||
public static final Framebuffer system = new Framebuffer( 0 );
|
||||
|
||||
private int id;
|
||||
|
||||
public Framebuffer() {
|
||||
int[] buffers = new int[1];
|
||||
GLES20.glGenBuffers( 1, buffers, 0 );
|
||||
id = buffers[0];
|
||||
id = Gdx.gl.glGenBuffer();
|
||||
}
|
||||
|
||||
private Framebuffer( int n ) {
|
||||
@@ -44,26 +42,25 @@ public class Framebuffer {
|
||||
}
|
||||
|
||||
public void bind() {
|
||||
GLES20.glBindFramebuffer( GLES20.GL_FRAMEBUFFER, id );
|
||||
Gdx.gl.glBindFramebuffer( Gdx.gl.GL_FRAMEBUFFER, id );
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
int[] buffers = {id};
|
||||
GLES20.glDeleteFramebuffers( 1, buffers, 0 );
|
||||
Gdx.gl.glDeleteBuffer(id);
|
||||
}
|
||||
|
||||
public void attach( int point, Texture tex ) {
|
||||
bind();
|
||||
GLES20.glFramebufferTexture2D( GLES20.GL_FRAMEBUFFER, point, GLES20.GL_TEXTURE_2D, tex.id, 0 );
|
||||
Gdx.gl.glFramebufferTexture2D( Gdx.gl.GL_FRAMEBUFFER, point, Gdx.gl.GL_TEXTURE_2D, tex.id, 0 );
|
||||
}
|
||||
|
||||
public void attach( int point, Renderbuffer buffer ) {
|
||||
bind();
|
||||
GLES20.glFramebufferRenderbuffer( GLES20.GL_RENDERBUFFER, point, GLES20.GL_TEXTURE_2D, buffer.id() );
|
||||
Gdx.gl.glFramebufferRenderbuffer( Gdx.gl.GL_RENDERBUFFER, point, Gdx.gl.GL_TEXTURE_2D, buffer.id() );
|
||||
}
|
||||
|
||||
public boolean status() {
|
||||
bind();
|
||||
return GLES20.glCheckFramebufferStatus( GLES20.GL_FRAMEBUFFER ) == GLES20.GL_FRAMEBUFFER_COMPLETE;
|
||||
return Gdx.gl.glCheckFramebufferStatus( Gdx.gl.GL_FRAMEBUFFER ) == Gdx.gl.GL_FRAMEBUFFER_COMPLETE;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user