From msdn: The glGetString function returns a string describing the current OpenGL connection.
ie you need to have initialised your opengl surface prior to calling the fn. That's why it works in your 'NeHe' style windows example but does not not succeed in your console.
I think the source for GLUT is available somewhere or other and that may give you some ideas about how to go about setting up opengl within a console app.
Hope that helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Why is it every time I do:
cout << (char *)glGetString(GL_VENDOR) << endl;
it outputs "<null>"?
I have included gl.h the opengl lib.
Kip
I'm not sure but it's possible the NULL=0=error code, either:
GL_INVALID_ENUM or GL_INVALID_OPERATION (sorry, I don't know their numerical values, you'll need to check the headers).
It might also be (guessing) that since the fn description says 'The GL_VERSION string begins with a version number' that the version number is zero!
dunno if it makes sense, see yourself
the lines of code are for pure Windoze, i really don't know how to invoke opengl from a dos box
first, i declared this:
const GLubyte *info;
then, within InitOpenGL(), i do this (before returning):
info = glGetString(GL_VENDOR);
finally, i have put it into KillGLWindow, do this:
MessageBox(NULL,(char *) info,"Status",MB_OK);
it says "NVIDIA Corporation", so i assume it works
are you working with NEHE's tuts?
From msdn: The glGetString function returns a string describing the current OpenGL connection.
ie you need to have initialised your opengl surface prior to calling the fn. That's why it works in your 'NeHe' style windows example but does not not succeed in your console.
I think the source for GLUT is available somewhere or other and that may give you some ideas about how to go about setting up opengl within a console app.
Hope that helps.