void Bullet(double startx, double starty, double startangle, float speed=0) {
double startx1=0,starty1=0;
glPushMatrix();
glBindTexture(GL_TEXTURE_2D, sldT[0]);
glTranslatef((float)startx1,(float)starty1,-5.0f);glRotated(startangle,0,0,1);
glBegin(GL_QUADS);
glTexCoord2f(0.0f, 0.0f); glVertex3f(-0.032f, -0.032f, 1.0f);
glTexCoord2f(1.0f, 0.0f); glVertex3f( 0.032f, -0.032f, 1.0f);
glTexCoord2f(1.0f, 1.0f); glVertex3f( 0.032f, 0.032f, 1.0f);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-0.032f, 0.032f, 1.0f);
glEnd();
glPopMatrix();
sinv = sin(startangle*pi/180);
cosv = cos(startangle*pi/180);
startx1+=cosv*speed;
starty1+=sinv*speed;
}
-------------------
Thats the function i call every time Ctrl button is pressed. For some reason notting happens.. What am I doing wrong?
(2d game)
I don't think...if I remember...you cannot use the texture bind function within glPushMatrix and glPopMatrix, try moving it just before the glPushMatrix
[edited by - BiGCyC on May 4, 2002 12:59:26 AM]
[edited by - BiGCyC on May 4, 2002 12:59:26 AM]
You can use it there fine
-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
-----------------------
"When I have a problem on an Nvidia, I assume that it is my fault. With anyone else''s drivers, I assume it is their fault" - John Carmack
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement