From: Chad A. <ae...@ae...> - 2002-01-17 00:56:20
|
> i would tend to agree. most uses of the image loading library would > probably be through C++. thus we'd want to make sure that the library was > well design from the standpoint of using it through C++. > > however, i also agree that the image lib should probably be > distributed/used as a DLL which i believe is why chad wants a C api. > regardless we will need a C api to access the code in the library, but we > could do it as just one simple call to get a class and write the > application code using interfaces ... ie: > > // assume getImageMgr is in the DLL and is really being called using a > // function pointer obtained through GetProcAddr(..) > ImageManager* mgr = getImageMgr(); > Image myImg; > mgr->load( "myimage.pcx", img ); Ack. You can't do this because an ABI doesn't just specify name mangling semantics. The vtable in different compilers has different layouts. There are also issues like exception handling, C++ object calling convention (do all Win32 compilers pass |this| in |eax|?). (sorry I'm so backed up on these e-mails, I've been pretty busy tonight) |