GLee Appreciation Thread

Started by
9 comments, last by JTippetts 18 years, 9 months ago
GLee was one of those libraries that I'd thought I'd never need need, mostly because of not knowing what it really did. I've been working on a little SDL engine for fun in my spare time and had some troubles with the BSP tutorials from GT. Mainly the OpenGL process loading, wglGetProcAddress. For some odd reason, I just couldn't get it to work correctly. Anyways, I remembered Glee and gave it a try. It took me a few minutes to get it to link properly, due to having to include it before any other OpenGL libraries, but all that had to be done was include the .C file, include the .H file and it linked perfectly. After that, I took out all of the function loading code which looked like this:

if( !glActiveTextureARB )
{
	// Initialize the multitexturing function pointers
	glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glActiveTextureARB");
	if( !glActiveTextureARB )
		throw("glActiveTextureARB extension was not loaded.");
}

if( !glClientActiveTextureARB )
{
	glClientActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)wglGetProcAddress("glClientActiveTextureARB");
	if( !glClientActiveTextureARB )
		throw("glClientActiveTextureARB extension was not loaded.");
}


And took out the other variables for it:

typedef void (APIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum target);
typedef void (APIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);

// These are the functions that we use for doing multitexturing
extern PFNGLACTIVETEXTUREARBPROC		glActiveTextureARB;
extern PFNGLCLIENTACTIVETEXTUREARBPROC  glClientActiveTextureARB;


And it's all ready! I simply compiled and it worked perfectly with no changes! So two thumbs up to Benjamin Bunny, and I encourage to give this great library a try if you are having trouble getting those extensions o work. [smile]
Advertisement
yes, GLee is indeed great [grin]
I've been using it since some of the earliest public released by Ben and its an intergral part of my OpenGL Window Framework.

GLee is also the offical extension loader for the up and coming More OpenGL Game Programming and Dave has said that if Ben ever cant support it Gamedev.net will take up the support of it, something which if it did happen I'd certainly be wanting to get involved with [grin]

So yes, GLee is indeed great [grin]
I've got nothing to add, soo...

Woop! GLee!
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Yay. [grin]
Okay, I'll bite.
What is GLee?
-----http://alopex.liLet's Program: http://youtube.com/user/icefox192
Glee is the bee's knees. Makes loading and using extensions a breeze. Top Notch stuff indeed. I pimp it out whenever I get the chance.

J
Benjamin Bunny rules ^_-
Quote:Original post by Icefox
Okay, I'll bite.
What is GLee?


Have a look at the web page for everything, but a few quick excerpts from it:

Quote:The OpenGL Easy Extension library (GLee) makes life easier for OpenGL developers by automatically linking OpenGL extensions and core functions at initialisation time. This saves programmers the effort of manually linking every required extension, and effectively brings the OpenGL library up to date.


Now to use a feature of it:
#include <gl\GLee.h>          //no need to link to gl.h ...if (GLEE_ARB_multitexture)    //is multitexture support available?{  glMultiTexCoord2fARB(...);  //safe to use multitexture}else{   //fallback}


Now you may be asking what's the big deal? The big deal is that the library does *everything* for you already. All you have to do is include the header file and you are all set. In that first code segment, imagine having to do all of that, well one line less, for *all* extnsions you wanted to use in a program. It has already been done for you! Best part is that it's an easy plug and play and you are all set. [smile]
I know I was logged in!
Quote:All you have to do is include the header file and you are all set.

Sounds like too much work.

This topic is closed to new replies.

Advertisement