Beginners oGL fun...

Started by
15 comments, last by Juicy 21 years, 6 months ago
Just to add to what Joe said, if you don''t want to bother editing the project settings every time you want to make an oGL app, you can instruct the compiler to link the required libraries with a coupla lines at the start of code:

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

This is a compiler directive, and tells the compiler to tell the linker to include those libraries in the build even if they''re not explicity mentioned in the project settings.

HTH

www.coldcity.com
code, pics, life
[size="2"]www.coldcity.com code, art, life
Advertisement
is the #pragma is MSVC specific? What if I use some other compiler...
say .. MingW? (GNU GCC port for windows)
Aren''t there plenty of tutorials about this kind of thing already? Try NeHe''s site (hosted here on GameDev.net).

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
varokasp: I believe it''s MSVC-specific; there may be an equivalent setting for MingW or the libraries to link with may only be specified in project settings/command line options/whatever (don''t know the compiler)

siaspete: He already has tried NeHe.

www.coldcity.com
code, pics, life
[size="2"]www.coldcity.com code, art, life
quote:Original post by siaspete
Aren't there plenty of tutorials about this kind of thing already? Try NeHe's site (hosted here on GameDev.net).

Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions


Sometimes, especially when you're a beginner, wading through 30 to 50 tutorials is like wading through a textbook written in Greek. And even when you do take it slow, sometimes you miss 1 or 2 important facts that totally stop you. For example, I'm learning from the Game Programming with OpenGL book mentioned on NeHe's site and I missed the line that said to add those 2 libraries. I had to ask a friend for help when I got the linker errors.

I see nothing wrong with coming on and asking a specific question - if someone knows the answer off the top of his head and it's a simple thing like what I typed it can be worth the time.

Having said that, you're right that there are some people who simply don't want to do their own thinking and abuse forums like these, but I don't think Juicy is that kind of person, and besides, people who don't at least TRY to dig into MSDN or google or sites like that to look for answers are doing themselves a HUGE disservice IMHO - you can really learn a lot accidentally!

[edited by - DalTXColtsFan on October 2, 2002 10:14:18 AM]
quote:Original post by IainC
Just to add to what Joe said, if you don''t want to bother editing the project settings every time you want to make an oGL app, you can instruct the compiler to link the required libraries with a coupla lines at the start of code:

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

This is a compiler directive, and tells the compiler to tell the linker to include those libraries in the build even if they''re not explicity mentioned in the project settings.

HTH

www.coldcity.com
code, pics, life


I did not know this - thank you!
quote:Original post by DalTXColtsFan
Having said that, you''re right that there are some people who simply don''t want to do their own thinking and abuse forums like these, but I don''t think Juicy is that kind of person, and besides, people who don''t at least TRY to dig into MSDN or google or sites like that to look for answers are doing themselves a HUGE disservice IMHO - you can really learn a lot accidentally!


if they don''t think, they just download the nehe tutorial, unzip it and see it works! _then_ they might ask why it works, and why there is no need for some specific opengl libraries, and they guess its already there...


btw, try sdl (www.libsdl.org) its great as well, i use it all the time..

"take a look around" - limp bizkit
www.google.com
If that's not the help you're after then you're going to have to explain the problem better than what you have. - joanusdmentia

My Page davepermen.net | My Music on Bandcamp and on Soundcloud

This topic is closed to new replies.

Advertisement