Friday, June 19, 2009

AntTweakBar

At SimWay, where I work, we are a small development team. We are always on a tight schedule. One tool which I find very efficient to use for small development teams is AntTweakBar.

AntTweakBar is a small, easy-to-use, C/C++ library which allows programmers to quickly add a gui to applications based on OGL, DX9 & DX10.
We use it for many things that requires fast editing such as light conditions.

The current version contains a bug in the ogl-rendering system which will, according to the creator, be fixed in the next version. If you want to fix it yourself in the meantime you can rebuild the library with the following changes:

AntTweakBar will not render properly if you have several Texture Coordinate Arrays enabled at the same time. Looking into the AntTweakBar source code it looks like this:

CTwGraphOpenGL::BeginDraw()
{

_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
...
}

This only disables the currently active TexCoordArray. Replace the code with this to disable all TexCoordArrays:

#ifndef GL_MAX_TEXTURE_COORDS
# define GL_MAX_TEXTURE_COORDS 0x8871
#endif

CTwGraphOpenGL::BeginDraw()
{


int maxTexCoords;
_glGetIntegerv(GL_MAX_TEXTURE_COORDS, &maxTexCoords);

for(int i=0; i<maxTexCoords; i++)
{
_glClientActiveTexture(GL_TEXTURE0_ARB+i);
_glDisableClientState(GL_TEXTURE_COORD_ARRAY);
}

_glClientActiveTexture(GL_TEXTURE0_ARB);

...
}

To disable all texarrays.

No comments:

Post a Comment