Download Latest Version GLFunBind v1.1 win32.7z (168.6 kB)
Email in envelope

Get an email when there's a new version of GLFunBind

Home
Name Modified Size InfoDownloads / Week
GLFunBind v1.1 win32.7z 2015-04-21 168.6 kB
README 2015-04-21 3.8 kB
Totals: 2 Items   172.4 kB 0
#####################
    GLFunBind v1.1
#####################


GLFunBind is a header only, easy to use library made to make simple and safe 
use OpenGL.

#####################
UPDATES
#####################
- added otpion to output enums as defines and not as "static const GLenum"
- now gl_veriosn_profile.h headers are generated. This helper headers can be
  used to avoid inclusion of function, enums and types headers.

#####################
BUILDINBG
#####################

The library it self doesn't need to be builded, but in order to generate the 
headers you need to build GLHeaderGen. This tool parse gl.xml
(from OpenGL Registry) and generate the proper headers.

In order to build GLHeaderGen you need:
 *Qt5.4
 *TinyXML 2.0
 *MSVC 2013
 *other compiler with c++11 support should work

Steps:
-open files paths.pri and change the various TinyXML2 varaible to the path of
 you TinyXML2 directory, the directory must contain "lib" and "include"
 subfolder. If you  plan to use debug builds be sure that debug build reside in
 same directory of -run qmake to generate the makefiles.
-then run you'r make tool(jom, nmake, make)
-make install to copy some headers

-then go to bin directory(in the build tree) and lunch GLHeaderGen.exe
 from command line with the path tp you'r gl.xml file.
-wait until it has finished
-the generated header will be put in the include directory under your build
 tree.

####################
INSTALLING
####################

Just copy the "include" directory in your project tree or add an include path
in your favourite IDE pointing to it.


####################
USAGE
####################
Include tree:

include
    |_gl/
      |_enums_GL_VERSIO_n_n_profile.h
      |_functions_GL_VERSIO_n_n_profile.h
    |_enum_undefs.h
    |_binds.h
    |_function.h
    |_glbinder.h
    |_types.h

Directory explanation:
in include directory you find all headers required by the library to work:
 *function.h contains all the class templates used to bind OpenGL functions,
 *binds.h is auto-generated by GLFunBind and contains instances of Function
  class that hold the address of OpenGL functions. It also contain a vector
  of all Function object used for initializing all the functions one time
  with initialize().
 *glbinder.h is used if you want to initialize all the function at once.
 *types.h contain all the types used by OpenGL.

 *under gl directory, there are all the headers used to call the OpenGL 
  functions with the corresponding enumerator.
  
In your source or header files, include one of the header according to the 
OpenGL version you want to use, for example:

#include <gl/functions_GL_VERSION_3_2_core.h>

differently from other OpenGL bindings you don't need to be sure if you include
the system "gl.h" before or after GLFunBind headers, but if you are using "gl.h"
or other bindings, remember to include "enums_undef.h" before GLFunBind headers, 
in order to avoid name collision. Later in your code just call any OpenGL 
function you need preceded by "gl::" namespace, for example:
	
	gl::glDrawArrays(gl::GL_TRIANGLES, 0,0);

Avoid to expand gl namespace, especially if you are using other OpenGL binds,
because doing so you can create name collision with other library. If you are 
using only GLFunBind you can expand namespace gl safely.

Doing this way functions will be loaded the first time they are called. If you
instead prefer to load all the functions when you initialize OpenGL, just
include glbinder.h in your source and make a call to initialize().
initilaize() doesn't provide(at the moment) context managment, so it's up to you
make sure context is properly set and be current. Same thing apply to what
said berfore.
Source: README, updated 2015-04-21