Jump to content


glGetString question


1 reply to this topic

#1 roxtar

    Member

  • Members
  • PipPip
  • 94 posts

Posted 01 December 2005 - 05:41 PM

Why is it that glGetString only works after we initialize the window? I mean if I write something like:

#include <GL/gl.h>

#include <stdio.h>

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

  if(glGetString(GL_VENDOR)) {

    printf("%s\n",glGetString(GL_VENDOR));

  }

  else {

    printf("Error. %d",glGetError());

  }

}

it won't work.

#2 Kenneth Gorking

    Senior Member

  • Members
  • PipPipPipPip
  • 939 posts

Posted 01 December 2005 - 07:27 PM

Because OpenGL hasn't been initialized yet, and it's dependant on the pixelformat you associate with the device context in windows, or the visual you choose under linux. It is possible to create an unaccelerated instance of OpenGL under windows, and it would return different caps than the accelerated version.
"Stupid bug! You go squish now!!" - Homer Simpson





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users