I am doing a number of things, which by themselves I can find examples for, but I am not sure how they fit together combined. Here is some psuedo code. Is this how to fit it all? Thanks in advance.
TextureData td0 = new TextureData(...); TextureData td1 = new TextureData(...); Texture tex0; Texture tex1; int loc0; int loc1;
later in GLEventListener init():
`tex0 = TextureIO.newTexture(td0);
tex0.enable();
tex1 = TextureIO.newTexture(td1);
tex1.enable();
compile & linking code for programObject
loc0 = gl.glGetUniformLocationARB(programObject, “db_table”);
loc1 = gl.glGetUniformLocationARB(programObject, “db_index”);`
in Display():
`glActiveTexture(GL.GL_TEXTURE0);
tex0.bind();
gl.glUniform1iARB(loc0, 0);
glActiveTexture(GL.GL_TEXTURE1);
tex1.bind();
gl.glUniform1iARB(loc1, 1);
gl.glUseProgramObjectARB(programObject);
gl.glBegin(GL.GL_QUADS);
…
gl.glEnd();`
In the shader itself:
`uniform sampler2D db_table;
uniform sampler2D db_index;
void main(){…}`