PDA

View Full Version : Bleeding programs



t3jem
03-26-2005, 06:09 PM
Ok this is very wierd. I have a program that reads off a resource file for it's textures(might help). I will run the program then exit right? well when I open my next program I will get a flash of my other one! It is very creapy. I don't know if this is normal does anybody know?

t3jem
03-26-2005, 06:23 PM
The problem seems to lie in the second program(same thing happens when i open different programs first).

it is supposed to draw a textured cylinder.

here is the code

void cylinder
{
float step = 1;
glBegin GL_QUADS;
for float x = 0; x< 3.14159265359*2;x+= step
{
glTexCoord2f 0,0;
glVertex3f sin x,-1,cos x;
glTexCoord2f 0,1;
glVertex3f sin x,1,cos x;
glTexCoord2f x/6.283,1;
glVertex3f sin x+step ,1,cos x+step;
glTexCoord2f x/6.283,0;
glVertex3f sin x+step,-1,cos x+step;
}
}

void display
{
glClear GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT;
glBindTexture GL_TEXTURE_2D, texture[0];

//glDisable GL_TEXTURE_2D;
glPushMatrix;
glRotatef 20, 1,0,0;
glRotatef yrot,0,1,0;
cylinder;
glPopMatrix;

glutPostRedisplay;
glutSwapBuffers;
glFlush;
}

t3jem
03-27-2005, 10:16 AM
I've tried copy and paste all around my other programs that work but it just doesn't change it. When it runs it also stops responding it's like it only clears the screen once and gives out. Yet when I hit escape it still exits the program like it should. Any one have any ideas?