Help @ C++

T

TuPLaD

Hi, i just started learning how to code OpenGL with the syntax of C++.
But i got the following problem(YES IT IS C++ BUT ITS A OPENGL
PROGRAM):

First of all you need a bool, let's call it bBallDrawn. In
glPushMatrix set it to true and if it is true in glPopMatrix, we'll
draw the Ballhack and set it back to false.
Here's the code:

glPushMatrix();
glDisable(GL_TEXTURE_2D); // Ballhack has no textures
glDisable(GL_DEPTH_TEST); // Makes the Balls visible through walls
GLUquadricObj *ball;
if(bT)
glColor3f(1.0f,0.0f,0.0f); // Set Ballhack Color
else if(bCt)
glColor3f(0.0f,0.0f,1.0f); // Set Ballhack Color
glTranslatef(x,y,z); // insert coordinates here
ball=gluNewQuadric();
gluQuadricNormals(ball, GLU_SMOOTH);
gluSphere(ball,5.0f,32,32);
gluDeleteQuadric(ball);
glEnable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glPopMatrix();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top