From owner-freebsd-questions@FreeBSD.ORG Mon Nov 1 10:36:38 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 83B3E16A4CE for ; Mon, 1 Nov 2004 10:36:38 +0000 (GMT) Received: from out-1.mail.amis.net (out-1.mail.amis.net [212.18.32.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 943C743D4C for ; Mon, 1 Nov 2004 10:36:37 +0000 (GMT) (envelope-from karel.miklav@siol.net) Received: from localhost (in-2.mail.amis.net [212.18.32.19]) by out-1.mail.amis.net (Postfix) with ESMTP id 47AF95B4B5D for ; Mon, 1 Nov 2004 11:36:36 +0100 (CET) Received: from in-2.mail.amis.net ([127.0.0.1]) by localhost (in-2.mail.amis.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 99880-01 for ; Mon, 1 Nov 2004 11:36:33 +0100 (CET) Received: from piranha.amis.net (piranha.amis.net [212.18.32.3]) by in-2.mail.amis.net (Postfix) with ESMTP id D22FA228609 for ; Mon, 1 Nov 2004 11:36:33 +0100 (CET) Received: from siol.net (ppp3-052.dialup.amis.net [212.18.34.180]) by piranha.amis.net (Postfix) with ESMTP id 08EDDFD9D for ; Mon, 1 Nov 2004 11:36:32 +0100 (CET) Message-ID: <41861FD5.5040809@siol.net> Date: Mon, 01 Nov 2004 12:36:53 +0100 From: Karel Miklav User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040115 X-Accept-Language: en-us, en, sl, hr MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at amis.net X-Spam-Status: No, hits=-5.899 required=5 tests=ALL_TRUSTED, BAYES_00 X-Spam-Level: Subject: Problems compiling sample OpenGL apps . X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2004 10:36:38 -0000 Some example apps. that work perfectly under Mandrake are not built properly in FreeBSD 5.3 RC1 / X.Org. All I get is a window filled with whatever was behind it. Glxgears run well, everything is compiled and linked without any problem. If I play with the order of GL libraries linked, there is some improvement, but the display is garbled and there's no animation. Anybody have any idea what am I doing wrong? -- Regards, Karel -- > cat hello.c #include void display(void) { // clear all pixels glClear (GL_COLOR_BUFFER_BIT); //draw white polygon 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 color glClearColor (0.8, 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); } 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; } > cat makefile CC = gcc INCLUDES = -I/usr/include LLDLIBS = -lglut -lGLU -lGL -lXmu -lXext -lX11 -lm -L/usr/X11R6/lib TARGETS = hello all: default default: $(TARGETS) .c.o: $(CC) -c $(INCLUDES) $< $(TARGETS): $$@.o $(CC) $@.o $(LLDLIBS) -o $@ clean: -rm -f *.o *~ $(TARGETS)