Sign in to follow this  
Alkhimey

#gl/glut.h

Recommended Posts

Alkhimey    122
I fund this code here: http://www.gamedev.net/download/redbook.pdf I tried to compile it under Dev c++ 4.9.9.2 and it gives me an error: "gl/glout.h, no such file". I am confused... Is this file excist or not? #include <GL/gl.h> #include <GL/glut.h> void display(void) { /* clear all pixels */ glClear (GL_COLOR_BUFFER_BIT); /* draw white polygon (rectangle) with corners at * (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) http://heron.cc.ukans.edu/ebt-bin/nph-dweb/dyna...G/@Generic__BookTextView/622;cs=fullhtml;pt=532 (10 of 16) [4/28/2000 9:44:16 PM] */ glColor3f (1.0, 1.0, 1.0); glBegin(GL_POLYGON); glVertex3f (0.25, 0.25, 0.0); glVertex3f (0.75, 0.25, 0.0); glVertex3f (0.75, 0.75, 0.0); glVertex3f (0.25, 0.75, 0.0); glEnd(); /* don't wait! * start processing buffered OpenGL routines */ glFlush (); } void init (void) { /* select clearing (background) color */ glClearColor (0.0, 0.0, 0.0, 0.0); /* initialize viewing values */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); } /* * Declare initial window size, position, and display mode * (single buffer and RGBA). Open window with "hello" * in its title bar. Call initialization routines. * Register callback function to display graphics. * Enter main loop and process events. */ int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (250, 250); glutInitWindowPosition (100, 100); glutCreateWindow ("hello"); init (); glutDisplayFunc(display); glutMainLoop(); return 0; /* ISO C requires main to return int. */ } Here is also the compilation log: Êîìïèëÿòîð: Default compiler Building Makefile: "D:\hjh\Makefile.win" Âûïîëíåíèå make... make.exe -f "D:\hjh\Makefile.win" all g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" main.cpp:2:21: GL/glut.h: No such file or directory main.cpp: In function `int main(int, char**)': main.cpp:41: error: `glutInit' undeclared (first use this function) main.cpp:41: error: (Each undeclared identifier is reported only once for each function it appears in.) main.cpp:42: error: `GLUT_SINGLE' undeclared (first use this function) main.cpp:42: error: `GLUT_RGB' undeclared (first use this function) main.cpp:42: error: `glutInitDisplayMode' undeclared (first use this function) main.cpp:43: error: `glutInitWindowSize' undeclared (first use this function) main.cpp:44: error: `glutInitWindowPosition' undeclared (first use this function) main.cpp:45: error: `glutCreateWindow' undeclared (first use this function) main.cpp:47: error: `glutDisplayFunc' undeclared (first use this function) main.cpp:48: error: `glutMainLoop' undeclared (first use this function) make.exe: *** [main.o] Error 1 Âûïîëíåíèå çàâåðøåíî

Share this post


Link to post
Share on other sites
deavik    570
Hey Alkhimey go to this page, scroll down to the bottom. mesa3lib.zip contains all include files and stuff, mesa3dll.zip the glut dll file which you will need to put in the application directory or where all your other dll files live. Cheerio!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this