PDA

View Full Version : How to add texture mapping for this rectangle by uploading bmp?



Tio Vivian
03-22-2018, 04:47 AM
Hi, I have a rectangle:


glLoadIdentity();
glBegin(GL_POLYGON);
glColor3f(1.0, 1.0, 1.0);
glVertex2f(-0.2f, -0.3f);
glVertex2f(-0.2f, 0.2f);
glVertex2f(0.2f, 0.2f);
glVertex2f(0.2f, -0.3f);
glPopMatrix();
glEnd();

I wish to add texture on this rectangle, so anyone can give me some ideas?
Thanks