Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


#ActualMaxjen

Posted 02 September 2013 - 05:57 AM

Call glUseProgram before getting the attributes. Also, "projectionMatrix", "modelViewMatrix", and possibly "in_Color" won't exist since they are being optimized out.

That didn't work sad.png

Also, I think the variables that are being optimized out are gl_ProjectionMatrix, etc. That is why I am trying to use my own variables.

 

Maybe I am doing something wrong with the initialization? This is how I create my openGL context:

    if (SDL_Init(SDL_INIT_VIDEO) < 0) // Initialize SDL's Video subsystem
        sdldie("Unable to initialize SDL"); // Or die on error

    // Request opengl 3.2 context.
    // SDL doesn't have the ability to choose which profile at this time of writing,
    // but it should default to the core profile
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);

    // Turn on double buffering with a 24bit Z buffer.
    // You may need to change this to 16 or 32 for your system
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);

    // Create our window centered at 512x512 resolution
    mainwindow = SDL_CreateWindow(PROGRAM_NAME, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
        screenWidth, screenHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN);
    if (!mainwindow) // Die if creation failed
        sdldie("Unable to create window");

    checkSDLError(__LINE__);

    // Create our opengl context and attach it to our window
    maincontext = SDL_GL_CreateContext(mainwindow);
    checkSDLError(__LINE__);


    // This makes our buffer swap syncronized with the monitor's vertical refresh
    SDL_GL_SetSwapInterval(1);

    GLenum status = glewInit();
    if(status != GLEW_OK) {
        fprintf(stderr, "INFO: glew couldn't be initialized. Exit\nGLEW Error: %s", glewGetErrorString(status));
        close();
    }


#1Maxjen

Posted 02 September 2013 - 05:20 AM

Call glUseProgram before getting the attributes. Also, "projectionMatrix", "modelViewMatrix", and possibly "in_Color" won't exist since they are being optimized out.

That didn't work sad.png

Also, I think the variables that are being optimized out are gl_ProjectionMatrix, gl_Position, etc. That is why I am trying to use my own variables.

 

Maybe I am doing something wrong with the initialization? This is how I create my openGL context:

    if (SDL_Init(SDL_INIT_VIDEO) < 0) // Initialize SDL's Video subsystem
        sdldie("Unable to initialize SDL"); // Or die on error

    // Request opengl 3.2 context.
    // SDL doesn't have the ability to choose which profile at this time of writing,
    // but it should default to the core profile
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);

    // Turn on double buffering with a 24bit Z buffer.
    // You may need to change this to 16 or 32 for your system
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
    SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);

    // Create our window centered at 512x512 resolution
    mainwindow = SDL_CreateWindow(PROGRAM_NAME, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
        screenWidth, screenHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN);
    if (!mainwindow) // Die if creation failed
        sdldie("Unable to create window");

    checkSDLError(__LINE__);

    // Create our opengl context and attach it to our window
    maincontext = SDL_GL_CreateContext(mainwindow);
    checkSDLError(__LINE__);


    // This makes our buffer swap syncronized with the monitor's vertical refresh
    SDL_GL_SetSwapInterval(1);

    GLenum status = glewInit();
    if(status != GLEW_OK) {
        fprintf(stderr, "INFO: glew couldn't be initialized. Exit\nGLEW Error: %s", glewGetErrorString(status));
        close();
    }


PARTNERS