NeHe example
Ok, I am starting to learn OpenGL. I found NeHe's excellent examples but am having a problem. I have the code the setup a window and OpenGLView, but I dont want to go that route. I am working on a few game ideas, and want to try and keep them portable. When I run through the first example and try to setup a new project as they suggest, I get an error on the link. Here is what I have:
Also I have link the following frameworks: Cocoa.framework, GLUT.framework, and OpenGL.framework. It will compile no problem, but when it links I get the following error:
Now, what am I missing???
Code:
#include <OpenGL/gl.h> // Header File For The OpenGL32 Library
#include <OpenGL/glu.h> // Header File For The GLu32 Library
#include <GLUT/glut.h> // Header File For The GLut Library
#define kWindowWidth 400
#define kWindowHeight 300
GLvoid InitGL(GLvoid);
GLvoid DrawGLScene(GLvoid);
GLvoid ReSizeGLScene(int Width, int Height);
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowSize (kWindowWidth, kWindowHeight);
glutInitWindowPosition (100, 100);
glutCreateWindow (argv[0]);
InitGL();
glutDisplayFunc(DrawGLScene);
glutReshapeFunc(ReSizeGLScene);
glutMainLoop();
return 0;
}Also I have link the following frameworks: Cocoa.framework, GLUT.framework, and OpenGL.framework. It will compile no problem, but when it links I get the following error:
Code:
/usr/bin/ld: Undefined symbols:
_DrawGLScene
_InitGL
_ReSizeGLSceneNow, what am I missing???
Ok, got it working. Forgot to add some other functions
Well it is a little slow... Maybe I should just use the Cocoa OpenGLView instead...
Well it is a little slow... Maybe I should just use the Cocoa OpenGLView instead...
<Begin Shameless Plug>
See nehe's cocoa basecode ( on the left of the main page ). The Cocoa structure is kept to a minimum while the rest of the base is pure C++/OpenGL ( i.e. very easy to port ).
See nehe's cocoa basecode ( on the left of the main page ). The Cocoa structure is kept to a minimum while the rest of the base is pure C++/OpenGL ( i.e. very easy to port ).
Yes I grabbed that right before heading to work today. I will use it until I make my own. Thanks!
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Errors With NeHe OpenGL Guide | SamGray | 1 | 2,317 |
Sep 6, 2009 02:36 PM Last Post: AnotherJake |
|
| NeHe revival? | Duane | 20 | 7,466 |
Jul 11, 2007 09:57 AM Last Post: AnotherJake |
|
| nehe tutorials - fullscreen | Michael | 5 | 3,826 |
Oct 28, 2004 08:08 AM Last Post: Michael |
|
| NeHe and OpenGL Inconsistencies | Justin Brimm | 4 | 3,211 |
Jul 11, 2003 08:18 AM Last Post: Feanor |
|

