Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Bleeding programs

  1. #1
    Junior Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    116

    Bleeding programs

    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?

  2. #2
    Junior Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    116

    Re: Bleeding programs

    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;
    }

  3. #3
    Junior Member Regular Contributor
    Join Date
    Mar 2005
    Posts
    116

    Re: Bleeding programs

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •