G prefixed API

Started by
10 comments, last by DarkHost 14 years, 4 months ago
Hi all, Lately I've examined a few games, and seen a common interface exported from their exe (or one of the main dlls). The API included: GMatrix2D, GColor, GBufferedFile, GSysFile, GThread, GSemaphore... Just to name a few of these games: "Mass Effect", "Dawn of War - Soulstorm", "Dragon Age", "Crysis". Now, I can't help but think it is some kind of a common Graphics (probably where the 'G' prefix comes from) library used by all of these games. But These games have no common developer studio (and not all of them have common publisher, if that matters), so I'm obliged to conclude that this API should be offered as an open source or a commercial library (and be mentioned in the internet somewhere). But as you can guess, there is nothing on it, only people who are having problems involving these functions; and printing a call-stack including one of the functions of the interface, in some forum. So, my question is obvious - if there is someone who can please tell me the name of the library, or at list shed some light on the matter? Thanks.
Advertisement
Coincidental naming conventions?
Quote:Original post by DarkHost

so I'm obliged to conclude that this API should be offered as an open source or a commercial library (and be mentioned in the internet somewhere).


There is plenty of software, some very big and in wide-spread use that Google doesn't even know the name of.
Quote:Original post by DarkHost
Hi all,
Lately I've examined a few games, and seen a common interface exported from their exe (or one of the main dlls). The API included:
GMatrix2D, GColor, GBufferedFile, GSysFile, GThread, GSemaphore...

I think you're probably just misreading the output of your tools. "G" is used by MSVC to indicate a __stdcall convention. A function returning a Matrix2D would have an exported name beginning in "GMatrix2D".
First, let me say thanks for your quick replies.
Now about the matter:

Quote:Original post by Antheus
There is plenty of software, some very big and in wide-spread use that Google doesn't even know the name of.

You are correct, but I would expect for such a wide used library to have some kind of mention in google.

Quote:Original post by Sneftel
I think you're probably just misreading the output of your tools. "G" is used by MSVC to indicate a __stdcall convention. A function returning a Matrix2D would have an exported name beginning in "GMatrix2D".

So according to you, every function exported from a DLL will have it name mangled including a 'G' prefix?! I've just tested this theory, and it is not correct, and surely not documented in C++ mangling rules; and besides, I used a demangling software (which I presume should know about such a rule, if exists), and the result was with the 'G' prefix.
If I didn't understand you, and you suggest that the function "returns" an object, then let me clarify that I ment - the name of the class itself is GMatrix2D.

The characters cases are matching between the games, and also the function names like:
double GMatrix2D::GetYScale(void)
bool GMutex::IsSignaled(void)
bool GMutex::IsLockedByAnotherThread(void)
...
This is too similar to be just a coinsidence!
Quote:Original post by Sneftel

I think you're probably just misreading the output of your tools. "G" is used by MSVC to indicate a __stdcall convention. A function returning a Matrix2D would have an exported name beginning in "GMatrix2D".


Undname shows classes to have G prefix and thiscall.
I have done a little research on each game. Those game use different engine, and I don't think these games' engine use the same math library. Well, I think what they have in common is they use DirectX.

You might be interested to checked the D3DX's dll (and something else).

Maybe it's just a coincidence ...

http://9tawan.net/en/

Quote:Original post by mr_tawan
I have done a little research on each game. Those game use different engine, and I don't think these games' engine use the same math library. Well, I think what they have in common is they use DirectX.

You might be interested to checked the D3DX's dll (and something else).

Maybe it's just a coincidence ...


I wonder how it could be related to D3D.. because I've checked a few sample programs that use D3D9, including HoMM5, and they don't export those symbols, and my guess would be that they don't use it either.

Just another thought:
Another game that have these symbols is "Batman Arkham Asylum", which uses the Unreal Engine 3, and I know that "Mass Effect" uses the same engine, and maybe "Dragon Age" uses a variation of that engine (as BioWare licensed UE3). Not so sure about the other games (except Crysis, which uses CryEngine, but if it may be the only exception, then it might be just a coincidence).

And as I've said before, it is too common and the names are exactly the same (as well as the methods of each class), to just be a mere coincidence.
Well, I've just eliminated the option, of it being involved with the Unreal Engine, because "F.E.A.R 2", which uses Jupiter EX, has it as well, and with exactly the same names for all the exported classes.
Looks like some kind of cross-platform support library to me (threads, files, synchronization primitives, etc). Maybe it's an Xbox/Windows support library that provides some cross-platform wrappers (being an Xbox/PS3 cross-platform library would explain why there's no public information about it).

This topic is closed to new replies.

Advertisement