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: glBindFramebuffer causes app to not respond

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2013
    Posts
    4

    glBindFramebuffer causes app to not respond

    Hello,
    I'm trying to run my opengl app on other computers. Everything runs ok on my PC, however when I tried it elsewhere, glBindFramebuffer causes app to not respond. Here's full source code:
    Code :
    // setting opengl attributes for SDL
    SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3 );
    SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 2 );
    SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE );
     
    // inti sdl
    if(SDL_Init(SDL_INIT_EVERYTHING) < 0) {
        return false;
    }   
    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1);
    SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 8);
    // create windows
    if((screen = SDL_CreateWindow("Color Wars", 100, 100, 1024, 600, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN)) == NULL) {      
        return false;
    }
     
    // opengl context
    if ((gl_context = SDL_GL_CreateContext(screen)) == NULL)
    {
        return false;
    }
     
    SDL_GL_SetSwapInterval(1);
    //  return false;
    glewExperimental = GL_TRUE;
     
    if (glewInit() != GLEW_OK)
    {
        return false;
    }
    glEnable(GL_DEPTH_TEST);
    glEnable(GL_BLEND);
    glEnable(GL_TEXTURE_2D);
    glEnable(GL_CULL_FACE);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     
    glBindFramebuffer(GL_FRAMEBUFFER, 0);

    When I delete last line, everything works. Does anyone have a clue what's happing? Thank you for your help in advance.

  2. #2
    Advanced Member Frequent Contributor Ehsan Kamrani's Avatar
    Join Date
    May 2005
    Posts
    537
    It seems that FBO is not supported by those machines.I always check FBO extension before calling its functions.

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    745
    Did you check what OpenGL version GLEW thinks is available, e.g. using if(GLEW_VERSION_3_2) ? The symptom looks like a not initialized function pointer, which could be the case if GLEW believes you have an OpenGL context that does not support glBindFramebuffer. Also, does SDL activate the OpenGL context directly after creating it (glewInit() must have an active context to work)?

Tags for this Thread

Posting Permissions

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