r = engine->RegisterGlobalFunction( "void glTranslatef (float, float, float)", asFUNCTION(glTranslatef), asCALL_CDECL ); assert( r >= 0 );
r = engine->RegisterGlobalFunction( "void glEnd()", asFUNCTION(glTranslatef), asCALL_CDECL ); assert( r >= 0 );
//..etc
Calling a function like glEnd() or glLoadIdentity() seems to work , whereas glTranslatef(..) and others will fail with a VC++ runtime check:
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.
...With a crash to follow.
As far as I can tell glFunctions on MSVC9 are defined "__declspec(dllimport) ret __stdcall decl()"
Any help would be great.