Results 1 to 2 of 2

Thread: glut build framework

  1. #1
    Guest

    glut build framework

    hello,

    where can i find an simple glut example with framework for bulding it unter linux/gcc/mesa/glut (make-file) and under windows/visualc6/glut (dsw/dsp file)

    can someone send (freakdev@gmx.net) me an link ... thx

    its for a porting project

    ciao freakdev

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2000
    Location
    Gastonia, NC, USA
    Posts
    2,068

    Re: glut build framework

    Here is a piece of glut code, should work under ether windows or linux without any change. The program just open's a window, does not draw anything. Press "ESC" key to exit.

    Code :
    #include <GL/glut.h>
    #include <stdlib.h>
     
    void keyboard (unsigned char key, int x, int y)
    {
       switch (key) {
          case 27:
             exit(0);
             break;
          default:
             break;
       }
     
    }
     
    void reshape (int w, int h)
    {
    	// Window size has changed stuff goes here.
       glClearColor (0.0, 0.0, 0.0, 0.0);
       glViewport (0, 0, (GLsizei) w, (GLsizei) h);
       glMatrixMode (GL_PROJECTION);
       glLoadIdentity ();
    }
     
    void display(void)
    {
    	//GL drawing stuff here.
    	glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
     
     
        glutSwapBuffers();
    }
     
    int main(int argc, char** argv)
    {
       glutInit(&amp;argc, argv);
       glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB);
       glutInitWindowSize (500, 500);
       glutInitWindowPosition (100, 100);
       glutCreateWindow (argv[0]);
       glutSetWindowTitle("Glut window");
       glutDisplayFunc(display);
       glutReshapeFunc(reshape);
       glutKeyboardFunc(keyboard);
       glutMainLoop();
       return 0;
    }
    Originally posted by freakdev:
    hello,

    where can i find an simple glut example with framework for bulding it unter linux/gcc/mesa/glut (make-file) and under windows/visualc6/glut (dsw/dsp file)

    can someone send (freakdev@gmx.net) me an link ... thx

    its for a porting project

    ciao freakdev

Similar Threads

  1. GLUT Object-Oriented Framework for Beginners
    By Paul Solt in forum OpenGL: General
    Replies: 0
    Last Post: 08-22-2010, 10:36 AM
  2. trying to build app using glut
    By dovkruger in forum OpenGL: macOS
    Replies: 3
    Last Post: 12-06-2007, 08:11 AM
  3. Can't build GLUT on Redhat 7.2!
    By in forum OpenGL: Linux
    Replies: 1
    Last Post: 03-16-2002, 01:09 AM
  4. compiling GLUT framework from Apple
    By laf in forum OpenGL: macOS
    Replies: 1
    Last Post: 03-12-2002, 03:46 PM
  5. Need help getting glut program to build
    By MrMorden in forum OpenGL: Basic Coding
    Replies: 11
    Last Post: 09-19-2000, 02:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean