You are not logged in.

#1 2008-02-04 12:04:05

ydwu
Member
Registered: 2008-02-04
Posts: 3

ati open source driver 3D driver claims to not support visual...

Hi

I'm using ati open source driver and compiz fusion with AIGLX , the 3-d desktop effects works fine but when using glxgear or glxinfo it reports:

libGL warning: 3D driver claims to not support visual 0x73

also when i start fusion-icon it reports:

No GLX_EXT_texture_from_pixmap with direct rendering context
 ... present with indirect rendering, exporting: LIBGL_ALWAYS_INDIRECT=1

However the glxinfo output shows that:

direct rendering: Yes

Does anyone know how to fix it?

Last edited by ydwu (2008-02-04 12:15:32)

Offline

#2 2008-02-04 13:28:23

xabbott
Member
From: orlando, fl
Registered: 2007-01-11
Posts: 56
Website

Re: ati open source driver 3D driver claims to not support visual...

You can ignore all of that, it should still run. No, you can't fix it.

Offline

#3 2008-02-04 16:22:13

ydwu
Member
Registered: 2008-02-04
Posts: 3

Re: ati open source driver 3D driver claims to not support visual...

The problem is although dri seems to be  enabled in the glxinfo out put, the opengl program such as compiz-fusion can't use it. And  when i write some simple opengl programs and complie them with gcc, the program runs with the same warning.

A example opengl program using freeglut is here:

/********************************************************************************/

/* Rotating cube with color interpolation                    */
/*                                        */
/* Demonstration of the use of homogeneous coordinate transformations and    */
/* simple data structure for representing the cube from Chapter 4 of        */
/* Interactive Computer Graphics: A Top Down Approach with OpenGL        */

/* by Edward Angel                                */
/*                                        */

/* Modified to use function prototypes and to include lighting            */

/* David Pycock February 2003                            */

/* To avoid the light source rotating with the object the light source must    */

/* be defined in the initialisation routine and the rotation of the cube    */

/* effected in the rotate and display call backs                */

/*                                        */
/* Both normals and colors are assigned to the vertices                */
/* The cube is centered at origin so that (unnormalized) normals are the    */
/* same as the vertex values                            */
/********************************************************************************/


#include <stdlib.h>
#include <GL/glut.h>


    GLfloat vertices[][3] ={{-1.0,-1.0,-1.0},  /* Back */

                            { 1.0,-1.0,-1.0},  /* Left */

                            { 1.0, 1.0,-1.0},  /* Top */

                            {-1.0, 1.0,-1.0},  /* Right */

                            {-1.0,-1.0, 1.0},  /* Front */
                            { 1.0,-1.0, 1.0},  /* Bottom */

                            { 1.0, 1.0, 1.0},

                            {-1.0, 1.0, 1.0}};

    GLfloat normals[][3] = {{ 0.0, 0.0,-1.0},  /* Back */

                            {-1.0, 0.0, 0.0},  /* Left */
                            { 0.0, 1.0, 0.0},  /* Top */

                            { 1.0, 0.0, 0.0},  /* Right */

                            { 0.0, 1.0, 0.0},  /* Front */
                            { 0.0,-1.0, 0.0}}; /* Bottom */


    GLfloat colors[][3] =  {{0.0,0.0,0.0},    /* White */

                            {1.0,0.0,0.0},  /* Red */
                            {1.0,1.0,0.0},  /* Red & Green */

                            {0.0,1.0,0.0},  /* Green */

                            {0.0,0.0,1.0},  /* Blue */
                            {1.0,0.0,1.0},  /* Red & Blue */

                            {1.0,1.0,1.0},  /* White */

                            {0.0,1.0,1.0}}; /* Green & Blue */

static GLfloat theta[] = {0.0,0.0,0.0};

static GLint axis = 2;



static initialize(void);

void display(void);

void colorcube(void);

void spinCube(void);

void mouse(int btn, int state, int x, int y);

void polygon(int a, int b, int c, int d);

void myReshape(int w, int h);



void main(int argc, char **argv)

{

    glutInit(&argc, argv);



/* need both double buffering and z buffer                                    */

    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);

    glutInitWindowSize(300, 300);

    glutCreateWindow("colorcube");



    initialize();    



    glutReshapeFunc(myReshape);

    glutDisplayFunc(display);

       glutIdleFunc(spinCube);

       glutMouseFunc(mouse);

    glutMainLoop();

}



static initialize(void)

{/* Material properties                                                        */

    GLfloat    mat_diffuse[] = {1.0, 1.0, 0.0, 0.0};

    GLfloat mat_ambient[] = {1.0, 1.0, 0.0, 1.0};

 /* Lighting                                                                */

    GLfloat    light_diffuse[]={1.0, 1.0, 1.0, 1.0};

    GLfloat light_ambient[]={1.0, 1.0, 0.0, 1.0};

/*  Light position                                                            */

    GLfloat    position[] = {0.0, 1.0, 0.0, 1.0};



 /* Flat shading                                                            */

    glShadeModel(GL_SMOOTH);



 /* Create normals                                                            */

    glEnable(GL_NORMALIZE);

    glEnable(GL_AUTO_NORMAL);



 /* Set the background                                                        */

    glClearColor(1.0, 1.0, 1.0, 0.0);



 /* Enable lighting                                                            */

    glEnable(GL_LIGHTING);

    glEnable(GL_LIGHT0);



 /* For 2D the modelview matrix is the identity                                */

    glMatrixMode(GL_MODELVIEW);

    glLoadIdentity();



    gluLookAt(10.0, 10.0, 10.0,        /* eye */

              0.0, 0.0, 0.0,        /* looking here */

              0.0, 0.0, 1.0);        /* up vector */



 /* Set light position (actually direction as light    source is at infinity)    */

 /* in the eye (viewing) coordinates                                        */

    glLightfv(GL_LIGHT0, GL_POSITION, position);

    glLightfv(GL_FRONT, GL_DIFFUSE, light_diffuse);

    glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);



    glEnable(GL_DEPTH_TEST);

    glClearDepth(1.0);



 /* Set the material                                                        */

    glColorMaterial(GL_FRONT, GL_LIGHT0);

    glEnable(GL_COLOR_MATERIAL);

    glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse);

    glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);

    glMatrixMode(GL_MODELVIEW);

    glLoadIdentity();

}/*---------------------------< initialize >--------------------------------*/





void polygon(int a, int b, int c , int d)
{/* draw a polygon via list of vertices                                        */
 /* When using light sources the material colours are not effective            */
     glBegin(GL_POLYGON);
        glColor3fv(colors[a]);
        glNormal3fv(normals[a]);
        glVertex3fv(vertices[a]);
        glColor3fv(colors[b]);
        glNormal3fv(normals[b]);
        glVertex3fv(vertices[b]);
        glColor3fv(colors[c]);
        glNormal3fv(normals[c]);
        glVertex3fv(vertices[c]);
        glColor3fv(colors[d]);
        glNormal3fv(normals[d]);
        glVertex3fv(vertices[d]);
    glEnd();
}/*------------------------------< polygon >--------------------------------*/



void colorcube(void)
{/* map vertices to faces                                                    */
    polygon(0,3,2,1); /* Back   (-1,-1,-1)(-1, 1,-1)( 1, 1,-1)( 1,-1,-1)    */
    polygon(2,3,7,6); /* Top    ( 1, 1,-1)(-1, 1,-1)(-1, 1, 1)( 1, 1, 1)    */
    polygon(0,4,7,3); /* Left   (-1,-1,-1)(-1,-1, 1)(-1, 1, 1)(-1, 1,-1)    */
    polygon(1,2,6,5); /* Right  ( 1,-1,-1)( 1, 1,-1)( 1, 1, 1)( 1,-1, 1)    */
    polygon(4,5,6,7); /* Front  (-1,-1, 1)( 1,-1, 1)( 1, 1, 1)(-1, 1, 1)    */
    polygon(0,1,5,4); /* Bottom (-1,-1,-1)( 1,-1,-1)( 1,-1, 1)(-1,-1, 1)    */
}/*------------------------< colourcube >-----------------------------------*/


void display(void)
{/* display callback, clear frame buffer and z buffer, rotate cube and draw */

 /* draw, swap buffers                                                        */

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glMatrixMode(GL_MODELVIEW);

    glLoadIdentity();


    glRotatef(theta[0], 1.0, 0.0, 0.0);
    glRotatef(theta[1], 0.0, 1.0, 0.0);
    glRotatef(theta[2], 0.0, 0.0, 1.0);

    colorcube();


    glutSwapBuffers();
}/*------------------------------< display >--------------------------------*/

void spinCube(void)
{/* Idle callback, spin cube 2 degrees about selected axis                    */
    glMatrixMode(GL_MODELVIEW);



 /* glutPostRedisplay() causes the displa callback registered using            */

 /* glutDisplayFunc(display) to be called once in each event loop            */

    glutPostRedisplay();

    

 /* Compute angle of rotation                                                */

    theta[axis] += 0.02;
    if( theta[axis] > 360.0 ) theta[axis] -= 360.0;
}/*-----------------------------< spinCube >--------------------------------*/

void mouse(int btn, int state, int x, int y)
{/* mouse callback, selects an axis about which to rotate                    */
    if(btn==GLUT_LEFT_BUTTON && state == GLUT_DOWN) axis = 0;
    if(btn==GLUT_MIDDLE_BUTTON && state == GLUT_DOWN) axis = 1;
    if(btn==GLUT_RIGHT_BUTTON && state == GLUT_DOWN) axis = 2;
}/*-----------------------------< mouse >-----------------------------------*/

void myReshape(int w, int h)
{    w=300; h=300;

    glViewport(0, 0, w, h);
    glMatrixMode(GL_PROJECTION);
    glLoadIdentity();
 

    if (w <= h) glOrtho(-2.0, 2.0, -2.0*(GLfloat)h/(GLfloat)w,

                                     2.0*(GLfloat)h/(GLfloat)w, -10.0, 10.0);
    else glOrtho(-2.0*(GLfloat)w/(GLfloat)h, 2.0*(GLfloat)w/(GLfloat)h, -2.0,

                                                            2.0, -10.0, 10.0);


  glMatrixMode(GL_MODELVIEW);  
}/*-----------------------------< myReshape >-------------------------------*/

i use gcc to complie the program(need to install a freeglut lib)

gcc cube.c -o cube -lglut

this program draws a 3-d rotating color cube, i can run it normally on my laptop with nvidia card.

./cube

but if runs in my desktop computer which uses a ati 9550 card with open source driver, you will only see a yellow cube.
and it also reports a warning:

libGL warning: 3D driver claims to not support visual 0x73

Last edited by ydwu (2008-02-04 16:25:36)

Offline

Board footer

Powered by FluxBB