• Advertisement

Archived

This topic is now archived and is closed to further replies.

Bullets

This topic is 5769 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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)

Share this post


Link to post
Share on other sites
Advertisement
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]

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement