nV News Forums

 
 

nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   General Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=27)
-   -   PBuffers and GLX Support (http://www.nvnews.net/vbulletin/showthread.php?t=44905)

realmaxime 01-29-05 11:13 AM

PBuffers and GLX Support
 
Hi,

i am currently trying to get a PBuffer class to work on my Linux OS (Suse 9.1 Personal), my GPU is a nVidia GeForce 6610 XL.

The class is based upon the nvidia demo-class pbuffer.cpp (but just the linux part implemented).

I need the following components for my PBufferConfig:

Code:

int configAttributes[] = {
                GLX_DRAWABLE_TYPE,GLX_PBUFFER_BIT,
                GLX_RENDER_TYPE,GLX_RGBA_BIT,
                GLX_RED_SIZE, 32,
                GLX_GREEN_SIZE, 32,
                GLX_BLUE_SIZE, 32,
                GLX_ALPHA_SIZE, 1
                GLX_DOUBLEBUFFER, true,
                GLX_FLOAT_COMPONENTS_NV,true
                None
        }

Its all fine, but my compiler does not find the GLX_FLOAT_COMPONENTS_NV?

I included following headers (as they are included in the examples):

Code:

#include <X11/X.h>
#include <GL/gl.h>
#include <GL/glx.h>

when i cat | grep one of these to find the GLX_FLOAT_COMPONENTS_NV i get zero result.

Also i am not able to use one of the "...SGIX" functions, too. eg: glXQueryGLXPbufferSGIX and others.

I am using FreeGlut on my system. glxinfo tells me that a GLX_NV_float_buffer is available.

Does any one have a clue? Maybe i just need other glx sources, then please tell me where to get those.

Please help!

thx,
Roger

------------------------------------------------------------
edit: further info

i am compiling with following links:
-L/usr/X11/lib -L/usr/lib -lCg -lCgGL -lGLEW -lglut -lGL -lGLU

maybe some are obsolete, but as far as i dont know where to find the right components, i better linked all that was found ;)


------------------------------------------------------------
edit: another problem, same class
Code:

Display *dpy = glXGetCurrentDisplay();
leads to a segmentation fault, when i call it.

Code:

Display *dpy = XOpenDisplay(0);
does the job perfectly, does any one have a clou on that?

DeepThawt 01-31-05 02:04 PM

Re: PBuffers and GLX Support
 
GLX_FLOAT_COMPONENTS_NV is a token defined by the GLX_NV_float_buffer extension. To access this token you need to include <GL/glxext.h> or better yet goto the OpenGL registry at SGI's website and get the latest revision of the file.

The reason glXGetCurrentDisplay() is returning NULL is because the pbuffer.cpp class is designed so that pbuffer creation can be shared with the current rendering context or it can be separate in it's own context. However you are trying to create a shared pbuffer without creating a regular rendering context to begin with! So modify your code so that it either creates another rendering context first, or creates the pbuffer in it's own context.

realmaxime 02-03-05 08:32 AM

Re: PBuffers and GLX Support
 
Thank you! I now found out how to get it running under linux, but well, it wont work under windows.

I got the leatest header files from sgi - developer central, but i cant really use them in my compiler.

i m using dev-c++ to compile my code, because some of the code needs a "windows.h" file, which is not included into normal version of ms vc++ toolkit 2003 (that i downloaded before i used pbuffers ;))

i get these messages:

Code:

PBuffer.cpp: In member function `bool PBuffer::create(PBufferSettings)':
PBuffer.cpp:220: error: `wglChoosePixelFormatARB' undeclared (first use this
  function)
PBuffer.cpp:220: error: (Each undeclared identifier is reported only once for
  each function it appears in.)

PBuffer.cpp:228: error: `wglCreatePbufferARB' undeclared (first use this
  function)
PBuffer.cpp:235: error: `wglGetPbufferDCARB' undeclared (first use this
  function)

PBuffer.cpp: In member function `bool PBuffer::destroy()':
PBuffer.cpp:298: error: `wglReleasePbufferDCARB' undeclared (first use this
  function)
PBuffer.cpp:299: error: `wglDestroyPbufferARB' undeclared (first use this
  function)

PBuffer.cpp: In member function `bool PBuffer::check()':
PBuffer.cpp:448: error: `wglQueryPbufferARB' undeclared (first use this

i included the new headerfiles, but the declared functions dont seem to be implemented in my openGL version. where to get a new one? or what am i doing wrong... (i have no glext.a/.lib or glexw.a/.lib on my computer if something like that would be needful...)

my includes:
Code:

#include <GL/gl.h>
#include <GL/glext.h>
#include <GL/glut.h>

#ifndef _WIN32
        // unix includes
        #include <X11/X.h>
        #include <GL/glx.h>
        #include <GL/glxext.h>
#else
        // windows includes
        #include <windows.h>
        #include <GL/wglext.h>
#endif

kind regards,
roger :eek:


[edit] ... just checkin out the glSDK from sgi, maybe i find some more there... [/edit]


All times are GMT -5. The time now is 04:41 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.