Can I use GLSL for visual c++ without things like glut and glew?

  • I’m using Windows. I’m starting read about OpenGL and want to use it, but the new tutorial and books just use utilities like glut or glew for cross platform, but I don’t want use it. Look like MS doesn’t update for gl.h and glu.h (I think).
  • So can I use GLSL for OpenGL with Windows without use source outside?

Yes, of course.

GLEW isn’t magic or voodoo. It’s just a bunch of code, and you can write similar code yourself.

You’ll need to check the output from glGetString calls for GL_VERSION and GL_EXTENSIONS to determine that the features you want to use are supported. Then grab a glext.h file, include it in your project, and do a whole bunch of wglGetProcAddress calls to load function pointers. Check the results of these calls too because sometimes a buggy driver might report an extension but not export all of it’s entry points. In some cases you may then need further glGets to determine limits and other capabilities.

The whole process is tedious and time-consuming, you won’t learn anything useful from it, and to be honest it’s time you’re better off spending doing something productive - like writing your own code! And that’s why GLEW exists. It’s not for portability, it’s to save you from having to do this donkey-work.

[QUOTE=BlackHatIsMe;1291127]- I’m using Windows. I’m starting read about OpenGL and want to use it, but the new tutorial and books just use utilities like glut or glew for cross platform, but I don’t want use it. Look like MS doesn’t update for gl.h and glu.h (I think).

  • So can I use GLSL for OpenGL with Windows without use source outside?[/QUOTE]

Neither of those are essential. If you don’t use GLUT, you’ll need to handle window and context management yourself. If you don’t use GLEW, you’ll need to use wglGetProcAddress() (opengl32.dll only exports functions which are part of the OpenGL 1.1 API; functions added in later versions can only be used via a pointer returned from wglGetProcAddress).

If you need to know how to do either of those, I’d suggest referring to the GLUT/GLEW source code.