OpenGL extensions

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Stu-e Offline
Member
Posts: 89
Joined: Jan 2010
Reputation: 1
Post: #1
Do the XBMC developers have any kind of policy on the use of OpenGL extensions specific to a particular vendor?

Mitigating circumstances are nVidia specific extensions used in conjunction with VDPAU.
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #2
it's fine as long as it doesn't mean it break other things...
find quote
Stu-e Offline
Member
Posts: 89
Joined: Jan 2010
Reputation: 1
Post: #3
OK here are 2 scenarios:
A person builds XBMC on a system with nVidia drivers (and OpenGL headers) installed. The nVidia extensions are used in conjunction with some VDPAU stuff.
A person builds XBMC on a system with AMD drivers installed. The compilation throws errors because the nVidia extension prototypes don't exist in the AMD OpenGL headers, even though that code will never be used in an AMD video system.

I guess the source file using the nVidia extensions needs some #ifdef statements to detect the vendor and avoid whole sections of code referencing extensions that will otherwise not exist?

Thanks
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #4
uhm, isn't the whole point to glext's that it is something you probe for, and use if available?

e.g. i haven't seen games with binaries for amd/nvidia for many a moon (granted, most of them are dx but still...)
find quote
Stu-e Offline
Member
Posts: 89
Joined: Jan 2010
Reputation: 1
Post: #5
My understanding of GL extensions might be quite basic. The way I understand it you either use the function call prototype defined in the GL extension header or you use getProcAddress to get the function address using the typedef of the function also in the GL extension header. Either way the vendor specific header is still required.

Can you point to any examples of GL extensions in the XBMC code?
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #6
see RenderSystemGL.cpp.

e.g. if (glewIsSupported("GL_ARB_shading_language_100"))

glew takes care of defines etc.
find quote
Stu-e Offline
Member
Posts: 89
Joined: Jan 2010
Reputation: 1
Post: #7
Thanks
I need to read up on glew.
find quote
Stu-e Offline
Member
Posts: 89
Joined: Jan 2010
Reputation: 1
Post: #8
I found the glew source code in the projectM directory.
It's 4 years old and the extension I need (NV_vdpau_interop) is not there.
Either I'm looking in the wrong place or this needs updating.
find quote
stourwalk Offline
Member
Posts: 51
Joined: Jun 2011
Reputation: 0
Location: UK
Post: #9
I'd hazard a guess you should be looking at libGLEW - which was on version 1.5.8 in XBMC, until it was recently updated in the mainline to 1.7.0 (for OSX at least)

Even so - 1.5.5 had support for the extension you were after - so it should be supported even in 11.0 - unless of course libGLEW isn't used anywhere other than OSX Smile

Just a drive-by comment..
find quote
Stu-e Offline
Member
Posts: 89
Joined: Jan 2010
Reputation: 1
Post: #10
OK thanks yes I'm looking in the wrong place. Glew would be a system library and not part of XBMC.
find quote