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 )

Originally posted by sebastian:
[b]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…
[/b]

The easiest way to get started is with GLUT

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:

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

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/

Originally posted by MC:
[b]

  • Use a third party library: glut or better, SDL, the last version (1.1.5) [/b]

Doh! How could I forget to mention
the fine SDL library? :stuck_out_tongue:

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

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.