|
Post by dw817 on Apr 26, 2009 19:52:34 GMT -5
Man, this is why I stick with BASIC coding ...
|
|
|
Post by dw817 on Apr 26, 2009 20:47:28 GMT -5
|
|
|
Post by Adam on Jan 10, 2010 15:13:35 GMT -5
|
|
|
Post by shadow008 on Jan 11, 2010 8:04:35 GMT -5
... well.... i was expecting to see a page on creating an open gl compatible window in c++ but instead i get a link... that doesnt work?
|
|
|
Post by Adam on Jan 11, 2010 9:16:43 GMT -5
hmm... thats really weird, it worked last night.. but I just went back to the site and none of them work o.o I only have 5 minutes... but.. pretty much this shows you how to do this ( i wrote it while i was learning a while back and hopefully that site will work again soon) =\ #include <GL/gl.h> #include <GL/freeglut.h> #include <stdlib.h>
void display() { glClearColor(0,0,0,1); glClear(GL_COLOR_BUFFER_BIT); glLoadIdentity();
glutSwapBuffers(); }
void reshape (int w, int h) { glViewport (0, 0, (GLsizei)w, (GLsizei)h); glMatrixMode (GL_PROJECTION); glLoadIdentity (); gluPerspective (60, (GLfloat)w / (GLfloat)h, 1.0, 100.0); glMatrixMode (GL_MODELVIEW); }
void keyboard(unsigned char key, int x, int y) { if(key==27) exit(0); }
int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode (GLUT_DOUBLE); glutInitWindowSize (500, 500); glutInitWindowPosition(100,100); glutCreateWindow("Title"); glutDisplayFunc(display); glutIdleFunc(display); glutReshapeFunc (reshape); glutKeyboardFunc(keyboard); glutMainLoop(); return 0; } and you need to make it a code blocks project, plus you need freeglut installed hereand set up the linker which i have to go so i will say when i get back (stupid school >.>) EDIT:\ The link above works now, i think it may have been temporary server problems or something
|
|