OpenGL tutorial

  • (2 Pages)
  • +
  • 1
  • 2

22 Replies - 14259 Views - Last Post: 01 June 2010 - 11:19 AM Rate Topic: -----

#1 Latous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 12-November 09

OpenGL tutorial

Posted 30 May 2010 - 08:43 AM

Hello out there I would like you assistance on something concerning OpenGL. I would like to start OpenGL programing but every single tutorial I find out there is a little misleading. First of all even when I copy their code i cant run the program. I should let you know that I'm running Dev-Cpp. Anyway I'm only interested in basic 2-D OpenGL stuff (basic shapes and how to print out pictures from your computer, maybee how to rotate and enlarge,minimize stuff). Please tell me what should I do to be able to achieve so. Consider my PC as a newly formated one, running windows 7, and I just downloaded Dev-Cpp. Tell me what i have to download, install and everything please.

Thank you in advance for you help

Is This A Good Question/Topic? 0
  • +

Replies To: OpenGL tutorial

#2 eker676  Icon User is offline

  • Software Engineer
  • member icon

Reputation: 378
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: OpenGL tutorial

Posted 30 May 2010 - 08:51 AM

Have you seen this:

http://nehe.gamedev.net/

http://www.codecolony.de/opengl.htm
http://www.naturewiz...torial0102.html
http://www.opengl.or...de/category/C22

This post has been edited by eker676: 30 May 2010 - 08:53 AM

Was This Post Helpful? 0
  • +
  • -

#3 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: OpenGL tutorial

Posted 30 May 2010 - 09:16 AM

Do you actually have a good foundation as a programmer? Are you comfortable with writing programs of complexity in C? If you need complete handholding, you shouldn't be starting with OpenGL.
Was This Post Helpful? 0
  • +
  • -

#4 Latous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 12-November 09

Re: OpenGL tutorial

Posted 30 May 2010 - 12:49 PM

I followed the nehe tutorial witch was pretty good for me. Problem is even when i downloaded his code and added the glaux.h that was missing i get an error about every GL function which goes: "[Linker Error] undefined reference to 'function@line'"

There is such an error for each and every GL function that this tutorial uses. I thought that maybe the .lib files haven't been installed correctly. just for the record when i checked the header files i found out that all the functions were declared but the code for them was missing.
Was This Post Helpful? 0
  • +
  • -

#5 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: OpenGL tutorial

Posted 30 May 2010 - 01:08 PM

Quote

i found out that all the functions were declared but the code for them was missing
You must link to the opengl library. Google on how to do this.
Was This Post Helpful? 0
  • +
  • -

#6 Latous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 12-November 09

Re: OpenGL tutorial

Posted 30 May 2010 - 01:40 PM

I can find innumerable things about "link" and "libraries" on google. Please be more specific about what I have to search about
.
Was This Post Helpful? 0
  • +
  • -

#7 jjl  Icon User is offline

  • Engineer
  • member icon

Reputation: 1112
  • View blog
  • Posts: 4,619
  • Joined: 09-June 09

Re: OpenGL tutorial

Posted 30 May 2010 - 01:47 PM

Google "link opengl c++" and click the very first link :nottalkingtoyou:

This post has been edited by ImaSexy: 30 May 2010 - 01:48 PM

Was This Post Helpful? 0
  • +
  • -

#8 Latous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 12-November 09

Re: OpenGL tutorial

Posted 31 May 2010 - 10:33 AM

I still dont get it. The first link is http://nehe.gamedev.net/ which makes no sense. Could you give me some guidelines on how to do this please?
Was This Post Helpful? 0
  • +
  • -

#9 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: OpenGL tutorial

Posted 31 May 2010 - 10:53 AM

Quite odd. You should definitely have run into: OpenGL FAQ. There is a section in the FAQ titled "What do I need to compile and run OpenGL programs?". It mentions that the libraries to link to are "opengl32.lib", "glut32.lib", and "glu32.lib". You'll obviously link to opengl32, and glu if you use that as well. Same for glut, if you need that.

In Dev-C++, like in other IDEs, you can set project options. One of those options is additional library paths and libraries to link. So you need to indicate the opengl library.

EDIT: And, I should ask, is there any particular reason you are not using Visual C++?

This post has been edited by Oler1s: 31 May 2010 - 10:59 AM

Was This Post Helpful? 0
  • +
  • -

#10 Latous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 12-November 09

Re: OpenGL tutorial

Posted 31 May 2010 - 11:13 AM

Im not used to visual C++ thats all.

Here is another one: In Dev-Cpp/lib there are no .lib files. All files are lib<filename>.a. Is taht a problem?
Was This Post Helpful? 0
  • +
  • -

#11 JITHU  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 62
  • View blog
  • Posts: 201
  • Joined: 02-July 07

Re: OpenGL tutorial

Posted 31 May 2010 - 11:14 AM

No one mentioned this site here: http://videotutorialsrock.com/
Was This Post Helpful? 0
  • +
  • -

#12 Latous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 12-November 09

Re: OpenGL tutorial

Posted 31 May 2010 - 11:22 AM

Just for the record when i tried using VC++ i ended up getting errors like this: "1>OpenGL.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)"
Was This Post Helpful? 0
  • +
  • -

#13 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: OpenGL tutorial

Posted 31 May 2010 - 11:25 AM

Quote

Here is another one: In Dev-Cpp/lib there are no .lib files. All files are lib<filename>.a. Is taht a problem?
No. The .a ending and beginning with lib is just a naming convention. It's followed on certain unices like linux. The compiler you are using is MinGW, which in turn is a gcc port, which in turn is a nix compiler. Hence, the naming scheme.

That said, library files are compiler specific. Regardless of naming scheme.

Quote

Just for the record when i tried using VC++ i ended up getting errors like this: "1>OpenGL.obj : error LNK2019: unresolved external symbol _gluPerspective@32 referenced in function "void __cdecl ReSizeGLScene(int,int)" (?ReSizeGLScene@@YAXHH@Z)"
Umm..yes. Those would be linker errors. Because you are using glu functions, without linking to the glu library.

Do read the errors. error LNK*** which means linker error. Unresolved external symbol. You used a function, but the compiler can't find the function definition. Either you must provide the code, or provide a library.

This post has been edited by Oler1s: 31 May 2010 - 11:27 AM

Was This Post Helpful? 0
  • +
  • -

#14 Latous  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 25
  • Joined: 12-November 09

Re: OpenGL tutorial

Posted 31 May 2010 - 12:11 PM

Well I know I am most probably annoying you by being this stupid but please bear with it. Even if i link the lib file to it it doesn't solve anything. I noticed that in the lib directory there is no OpenGL32.lib or the other OpenGL libraries. I tries downloaded them but all i can find is glut, tones of glut a not a trace of OpenGL32. Any ideas?

This post has been edited by Latous: 31 May 2010 - 12:28 PM

Was This Post Helpful? 0
  • +
  • -

#15 Oler1s  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1395
  • View blog
  • Posts: 3,884
  • Joined: 04-June 09

Re: OpenGL tutorial

Posted 31 May 2010 - 12:35 PM

Quote

Well I know I am most probably annoying you by bing this stupid but please bear with it.
It's not being stupid. The problem is that you are skipping fundamentals. It's like teaching someone calculus and discovering they don't understand some fundamental algebraic concepts. What do you say then?

These linker errors aren't OpenGL specific. You should have encountered them as a beginner. You should have learned to confront and deal with these errors during that time. Instead, a lot of your fumbling about is because you haven't confronted any of these issues before, which you should have. So now, in addition to learning OpenGL, you have to learn everything else. You are obviously struggling here. I am not calling you stupid. But I do see you stumbling about on things you should be able to handle.

Quote

I noticed that in the lib directory there is no OpenGL32.lib ot the other OpenGL libraries.
You are looking in the right directory, right? The opengl libraries come as part of the windows sdk. When you install Visual Studio or Visual C++ Express, the Windows SDK is also installed. By default it's in Program Files / Microsoft SDKs.

Quote

I tries downloaded them
There's warnings stamped about on the OpenGL sites and wiki, but you don't download OpenGL. It's not a software product. It's implemented by your platform. On Windows, it's implemented by Microsoft. You get the header and the libraries from the Windows SDK.

You can download Glut because that's just another library of code for working with OpenGL. It's not an OpenGL implementation.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2