question about GL ext

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.

question about GL ext

Postby REDDemon » Mon Mar 19, 2012 6:32 pm

I have a question about the Irrlicht OpenGL extension handler.
with glew if I wanted to check for a particular extension or GL version I had to write:

cpp Code: Select all
 
if( GLEW_VERSION_1_2 )
{}
 
if( GLEW_EXT_framebuffer_object )
{}
 


it seems that Irrlicht provides all the function pointers required by it. But I'm still missing certain functionalities like glGenerateMipmapsEXT wich is not wrapped by Irrlicht. Should I have to write a patch for that or is better I just use glew alongside glext?
OpenGL is not hard. What you have to do is just explained in specifications. What is hard is dealing with poor OpenGL implementations.
User avatar
REDDemon
 
Posts: 831
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: question about GL ext

Postby hybrid » Mon Mar 19, 2012 9:36 pm

We use that already, just update your texture and the mipmap is automatically updated. If you have the extension, it will be used.
hybrid
Admin
 
Posts: 13946
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: question about GL ext

Postby REDDemon » Tue Mar 20, 2012 7:22 am

how can I check wich GL version is available on target platform? how to check for specific extensions?
this is what I need to check. I'd like to use Irrlicht code for doing that else I have to add almost 1MB fo extra code wich is not very good :-/

GL version is 1.1 or greater
GL version is 1.2 or greater
GL version is 1.3 or greater
GL version is 2.0 or greater

GL has EXT framebuffer object
GL has EXT_texture_compression_s3tc
GL has ARB_texture compression

mipmap levels are not generated automatically (at least for compressed textures, even with correct texture creation flags.) so I have to generate them with glGenerateMipmapEXT. (glGenerateMipmap will not work for most platforms)
OpenGL is not hard. What you have to do is just explained in specifications. What is hard is dealing with poor OpenGL implementations.
User avatar
REDDemon
 
Posts: 831
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: question about GL ext

Postby hybrid » Tue Mar 20, 2012 8:29 am

Well, you didn't say compressed texture before. So I just answered to what you wrote in your post. Anyway, we have a version flag in each driver, and the driver attributes starting from Irrlicht 1.8. There you can get much more information about the supported driver features. The extensions will probably not be exposed, though, as we want to hide and generalize on those things on the IVideoDriver interface.
hybrid
Admin
 
Posts: 13946
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: question about GL ext

Postby REDDemon » Tue Mar 20, 2012 9:24 am

ah ok thx. for now glew is nice. After I have compressed textures well tested and working on irrlicht .1.7.3 with glew I will start modifying them for irrlicht 1.8.x so. :)
OpenGL is not hard. What you have to do is just explained in specifications. What is hard is dealing with poor OpenGL implementations.
User avatar
REDDemon
 
Posts: 831
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: question about GL ext

Postby robmar » Thu May 02, 2013 8:00 pm

Why do the GL extensions only work for Linux? _IRR_LINUX_OPENGL_USE_EXTENSIONS_

Is there a way to add them for Windows too?
robmar
 
Posts: 565
Joined: Sun Aug 14, 2011 11:30 pm

Re: question about GL ext

Postby hybrid » Thu May 02, 2013 10:22 pm

Ehh? We have this for Linux and Windows. Only the Apple extension mechanism was not implemented.
hybrid
Admin
 
Posts: 13946
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: question about GL ext

Postby robmar » Thu May 02, 2013 11:35 pm

In the header it has ifndef win & ifndef mac.... before the ext def. Thats in 173.
robmar
 
Posts: 565
Joined: Sun Aug 14, 2011 11:30 pm

Re: question about GL ext

Postby robmar » Fri May 03, 2013 8:38 am

Okay, found this in 1.7.3:-

//! Define _IRR_OPENGL_USE_EXTPOINTER_ if the OpenGL renderer should use OpenGL extensions via function pointers.
/** On some systems there is no support for the dynamic extension of OpenGL
via function pointers such that this has to be undef'ed. */
#if !defined(_IRR_OSX_PLATFORM_) && !defined(_IRR_SOLARIS_PLATFORM_)
#define _IRR_OPENGL_USE_EXTPOINTER_
#endif

There doesn´t seem to be any documentation or examples on using extension function pointers though....

a line or two please!! Or do I have to unravel the source code to figure it out!!!!
robmar
 
Posts: 565
Joined: Sun Aug 14, 2011 11:30 pm

Re: question about GL ext

Postby hybrid » Fri May 03, 2013 8:42 am

You're puzzling me. Which header? Maybe it would be better if you describe your problem in more than half a dozen words. And maybe you should stick to just one htread and post all your related questions there. Otherwise you get parts of an answer here, and others there...
Anyway, the extension mechanism works for Linux and Windows and is only disabled for Solaris and OSX in IrrCompileConfig.h. The define also has no OS name in it. In the OpenGL driver parts you have a section for Linux and a section for Windows where the function pointer init macro is prepared. The rest of the init is done the same for both platforms. This is all in OpenGL Extension handler.

And yes, you have to go through the sources. This is a render engine on top of OpenGL. If you want to use OpenGL you have to get your hands dirty.
hybrid
Admin
 
Posts: 13946
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Re: question about GL ext

Postby robmar » Fri May 03, 2013 8:47 am

Okay, done!

Under windows, in the file COpenGLExtensionHandler.h, GL_GLEXT_PROTOTYPES fails to get defined, which removes the very blt function I needed from glext.h:-

#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBlitFramebufferEXT (GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
#endif /* GL_GLEXT_PROTOTYPES */

@hybrid: What should be done, can it be defined for windows, or is there an "issue"?
robmar
 
Posts: 565
Joined: Sun Aug 14, 2011 11:30 pm

Re: question about GL ext

Postby hybrid » Fri May 03, 2013 12:52 pm

Answer in other thread, please continue there.
hybrid
Admin
 
Posts: 13946
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany


Return to Beginners Help

Who is online

Users browsing this forum: Google [Bot] and 0 guests