public class ImageBuffer { static public final int STATUS_INVAILD = 0; static public final int STATUS_READY = 1; static public final int STATUS_USING = 2;
public int mTextureId; //textureId public int mFramebuffer; public int mStatus; public int mWidth; public int mHeight;
// Set parameters. We're probably using non-power-of-two dimensions, so // some values may not be available for use. glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // Create framebuffer object and bind it. glGenFramebuffers(1, values, 0); mFramebuffer = values[0]; // expected > 0 glBindFramebuffer(GL_FRAMEBUFFER, mFramebuffer);