Might anyone be able to provide a simple example for applying a texture to a point or quad (prefer point sprite if possible - less work??). Then load all the vertex data into a buffer, load all the texture points into a buffer, colors, etc. I'd really like to start using a VBO for my textured particles. I'm somewhat familar with creating a VBO, I do it for my lines.. but just not sure how to do it with textures.
I'm using this to load my texture.
Code: try {
particleImg = TextureIO.newTexture(new File(dataPath("particle.png")), true);
}
catch (IOException e) {}
//.....
nodeList = gl.glGenLists(1);
gl.glNewList(nodeList, GL.GL_COMPILE);
shader.startShader();
particleImg.enable();
particleImg.bind();
gl.glBegin(gl.GL_QUADS);
for (int i = 0; i < Nodes.length; i++) {
Node n1 = Nodes[i];
gl.glColor4f(0,1,1,.5);
gl.glTexCoord4f(n1.x, n1.y, z, n1.w-5 );
gl.glVertex2f( -1.0f, -1.0f );
gl.glVertex2f( +1.0f, -1.0f );
gl.glVertex2f( +1.0f, +1.0f );
gl.glVertex2f( -1.0f, +1.0f );
}
gl.glEnd();
shader.endShader();
particleImg.disable();
gl.glEndList();