I am trying to use the XeviGetVisualInfo library call, but I am getting strange 
results.  Could someone tell me if there are any known bugs for it?  Am I just using 
it wrong?  See below for the example piece of code I am trying to use.  I have tried 
this (unsuccessfully) both on RH7.1 (FireGL3 video card) and RH7.2 (with a 
Geforce256), both running XFree86 4.1.0 (I upgraded the RH7.1 from 4.0.3).  When I run 
the example, I get a valid n_info_return, but the array evi_return does not get 
allocated properly and is returned with garbage.

I appreciate any help anyone can give me.
Thanks,
Mark


#include <X11/Intrinsic.h>
#include <iostream.h>
#include <X11/extensions/XEVI.h>

int main ( int argc, char **argv )
{
    Widget       parent;
    XtAppContext app;
    Display* disp;

    parent = XtAppInitialize ( &app, "Test", NULL, 0, 
                               &argc, argv, NULL, NULL, 0);

    disp = XOpenDisplay(NULL);
    if(XeviQueryExtension(disp))
      {
        ExtendedVisualInfo** evi_return;
        int n_info_return = 0;
        int stat = XeviGetVisualInfo(disp,
                                     NULL,//return all visuals
                                     0,
                                     evi_return,
                                     &n_info_return);
        if (Success == stat)
          {
            cout << "n_info_return = " << n_info_return << endl;
            int i;
            for(i = 0; i < n_info_return; ++i)
              {
                cout << "Visual ID:  " << evi_return[i]->core_visual_id
                     << ", level " <<  evi_return[i]->level
                     << ", min_hw_cmaps " << evi_return[i]->min_hw_colormaps
                     << ", max_hw_cmaps " << evi_return[i]->max_hw_colormaps << endl;
              }
            XFree(evi_return);
          }
      }
    else
      {
        cout << "Xevi extensions not available" << endl;
      }

    return 0;
}




_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert

Reply via email to