Coding OpenGL in Visual C++.net

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Coding OpenGL in Visual C++.net

      Last night I decided to get my feet a little wet with OpenGL...other than playing games ;) I found a seemingly reliable site, downloaded a tutorial & its supporting source code. Read the tutorial and when I tried to run the source code examples in Visual C++.net, I get this lovely message...fatal error C1083: Cannot open include file: 'gltk.h': No such file or directory.

      By this time I've spent way more time than I think I should have trying to find the #include <gltk.h> library. Can anyone help me? Please!
    • RE: Coding OpenGL in Visual C++.net

      Maybe it's an OpenGL header - does anyone else out there know OpenGL??? I'm a DirectX guy...
      Mr.Mike
      Author, Programmer, Brewer, Patriot
    • RE: Coding OpenGL in Visual C++.net

      you might not have all the openGL lib's included!

      #pragma comment(lib, "opengl32.lib")
      #pragma comment(lib, "glu32.lib")
      #pragma comment(lib, "glaux.lib")

      does that appear in your code??

      i dont think glut is included(and i dont know what the libs are for it)

      I can find out if you need it though:)
      Bakka mitai!!!
    • RE: Coding OpenGL in Visual C++.net

      Well, I got the tutorial & source code from the OpenGL website. The source code they gave didn't mention what you wrote, it only stated teh #include <gltk.h> header file. If you could find oout, I'd really appreciate it, thanks!
    • RE: Coding OpenGL in Visual C++.net

      hi again :)

      I added...

      #pragma comment(lib, "opengl32.lib")
      #pragma comment(lib, "glu32.lib")
      #pragma comment(lib, "glaux.lib")

      ...but to no avail. Thanks for the help though!

      I need to take a step back from coding. I got so absorbed in it last week that I forgot about the tests I had to take in my classes, (whoops!) and besides I need to let my brain digest what its learned in the past 48hours.
    • Presumably you have the latest OpenGL version installed, and have ensured that the directory path is set up.

      Have you tried commenting it out and compiling it without it?

      What OS are you running? My googling suggested that gltk.h is used on non Windows machines to provide the link between OpenGL and the window. The tk library appears to be a seperate entity to OpenGL and you may have to investigate that further.

      I don't know anything about OpenGL myself, but I've heard a lot of good things about this site.
      pan narrans
    • Hi!
      Do you mean have I installed a SDK for OpenGL? If that's what you mean, I haven't done that. It didn't occur to me to do that until just now. :( For the OS, I'm running on WinXP. Thanks for pointing out that website, it looks pretty informative. I kinda gave up on OpenGL for now...found a lot mroe on Direct X. Thanks again! :D
    • gltk.h looks like it might be a Glut header

      if you want to continue on with GL set up a regular window using windows.h instead of using glut..
      glut is interesting.. a friend of mine made a simple renderer that got incredibly high frame rates using glut

      .

      If you go to the NEHE site i think they use a regular window instead of glut..

      When you are using openGL you have to remember to include the libraries.. the reason that code isn't working is cuz it doesn't look like the GLUT libraries are included
      Bakka mitai!!!
    • yes, i'm using visual studio .net to compile. from where i stand now, my next step is to buy a book. i'll understand things better that way i guess. to be perfectly honest with everyone, my "facination" with OpenGL stems from the SW:JK series...can you tell that I'm a newbie? ;) either way, thanks to everyone for the advise, i reall appreciate it. :)
    • This topic has been overly analyzed, but i thought i would give you my take on it anyways ... gltk.h is a tcl/tk xor gtk header. unless you are using linux (since you are compiling in vs.net, it is safe to assume you are not) you would need to migrate the code to run under win32/wgl xor glut32.

      10: get and install the glut32 binaries from xmission.com/~nate/glut.html

      20: begin the painful process of replacing the gltk specific calls to glut || find a new tutorial that natively uses win32/wgl OR glut.h.

      hope this helps ... not that you will ever read it :] .