bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] Concerning 3d, reply to archive message.


From: Marco van Tol
Subject: Re: [Bug-gnubg] Concerning 3d, reply to archive message.
Date: Sun, 7 Sep 2003 02:06:54 +0200
User-agent: Mutt/1.4.1i

On Sat, Sep 06, 2003 at 10:42:10AM +0000, Joern Thyssen wrote:
> On Sat, Sep 06, 2003 at 12:34:35AM +0200, Marco van Tol wrote
> > Hello all,
> > 
> > In the archives I noted an email from Jim Segrave where he mentiones a
> > colleague with a Matrox G550 graphics board, which has DRI support, but
> > won't get recoqnized by gnubg as an accelerated graphics board.
> 
> Strange, looking at the code and the output from glxinfo I would guess
> that I should be recognised.
> 
> The unix code for checking acceleration is:
> 
> int CheckAccelerated(GtkWidget* board)
> {
>       Display* display = glXGetCurrentDisplay();
>       GLXContext context = glXGetCurrentContext();
>       if (!display || !context)
>       {
>               g_print("Unable to get current display information.\n");
>               return 1;
>       }
>       return glXIsDirect(display, context);
> }
> 
> 
> The output from your glxinfo is:
> 
> name of display: :0.0
> display: :0  screen: 0
> direct rendering: Yes
> ^^^^^^^^^^^^^^^^^^^^^
> 
> server glx vendor string: NVIDIA Corporation 
> server glx version string: 1.3
> .....
> 
> The question is why glXIsDirect returns FALSE when glxinfo claims that
> there is direct rendering?!

I made a mini-program myself, which may be _completely wrong by design and a
lot of other things_, but at least it contains a glXIsDirect() call which does
say rendering is direct.
(Please note my OpenGL programming experience is 'none', short for this
mini-program)

Here is the source code:
(Reference material was taken from:
http://tc1.chemie.uni-bielefeld.de/doc/OpenGL/hp/Reference.html)

----//----
/*
 * gcc -I/usr/X11R6/include -L/usr/X11R6/lib -lX11 -lGL -o test2 test2.c
 */

#include <stdio.h>
#include <GL/glx.h>
#include <X11/Xlib.h>

static int attributelist[] = {
  GLX_RGBA,
  GLX_RED_SIZE, 1,
  GLX_GREEN_SIZE, 1,
  GLX_BLUE_SIZE, 1,
  None };

int main(void)
{
  Display *dpy;
  XVisualInfo *vi;
  GLXContext cx;

  dpy = XOpenDisplay(0);
  vi = glXChooseVisual(dpy, DefaultScreen(dpy), attributelist);
  cx = glXCreateContext(dpy, vi, 0, GL_TRUE);

  if(glXIsDirect(dpy, cx))
  {
    puts("Yes. Direct!\n");
  }
  else
  {
    puts("No. Not Direct!\n");
  }

  return(0);
}
----//----

The output is:

----//----
0:address@hidden opengl]./test2 
Yes. Direct!
----//----

Maybe this helps, if not pretend I never sent it. ;)

If someone can try it on a unix box which does not have DRI, it'd be
interesting to see if it indeed would output 'No. Not Direct!' ;-)

Marco


-- 
Marco van Tol




reply via email to

[Prev in Thread] Current Thread [Next in Thread]