![]() |
|
#1
|
|||
|
|||
GLUT/openGL beginner help!can someone please explain how exactly i can link the GLUT files i have downloaded with visual studio 2005 so i can start using opengl and compiling programs? i cant seem to get anything running properly.
|
|
#2
|
|||
|
|||
Re: GLUT/openGL beginner help!Try the openGL forum under "Computer Programming Forums". They will be of much better help.
|
|
#3
|
|||
|
|||
Re: GLUT/openGL beginner help!Quote:
Here's one way. There are other ways, but I think this requires the fewest changes to your environment or tool settings. I assume that you have (at least) the three following files from your download (maybe from http://www.xmission.com/~nate/glut.html) glut.h glut32.dll glut32.lib You have to put glut32.dll in a directory where Windows will look for executables. On my Windows XP workstation I copied it to C:\Windows\system32 If you installed Windows XP on some other disk drive, put the dll in that drive's \Windows\system32 directory You have to put glut32.lib in a directory where the Visual C++ linker can find it. For my Visual C++ 2005 Express program I installed it at the default location, C:\Program Files\Microsoft Visual Studio 8 In that directory there is a subdirectory VC and there is a lib directory below that where the linker will look for libraries So, I copied glut.lib to C:\Program Files\Microsoft Visual Studio 8\VC\lib You have to put glut.h in a directory where the Visual C++ compiler can find it. The default path for include files in my installation is C:\Program Files\Microsoft Visual Studio 8\VC\include Most OpenGL programs that I see floating around have something like the following: CPP / C++ / C Code:
So I created a GL directory under the include directory and copied glut.h to C:\Program Files\Microsoft Visual Studio 8\VC\include\GL You could also copy glut.h to C:\Program Files\Microsoft Visual Studio 8\VC\include Then the compiler can still find it if the program has CPP / C++ / C Code:
Now, open the IDE for Visual studio Create a new project: a Win32 Console Application. (I always uncheck the "precompiled headers box when I see it, since, in my experience it's more trouble than it's worth. But that's just me.) Anyhow you should end up with a "solution" with a couple of files in it. Paste your OpenGL application's main program file into the source file of the "solution." I strongly recommend that you rename it to a ".c" file instead of the default ".cpp" file since OpenGL is a C-based application. If you have other source files and/or local headers, add them to the project. Compile and run. Note that running the application from inside the IDE is slower than running it from a command line. For debugging that's OK, but when you get ready to run it for real, use the command line. Note also that if you are going to run the program on another computer that doesn't have the glut stuff installed, you will have to copy the glut.dll to that computers Windows\system32 folder on that machine. (You won't need glut.h or glut.lib on the other computer). Regards, Dave |
|
#4
|
|||
|
|||
Re: GLUT/openGL beginner help!thanks a lot for that, that was exactly what i was looking for! im up and running now.
|
|
#5
|
|||
|
|||
Re: GLUT/openGL beginner help!Now that i have had time to mess around in openGL a bit...
I have gone through the first 5 tutorials at http://nehe.gamedev.net/ , and i have a good grasp on these concepts. In the following tutorials he goes on to more advanced 3d development and game design, but I want to stick to 2d graphics and master the basics of 2d game design, such as getting shapes to move, controlling shapes from the keyboard, and using collision detection with 2d shapes. I would like to eventually make games similar to Glaxian, Tetris, Pong, Breakout, etc. If anyone could point me in the right direction, i would like a tutorial or perhaps a book that would clearly cover these topics. Thanks for all of your help, it is appreciated more than you know. |
Recent GIDBlog
First week of IA training by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Absolute beginner, need help! | the code hunter | Java Forum | 7 | 27-Sep-2006 19:07 |
| Beginner | Disfunctional04 | MS Visual C++ / MFC Forum | 5 | 01-May-2006 09:46 |
| Suggestions for beginner | Propain | CPP / C++ Forum | 1 | 16-Mar-2005 20:46 |
| C++ Beginner | JYGUTI | C Programming Language | 2 | 31-Jan-2005 14:13 |
| Help a beginner with apache pls... | seta21 | Apache Web Server Forum | 3 | 27-Nov-2004 08:27 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The