glut not working on RH9?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I just bought and installed RH9 and then manually installed the
glut-3.7-12 and glut-devel-3.7-12 rpms. The following code (see
below) builds and runs, but doesn't display anything. Note that,
glxinfo tells me that direct rending is working (I've got a Matrox
G400), and glxgears proves it. :)

It builds and runs fine on Solaris 8 SPARC (for me here at work).

Is there a problem with glut on RH9?

If not, could you please suggest what I might try to uncover
what the problem is?


[code] // tester.cpp

#include <GL/glut.h>

//================================================
void my_init();
void my_display_func();
void my_reshape_func( int w, int h );

//================================================
int main( int argc, char * argv[] )
{
    glutInit( &argc, argv );
    glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
    glutInitWindowSize( 600, 600 );
    glutInitWindowPosition( 50, 50 );
    glutCreateWindow( "tester" );

my_init();

    glutDisplayFunc( my_display_func );
    glutReshapeFunc( my_reshape_func );

    glutMainLoop();
    return 0;
}

//================================================
void my_init()
{
    glClearColor( 0.0, 0.0, 0.0, 0.0 );
    glEnable( GL_DEPTH_TEST );
}

//================================================
void my_display_func()
{
    glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );

    glColor3f( 0.1, 0.7, 0.3 );
    glBegin( GL_LINE_STRIP );
        glVertex3d(  0.2,  0.2, 0.0 );
        glVertex3d( -0.2,  0.2, 0.0 );
        glVertex3d( -0.2, -0.2, 0.0 );
        glVertex3d(  0.2, -0.2, 0.0 );
    glEnd();

    glutSwapBuffers();
}

//================================================
void my_reshape_func( int w, int h )
{
    if ( w > h )
    {
        glViewport( w/2 - h/2, // x_bottom_left_corner
                    0,         // y_bottom_left_corner
                    h,         // width (x, to the left)
                    h );       // height (y, up)
    }
    else
    {
        glViewport( 0, h/2 - w/2, w, w );
    }

    glMatrixMode( GL_PROJECTION );
    glLoadIdentity();
    gluPerspective( 35.0,  // fovy
                    1.0,   // aspect
                    2.0,   // near
                    6.0 ); // far

    glMatrixMode( GL_MODELVIEW );
    glLoadIdentity();
    gluLookAt( 0.0, 0.0, 4.0,   // eye position
               0.0, 0.0, 0.0,   // looking at
               0.0, 1.0, 0.0 ); // which way is up

    glutPostRedisplay();
}

[/code]

and my makefile is

[code]
# makefile for glut_tester
#

APP_NAME = glut_tester
LIBS = -lglut -lGLU -lGL -L/usr/X11R6/lib -lXmu -lXi

$(APP_NAME): main.o
	g++ main.o -Wall -ansi -pedantic-errors -o $(APP_NAME) $(LIBS)

main.o: main.cpp
	g++ -c main.cpp

clean:
	rm -f $(APP_NAME)
	rm -f *.o

[/code]



_______________________________________________
xfree86-list mailing list
xfree86-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/xfree86-list
IRC: #xfree86 on irc.redhat.com

[Red Hat General]     [Red Hat Watch]     [Red Hat Development]     [Kernel Development]     [Yosemite Camping]

  Powered by Linux