• Advertisement

Archived

This topic is now archived and is closed to further replies.

automated extension linking with GLee (V1.1 is up)

This topic is 5295 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Edit: Version 1.1 is up. It's a bit neater internally, and it gives detailed error reporting (see the readme). I've just finished writing GLee, the OpenGL Easy Extension library. It's developed using a little program I made called GLeeGen, which automatically writes the code to link and query every OpenGL extension based on the contents of glExt.h and wglExt.h. As far as I know, it supports every GL and WGL extension in the registry. To use it, you just have to link to glee.lib, and include glee.h in your project. Once linked, it's pretty straightforward to use:
...create openGL window etc...
GLeeInit();   //extensions can be used from here onwards

...
//Does GL_ARB_point_parameter exist?

if (GLEE_ARB_point_parameter)
{
   glPointParameterfARB(...);
}

//Is OpenGL 1.3 supported?

if (GLEE_VERSION_1_3)
{
  glLoadTransposeMatrixf(...) ; 
  ...
}
I've made the license as non-restrictive as possible in order to make it useful to everyone. The only thing I'm asking is you give credit where due. Let me know if you have any comments/bug reports etc. I've only tested this on my Radeon 9700, so more testing would be helpful. Links: Note: You will need wglext.h and glext.h from sgi. [EDIT: updated for version 1.01: The hDC is no longer required (thanks davepermen)] [edited by - benjamin bunny on August 19, 2003 6:47:49 AM] [edited by - benjamin bunny on August 23, 2003 12:48:36 PM]

Share this post


Link to post
Share on other sites
Advertisement
Congrats on finishing this, but I thought I should let you know that there is already a library that does what yours does... at least from what you''ve put down so far. Have you heard of Lev Povalahev''s extension loading library? Take a look at it if you haven''t. Maybe you could post what makes yours unique or different.

Share this post


Link to post
Share on other sites
I'm aware of other similar libs such as extgl, GLEW and GLuX.

The main advantage of my lib is it supports every extension in the registry. It's automatically generated, so every extension in glext.h and wglext.h is supported as soon as glext.h and wglext.h are updated; I just have to run GleeGen.exe and rebuild. I believe GLEW works in a similar way, however the licenses are more restrictive.

I plan to support it right up through OpenGL 2.0 and beyond.

____________________________________________________________
www.elf-stone.com

[edited by - benjamin bunny on August 18, 2003 5:19:28 PM]

Share this post


Link to post
Share on other sites
others don''t need it as well.. dunno.. it would look much more clean.. and as i use sdl i normally don''t access the hdc myself at all..

wglGetCurrentDC or so should give you all you need, not?

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Ah, wglGetCurrentDC, that's what I needed. I was looking in the win32 API docs before. Thanks. It's fixed now.

[edited by - benjamin bunny on August 19, 2003 6:31:51 AM]

Share this post


Link to post
Share on other sites
Cool! I''m using extgl for my projects right now, but I''ll give it a try. Also, maybe it would be helpful to add links to your libray and extgl as well as others to the forum faqs, since every so often there are questions on good ways to load extensions.

Share this post


Link to post
Share on other sites
lol, no conflict of interest here

[edited by - _walrus on August 19, 2003 11:57:19 AM]

Share this post


Link to post
Share on other sites
Great, thanks!

Could you make a little modification so that it works on linux too (for example use macros to remove windows.h inclusion and other possible conflicts)...

I am currently using extgl, but maybe I''ll give this a try

Share this post


Link to post
Share on other sites
At the moment this library is just something I whipped up in a few hours to solve a recurring problem in the project I''m working on. However, when I get the chance, I might port it to other OSes if there''s interest; it wouldn''t be particularly difficult to do.

Share this post


Link to post
Share on other sites
there is not (yet) any opengl1.5 support in it

okay, then again, there are no gl1.5 drivers out as well.. but there should soon... grmbl..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
It's not my fault glext.h is out of date. But anyway, I can do better than that. Here's a patch to add support for versions up to OpenGL 2.0:


//add this to glee.h

extern bool GLEE_VERSION_1_5;
extern bool GLEE_VERSION_2_0;

//add this to glee.cpp

bool GLEE_VERSION_1_5 = false;
bool GLEE_VERSION_2_0 = false;


Better? It won't actually link any functions, but seeing as there are no implementations yet, I don't think that's a problem necessarily

BTW, my radeon 9700 drivers aren't even up to 1.4 yet (although it seems to support all of 1.4 through extensions).

[edited by - benjamin bunny on August 20, 2003 10:41:16 AM]

Share this post


Link to post
Share on other sites
i emailed ATI about the OGL versioning before the last Cat. release and got the reply that the drivers wasnt quite 1.4 compliant but that should be fixed in the next release, needless to say it wasnt, so maybe they''ll skip 1.4 and go right on to 1.5

Share this post


Link to post
Share on other sites
yeah, could be because of some ARB_shadow implementation issues (they always had troubles with them, not?)

well.. can''t wait for gl1.5 myself..

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Me too. I''d like to ditch Cg and start using the OGLSL, which should be better optimised for my card (as ATi will be providing their own compiler).

Share this post


Link to post
Share on other sites
quote:
Original post by davepermen
yeah, could be because of some ARB_shadow implementation issues (they always had troubles with them, not?)



could well be, alot of complaints/comments about the drivers have been the poor performance in NWN with regards to shadows, and thats an OGL game so put 2 and 2 together

Share this post


Link to post
Share on other sites
After getting some feedback from a few users, I''ve updated the library. Version 1.1 gives more detailed error reporting with GLeeGetErrorString() in the event that GLeeInit fails. Let me know if you find any bugs.

____________________________________________________________
www.elf-stone.com | Automated GL Extension Loading: GLee

Share this post


Link to post
Share on other sites
not yet tested, haven''t had any need yet.. but i''ll test out quite soon i guess.. that weekend.. or so

"take a look around" - limp bizkit
www.google.com

Share this post


Link to post
Share on other sites
Where do I get glext.h and wglext.h?
Could you also add those files to the zip?

Share this post


Link to post
Share on other sites
quote:
Original post by stefu
Where do I get glext.h and wglext.h?
Could you also add those files to the zip?


http://oss.sgi.com/projects/ogl-sample/registry/

-* So many things to do, so little time to spend. *-

Share this post


Link to post
Share on other sites

  • Advertisement