Results 1 to 2 of 2

Thread: Glut application flashes and disappears when run in release mode

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2002
    Location
    London, Ontario, Canada
    Posts
    1

    Glut application flashes and disappears when run in release mode

    Hi gus,

    This is my first post.

    I am trying to clean up some of my older glut apps and I found that if I create a release mode and then try and run the exe separate from VC++, in windows explorer, the console and glut window just flash up and then disappear.

    How can I prevent this from happening - if I can at all?

    Thanks....any help appreciated!

  2. #2

    Re: Glut application flashes and disappears when run in release mode

    I just tried this with a win32 based glut application and a release version didn't have a problem nor did it when I converted it to a console based app.

    Here's the code I used.. which is pretty basic. Hope this helps you figure out why yours is doing that.

    Tina http://programming.swangen.co.uk/opengl/

    =========================================
    #include <gl\glut.h> //header file for GLUT

    static void glut_render(void);
    void glut_resize(int w, int h);

    float xrot;

    int main(int argc, char **argv)
    {

    // Initialise
    glutInit(&argc,argv); //initializes the GLUT framework
    glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); //sets up the display mode
    glutInitWindowSize(640,480);
    glutCreateWindow("Glut Test"); //creates a window

    // Functions
    glutDisplayFunc(glut_render); //specifies our redraw function
    glutReshapeFunc(glut_resize);
    glutIdleFunc(glut_render);
    glutMainLoop(); //the main loop of the GLUT framework
    return 0;
    }


    void glut_resize(int w, int h)
    {
    glViewport(0,0, (GLsizei) w, (GLsizei) h); // added... new window size
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
    gluPerspective(45,1.0,1.0,20.0);
    glMatrixMode(GL_MODELVIEW);
    glLoadIdentity();
    }


    void glut_render(void)
    {
    glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
    glLoadIdentity();

    glTranslatef(0,0,-5);
    glRotatef(xrot,1,0,0);
    glBegin(GL_TRIANGLES);
    glColor3f(1,0,0);glVertex3f(0,1,1);
    glColor3f(0,1,0);glVertex3f(1,0,2);
    glColor3f(0,0,1);glVertex3f(-1,0,2);
    glColor3f(0,0,1);glVertex3f(-1,0,2);
    glColor3f(0,1,0);glVertex3f(1,0,2);
    glColor3f(1,0,1);glVertex3f(0,0,0);
    glColor3f(1,0,0);glVertex3f(0,1,1);
    glColor3f(0,0,1);glVertex3f(-1,0,2);
    glColor3f(1,0,1);glVertex3f(0,0,0);
    glColor3f(1,0,0);glVertex3f(0,1,1);
    glColor3f(0,1,0);glVertex3f(1,0,2);
    glColor3f(1,0,1);glVertex3f(0,0,0);
    glEnd();
    xrot++;
    glFlush();
    glutSwapBuffers();
    }
    ===========================================
    Learning OpenGL while working on sourceforge projects:
    https://sourceforge.net/projects/simulant/ and
    https://sourceforge.net/projects/projectnova/

Similar Threads

  1. GLUT/GLUI program not compiling in Release mode
    By PowersWithin in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 07-09-2009, 02:18 AM
  2. Rendering only partially shown in release mode
    By johnnalley in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 09-03-2007, 08:18 AM
  3. Blank Textures in VC6 Release Mode (Win32)
    By Astral Disaster in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-22-2004, 08:56 PM
  4. Tool Box : Not the same on Release and Debug mode, why ?
    By Leyder Dylan in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 06-04-2003, 06:57 AM
  5. Vertex Array does'nt work in release mode
    By Arath in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 03-13-2001, 04:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean