Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: linux framework

  1. #1
    Intern Contributor
    Join Date
    Apr 2000
    Location
    Austria
    Posts
    57

    linux framework

    hi,

    could someone send me a simple openGL framework app ( res. switching, init code,..) for linux? i dont need special fx, just the setup would be cool...

    thanks in advance,

    sebastian ( sebastian_posch@c4.com )

  2. #2
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    418

    Re: linux framework

    Originally posted by sebastian:
    hi,

    could someone send me a simple openGL framework app ( res. switching, init code,..) for linux? i dont need special fx, just the setup would be cool...
    The easiest way to get started is with GLUT

    Code :
    int main(int argc, char *argv[])
    {
            glutInit(&argc, argv);
            glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
            glutInitWindowSize(640, 480);
            glutCreateWindow(argv[0]);
     
            /* Initialise stuff */
            init();
     
            /* Register callbacks */
            glutDisplayFunc(displayCallback);
            glutMouseFunc(mouseCallback);
            glutIdleFunc(idleCallback);
     
            glutMainLoop();
            return 0;
    }
    Here's a simple Makefile:

    Code :
    CFLAGS = -Wall  -I/usr/X11R6/include/ -O2 -g
     
    LDFLAGS = -L/usr/X11R6/lib -lGL -lGLU -lglut
     
    PROG = my_executables_name
     
    SRC = main.c somethingelse.c blah.c
     
    OBJ = $(SRC:.c=.o)
     
    all: $(PROG)
     
    $(PROG): $(OBJ) Makefile
            $(CC) -o $@ $(OBJ) $(LDFLAGS)
     
    $(OBJ): Makefile
    Hope this helps

  3. #3
    Junior Member Newbie
    Join Date
    Apr 2000
    Location
    FRANCE
    Posts
    22

    Re: linux framework

    You can use:

    - Plain X commands, not difficult but not very friendly

    - Use a third party library: glut or better, SDL, the last version (1.1.5) is really better than GLUT (true full screen, can change video mode, advanced event handling, sound support etc...). Check it at: http://www.libsdl.org/

  4. #4
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    418

    Re: linux framework

    Originally posted by MC:

    - Use a third party library: glut or better, SDL, the last version (1.1.5)
    Doh! How could I forget to mention
    the fine SDL library? :P

    Just to second what MC says,
    yes, SDL is also a good thing to use to
    quickly get started.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •