This is probably a really simple and stupid question, but when I try to "Build and Run" an OpenGL program on XCode, it seems to debug it and open the window for a split second and then close. There aren't any compilation errors and it finishes saying that the debugging ended normally. I even tried changing the active configuration to release, but that didn't change anything. Is there something really obvious that I'm missing when I try to run a program? Sorry, I'm new at XCode.

Recommended Answers

All 3 Replies

Could you post your interface and implementation code here so we can review it?

//From http://fabiensanglard.net/shadowmappingVSM/index.php
    int main(int argc, char** argv)
    {
        glutInit(&argc, argv);
        glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_ALPHA | GLUT_DEPTH);
        glutInitWindowPosition(100,100);
        glutInitWindowSize(RENDER_WIDTH,RENDER_HEIGHT);
        glutCreateWindow("GLSL Shadow mapping");

        printf("Shadow Map: %.0fx%.0f\n",RENDER_WIDTH*SHADOW_MAP_COEF,RENDER_HEIGHT*SHADOW_MAP_COEF);
        printf("Ping-Pong FBO: %.0fx%.0f\n",RENDER_WIDTH*SHADOW_MAP_COEF*BLUR_COEF,RENDER_HEIGHT*SHADOW_MAP_COEF*BLUR_COEF);

        generateShadowFBO();
        loadShadowShader();

        // This is important, if not here, FBO's depthbuffer won't be populated.
        glEnable(GL_DEPTH_TEST);
        glClearColor(0,0,0,1.0f);

        glEnable(GL_CULL_FACE);

        glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST);

        glutDisplayFunc(renderScene);
        glutIdleFunc(renderScene);

    //glutKeyboardFunc(processNormalKeys);

        glutMainLoop();
        return 0; 
    }

Does this help? I feel like there's just some sort of stupid checkbox that I haven't clicked yet or something...Thanks!

What's in renderScene?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.