again openGL) I need to make drag-control for textures and don't know how to store this values. i have a struct with point, image for texture, but i need a texture to change their position, so i need to change glVertex2f on mousePressed method, as i understand
glLoadIdentity();
glEnable(GL_TEXTURE_2D); //enable 2D texturing
if(number < 4){
glBindTexture( GL_TEXTURE_2D, texture );
} else {
glBindTexture( GL_TEXTURE_2D, texture2 );
}
glBegin (GL_QUADS);
glTexCoord2d(0.0,0.0); glVertex2f(x/window_width, y/window_height);
glTexCoord2d(1.0,0.0); glVertex2f(x/window_width+0.2, y/window_height);
glTexCoord2d(1.0,1.0); glVertex2f(x/window_width+0.2, y/window_height+0.2);
glTexCoord2d(0.0,1.0); glVertex2f(x/window_width, y/window_height+0.2);
glEnd();
glFlush();
how can i add them to vector and then change position ?