Advertisement

need help in opening gl window with glut?

Started by January 12, 2003 05:12 AM
0 comments, last by n0n4m3 22 years, 1 month ago
Hi, could somebody tell what''s wrong in this code? why do i get-> "call to undefined function ''init'' " "undefined symbol ''display'' " errors, iam using borland c++ 5.02, OS W2K, i know that this question is stupid, but iam a real newbie, who expects somebody will help him a bit, plz. #include <gl\glut.h> int main(int argc, char** argv) { glutInit (&argc, argv) ; glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB) ; glutInitWindowSize (400, 100) ; glutInitWindowPosition (100, 100) ; glutCreateWindow ("Could somebody help me?") ; init() ; glutDisplayFunc (display) ; glutMainLoop () ; return 0 ; } void init(void) { glClearColor(1.0, 1.0, 1.0, 0.0) ; glShadeModel(GL_FLAT) ; } void display(void) { glClear(GL_COLOR_BUFFER_BIT) ; glutSwapBuffers() ; } btw is W2K 100% compatible with opengl and all stuff related with it?
In the case the code above is NOT a joke, try moving the display() func before main(), or if you don't like it, prototypize it (this means, put "void display(void);" before the main()). The compiler does not know what display is if you define it after calling...

Oh sorry, forgot to tell you that the same applies to init().



BTW, to people writing here, what books do you have about GL/graphics and how much do you rate them? I currently have

OpenGL superbible 2nd edition: 8/10, 7/10 if you're not interested to win32 programming.
OpenGL game programming: 6.5/10 - i always take the superbible and the CD which come with it misses the sources, i had to download them.
RealTime rendering: 9/10! It has EVERYTHING you need but it's math-oriented and does NOT teach you programming (only algorithms and ideas, some pseudocode).


I think schools in general cannot be good at teaching GL, graphics evolves way too fast for istitutions to handle and it may take a year to go for texturing, not to speak about vertex arrays and extensions.

It would be a dream for me to have a GL curse at university... woah.
Do somebody knows a language called SCHEME here?

[edited by - Krohm on January 12, 2003 7:55:20 AM]

Previously "Krohm"

This topic is closed to new replies.

Advertisement