The glh Library

Best viewed 1024 x 768 minimum


Thanks to
OpenGL Logo
by Silicon Graphics Inc.
www.opengl.org

Stuff...

Link to NEW page

Introduction
This page contains a library called "glh" which stands for Graphics Library Helper. It is kind of like OpenGL's GLU but contains extra functions and optimized functions. The optimizations are done with assembly and are for the x86 architecture. Note that not all parts are done in assembly.

glhlib is still freeware and still contains the very fast image scaling function --> glhScaleImage_asm386
the function that started this project.

PS: glhlib is compiled with VC++6 SP5, for Pentium Pro, Maximize Speed.

Monday, Dec 19, 2005
Version 1.54 is uploaded. A few fixes and a few additions have been made.
No Linux version available yet.

Moved glhInitLibrary and glhShutDownLibrary from Block 17 to Block 0

Adding to Block 0 :
Added glhGetGLDeviceCaps_GL_2_0 for getting GL 2.0 related max values.
Added glhGetGLDeviceCaps_GL2_0_GLSL for getting GLSL related version number and max values.

Adding to Block 12 :
glhConstantSizeMatrixf2 (GLdouble version not added)
glhExtractLookAtFromMatrixd2
glhExtractLookAtFromMatrixf2

Adding to Block 14 :
glhConstantSizeMatrixf

Adding to Block 16 :
glhMultiplyMatrixByMatrix4by4f_SSE_Aligned_WarmCache_1
glhMultiplyMatrixByMatrix4by4f_3DNow


Adding to Block 22 :
This block is about color space conversion.
glhComputeRGBWithHSVf
glhComputeBGRAWithHSVfub
glhComputeRGBAWithHSVfub
glhComputeHSVWithBGRAubf
glhComputeHSVWithRGBAubf


Moved glhDoesRayCrossTrianglef from Block 18 to Block 23
Block 23 is now the "Intersection Testing" section

New addition to struct glhSphereObject :
GLfloat ScaleFactorS[8], ScaleFactorT[8];

Updated glhConvertHeightMapToNormalMap for glh error code support.
Now you can call glhGetError

Updated glhCreateSpheref so that when Sphere.GenerateTangentsAndBinormals == GL_TRUE, we do generate the vectors.

Bug Fix :

Bug in glhCreateCylinderf where texcoordinate was not generated.
Bug in glhCreateSpheref where texcoordinate was not generated.

glhConvertHeightMapToNormalMap, when format was GL_BGR, the function would generate an error. This has been fixed.

When glhShutDownLibrary was called, it might crash. This has been fixed.

glhComputeTangentAndBinormalVectors_v1_f and glhComputeTangentAndBinormalVectors_v1_f_2
updated so that all number of components work. Previously, only {numCompVertex==3, numCompNormals==3,
numCompTexCoord==2, numCompTangent==3, numCompBinormal==3} worked.

Fixed and added code to glhCreateCubef, glhCreateCylinderf, glhCreateSpheref so that tangents and binormals
and related variables are proper.

Fixed glhGetOpenGLMainVersion where it would crash if a space character is not found at the proper location.
Fixed glhGetGLSLMainVersion where it would crash if a space character is not found at the proper location.
A silly mistake which has been floating around for a while but was not an issue for anyone.

Fixed glhUnProjectf_2 where the w component of objectVertex4D was not beeing 1.0 as documented in the header file.
Instead, the z component was receiving 1.0 due to a copy and paste error. The w component was beeing untouched.

Fixed glhGetGLDeviceCaps_GL_1_5 and glhGetGLDeviceCaps_GL_2_0
This was beeing called
glGetIntegerv(GL_RED, &pcaps->RedBitsi);
glGetIntegerv(GL_GREEN, &pcaps->GreenBitsi);
glGetIntegerv(GL_BLUE, &pcaps->BlueBitsi);
glGetIntegerv(GL_ALPHA, &pcaps->AlphaBitsi);

instead of
glGetIntegerv(GL_RED_BITS, &pcaps->RedBitsi);
glGetIntegerv(GL_GREEN_BITS, &pcaps->GreenBitsi);
glGetIntegerv(GL_BLUE_BITS, &pcaps->BlueBitsi);
glGetIntegerv(GL_ALPHA_BITS, &pcaps->AlphaBitsi);

which gave GL errors (GL_INVALID_ENUM)

Log

Monday, July 11, 2005
I may release a Linux version. I haven't set a date yet. I have had one person ask me for a Linux version or at least allowing him to recompile the code. I haven't had a Linux partition due to problems I had while installing RH8 some months ago, which pissed me off. I'm not a hardcore Linux user :)

Tuesday, April 12, 2005
Version 1.53 is uploaded. The previous upload was considered beta so this one replaces it.

I moved arround some of the function in glhlib.h for the sake of better organization.
I added a bunch of functions that I typically need.
I removed a bunch of functions that I consider trivial and useless.
I should add an online documentation sometime :)
I should also upload some demoes, but I think the library is easy to use.
Some interesting functions were added like for detected SSE2, 3DNow, 3DNow+ (glhDoesProcessorSupportSSE2, glhDoesProcessorSupport3DNow, glhDoesProcessorSupport3DNowExtended).
Some functions added for getting OpenGL caps, kind of like the caps in Direct3D (glhGetGLDeviceCaps_GL_1_5, glhGetGLDeviceCaps_ARB_vp_1_0, glhGetGLDeviceCaps_ARB_fp_1_0)
Support for the new OpenGL 2.0 shaders (glhGetGLSLMainVersion, glhGetGLSLMainVersionAsString). YES!
glhlib now has 180 functions!


Changed to use Multithreaded DLL, so there is a dependence on msvcrt.dll
Make sure you compile your EXE with Multithreaded DLL (In VC++, Project Settings ->
C/C++ Tab. Select Code generation from Category list.
Use run-time library)
glhlib is compiled with VC++6 SP5, for Pentium Pro, Maximize Speed.

Added the following functions to section Block 12
Block 12 is all about Software matrix manipulation.
glhRotateAboutXd2
glhRotateAboutXf2
glhRotateAboutYd2
glhRotateAboutYf2
glhRotateAboutZd2
glhRotateAboutZf2

Added the following functions to section 20
Block 20 is all about Floating point number manipulation.
glhPackFloatIntoUByte
glhUnpackUByteIntoFloat

Added glhShadowMatrixd and glhShadowMatrixf to Block 14

Added glhShadowMatrixd2 and glhShadowMatrixf2 to Block 12

Added glhMultMatrixSwappedd2 and glhMultMatrixSwappedf2 to Block 12

Changed the way glhGetError works. There is now a an error
stack, 100 elements deep.

Added glhMultiplyMatrixByVector4by4f_3 to Block 16

Moved glhQuickInvertMatrixdv_2 and glhQuickInvertMatrixfv_2
from Block 17 to Block 12, where the software matrix functions are located.
glhQuickInvertMatrixdv_2 renamed to glhQuickInvertMatrixd2 for consistency
with it's "brother" functions.
glhQuickInvertMatrixfv_2 renamed to glhQuickInvertMatrixf2 for consistency
with it's "brother" functions.

Moved glhTransposeMatrixdv and glhTransposeMatrixfv
from Block 6 to Block 12, where the software matrix functions are located.
glhTransposeMatrixdv renamed to glhTransposeMatrixd2 for consistency with
it's "brother" functions.
glhTransposeMatrixfv renamed to glhTransposeMatrixf2 for consistency with
it's "brother" functions.

Moved glhInvertMatrixdv_2 and glhInvertMatrixfv_2
from Block 9 to Block 12, where the software matrix functions are located.
glhInvertMatrixdv_2 renamed to glhInvertMatrixd2 for consistency with it's
"brother" functions.
glhInvertMatrixfv_2 renamed to glhInvertMatrixf2 for consistency with it's
"brother" functions.

Moved glhPerspectived and glhPerspectivef from
Block 12 to Block 14.

Moved glhGetOpenGLMainVersion from
Block 8 to Block 1.

Moved glhGetOpenGLMainVersionAsString from
Block 8 to Block 1.

Moved glhGetGLUMainVersion from
Block 8 to Block 1.
Moved glhGetOpenGLMainVersionAsString from

Moved glhGetOpenGLSubVersionAsString from
Block 8 to Block 1.

Moved glhGetOpenGLDriverVersionAsString from
Block 8 to Block 1.

Moved glhIsRunningInHardwareMode from
Block 8 to Block 1.

Added glhGetGLDeviceCaps_GL_1_5 to Block 1.

Added glhGetGLDeviceCaps_ARB_vp_1_0 to Block 1.

Added glhGetGLDeviceCaps_ARB_fp_1_0 to Block 1.

Added glhGetGLSLMainVersion and glhGetGLSLMainVersionAsString to Block 1

Added glhDoesProcessorSupportSSE2, glhDoesProcessorSupport3DNow,
glhDoesProcessorSupport3DNowExtended to Block 16.

BUG fixes :
Small error in glhMultMatrixf2 and glhMultMatrixd2. Instead of
leftMatrix * rightMatrix it was previouly rightMatrix * leftMatrix

Function glhMultiplyMatrixByMatrix4by4f_1 was defined as :
void glhMultiplyMatrixByMatrix4by4f_1(GLint countMatrix, GLfloat *leftMatrix, GLfloat
*rightMatrix, GLfloat *result)

countMatrix was removed because this version only does one matrix multiplication.
glhMultiplyMatrixByMatrix4by4f_2 is correct.

Updated glhCopyOpenGLErrorInto_cBuffer : Error code added for GL_EXT_framebuffer_object

Removing the following functions :
glhLoadIdentityProjection
glhLoadIdentityModelview
glhLoadIdentityTexture
glhTranslateProjectionf
glhTranslateProjectionfv
glhTranslateModelviewf
glhTranslateModelviewfv
glhTranslateTexturef
glhTranslateTexturefv
glhRotateProjectionf
glhRotateProjectionfv
glhRotateModelviewf
glhRotateModelviewfv
glhRotateTexturef
glhRotateTexturefv
glhScaleProjectionf
glhScaleProjectionfv
glhScaleModelviewf
glhScaleModelviewfv
glhScaleTexturef
glhScaleTexturefv
glhPushProjection
glhPopProjection
glhPushModelview
glhPopModelview
glhPushTexture
glhPopTexture
glhLoadMatrixProjectionfv
glhMultMatrixProjectionfv
glhLoadMatrixModelviewfv
glhMultMatrixModelviewfv
glhLoadMatrixTexturefv
glhMultMatrixTexturefv

Wednesday, Jan 05, 2005
Beta Version 1.53 is uploaded.

Added the following functions to Block 12
glhRotateAboutXd2
glhRotateAboutXf2
glhRotateAboutYd2
glhRotateAboutYf2
glhRotateAboutZd2
glhRotateAboutZf2

Added the following functions to Block 19
Section 19 is all about quaternions.
glhQuaternionIdentityf
glhQuaternionIsIdentityf
glhQuaternionIsPuref
glhQuaternionConjugatef
glhQuaternionMagnitudef
glhQuaternionMagnitudeSquaredf
glhQuaternionDotProductf
glhQuaternionExpf
glhQuaternionLnf
glhQuaternionNormalizef
glhQuaternionMultiplyf
glhQuaternionQuatToRotationMatrixf
glhQuaternionRotationMatrixToQuatf
glhQuaternionQuatToAxisAndAnglef
glhQuaternionAxisAndAngleToQuatf
glhQuaternionEulerAnglesToQuatf
glhQuaternionSLERPf

BUG fixes :
Small error in glhMultMatrixf2 and glhMultMatrixd2. Instead of
leftMatrix * rightMatrix it was previouly rightMatrix * leftMatrix

Friday, Nov 12, 2004
Version 1.52 is uploaded. This adds some functions and renames a few for consistency.
The DDS reader/writer functions for DXT5 had issues, so I have not released these functions yet. I was trying to have functions that produce binary identical files when you save, as produced by Microsoft's D3DX library. I'm glad to say that for the most part, it was working from the first code version.

Changes made :
Added Block 17 functions
Added glhMultMatrixf2 and glhMultMatrixd2 to Block 12
Added glhMultiplyMatrixByMatrix4by4f_1 to Block 16 (double version not added)
Added glhMultiplyMatrixByMatrix4by4f_2 to Block 16 (double version not added)

Renamed all functions that have the word FLOAT or DOUBLE in them
to something more consistent with OpenGL's style, which uses "f" or "d" :

Renamed glhAccumFrustum_FLOAT to glhAccumFrustumf for GL style consistency.
Renamed glhAccumPerspective_FLOAT glhAccumPerspectivef for GL style consistency.
Renamed glhRender_DOF_SceneAA_FLOAT to glhRender_DOF_SceneAAf for GL style consistency.
Renamed glhComputeTangentAndBinormalVectors_v1_FLOAT to glhComputeTangentAndBinormalVectors_v1_f for GL style consistency.
Renamed glhComputeTangentAndBinormalVectors_v1_FLOAT_2 to glhComputeTangentAndBinormalVectors_v1_f_2 for GL style consistency.
Renamed glhBuild2DNormalMipmaps_FLOAT to glhBuild2DNormalMipmapsf for GL style consistency.
Renamed glhBuildCubeMapNormalMipmaps_FLOAT to glhBuildCubeMapNormalMipmapsf for GL style consistency.
Renamed glhBuildNormalizationCubeMapf to glhBuildNormalizationCubeMap_FLOAT for GL style consistency.
Renamed glhProjectFLOAT_1 to glhProjectf for GL style consistency.
Renamed glhProjectDOUBLE_1 to glhProjectd for GL style consistency.
Renamed glhUnProjectFLOAT_1 to glhUnProjectf for GL style consistency.
Renamed glhUnProjectDOUBLE_1 to glhUnProjectd for GL style consistency.
Renamed glhProjectFLOAT_2 to glhProjectf_2 for GL style consistency.
Renamed glhProjectFLOAT_3 to glhProjectf_3 for GL style consistency.
Renamed glhUnProjectFLOAT_2 to glhUnProjectf_2 for GL style consistency.
Renamed glhProjectFLOAT_SSE_Aligned_2 to glhProjectf_SSE_Aligned_2 for GL style consistency.
Renamed glhProjectFLOAT_SSE_Aligned_WarmCache_2 to glhProjectf_SSE_Aligned_WarmCache_2 for GL style consistency.
Renamed glhProjectFLOAT_SSE_Unaligned_2 to glhProjectf_SSE_Unaligned_2 for GL style consistency.
Renamed glhUnProjectFLOAT_SSE_Aligned_2" to glhUnProjectf_SSE_Aligned_2 for GL style consistency.
Renamed glhUnProjectFLOAT_SSE_Aligned_WarmCache_2 to glhUnProjectf_SSE_Aligned_WarmCache_2 for GL style consistency.
Renamed glhUnProjectFLOAT_SSE_Unaligned_2 to glhUnProjectf_SSE_Unaligned_2 for GL style consistency.
Renamed glhMultiplyMatrixByVector4by4FLOAT_1 to glhMultiplyMatrixByVector4by4f_1 for GL style consistency.
Renamed glhMultiplyMatrixByVector4by4FLOAT_2 to glhMultiplyMatrixByVector4by4f_2 for GL style consistency.
Renamed glhMultiplyMatrixByVector4by4FLOAT_SSE_Aligned_1 to glhMultiplyMatrixByVector4by4f_SSE_Aligned_1 for GL style consistency.
Renamed glhMultiplyMatrixByVector4by4FLOAT_SSE_Aligned_WarmCache_1 to glhMultiplyMatrixByVector4by4f_SSE_Aligned_WarmCache_1 for GL style consistency.

Links

Home Page My Home Page, the root of everything on this server.
The GLU Library The GLU library for OpenGL. Download the latest version!


Thanks to
OpenGL Logo
by Silicon Graphics Inc.
www.opengl.org


* OpenGL(R) is a registered trademark of Silicon Graphics, Inc.

This page is http://www.oocities.org/vmelkon/glhlibrary.html
This page is http://ee.1asphost.com/vmelkon/glhlibrary.html
Graphics Library Helper aka glh
Copyright (C) 2001-2005 Vrej M. All Rights Reserved.