OpenGL q's
I have a dilemma. I used the NeHe OpenGL tutorials, and I can't even create a window. in main.c, i used ZeroLink, and it built fine, but quit on start. i disabled ZeroLink, and it returned a warning an an error:
opengl mainframe:0: Undefined symbols: _DrawGLScene _InitGL _ReSizeGLScene
opengl mainframe:0: warning prebinding disabled because of undefined symbols
BTW, here is the code:
opengl mainframe:0: Undefined symbols: _DrawGLScene _InitGL _ReSizeGLScene
opengl mainframe:0: warning prebinding disabled because of undefined symbols
BTW, here is the code:
Code:
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#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;
}It's not magic, it's Ruby.
I'm not quite sure where you are with those tutorials, but if you're at the stage where you're just trying to get a window to appear, you're nearly there apart from the fact you haven't defined the functions. You've got prototypes, but you still need to add the following before your main() line:
This code won't do anything much because there's no code in the functions, but it will eliminate your link errors.
EDIT: In case it isn't obvious, don't remove the prototypes when you insert the functions. You (usually) want both.
Code:
GLvoid InitGL(GLvoid)
{
}
GLvoid DrawGLScene(GLvoid)
{
}
GLvoid ReSizeGLScene(int Width, int Height)
{
}EDIT: In case it isn't obvious, don't remove the prototypes when you insert the functions. You (usually) want both.
Get the source code from http://webpages.charter.net/utopiaplanet...Struct.dmg
You may not understand all of it in the beginning, but it will show you how to create a window, play sounds, read mouse and keyboard, read and save preferences, load textures (PNG, TGA, JPG), all with Carbon, CoreAudio, and OpenGL.
You may not understand all of it in the beginning, but it will show you how to create a window, play sounds, read mouse and keyboard, read and save preferences, load textures (PNG, TGA, JPG), all with Carbon, CoreAudio, and OpenGL.
Cool. Thanx guys!
It's not magic, it's Ruby.
new problem:
on lesson 2, it says, when I return TRUE, that TRUE is undeclared. Why?
on lesson 2, it says, when I return TRUE, that TRUE is undeclared. Why?
It's not magic, it's Ruby.
Probably because it's not. Try "true" instead of "TRUE". You could also define it yourself by:
Code:
#define TRUE 1
#define FALSE 0
Personally, I never trust TRUE and FALSE to be defined. I always just use 1 and 0. Same difference.
Alex Diener
Alex Diener
ahh, I see. It's been A while since I used C, normally sticking with OBJ-C.
one more problem, (yes, i know). it runs fine, makes a triangle and a square, but thee window is automatically minimized. Any idea why?
one more problem, (yes, i know). it runs fine, makes a triangle and a square, but thee window is automatically minimized. Any idea why?
It's not magic, it's Ruby.

