From: J.P. M. <jp...@it...> - 2004-03-30 17:47:29
|
On Tue, 30 Mar 2004 15:57:52 +0200 "Sauc Jedi" <sau...@ho...> wrote: > Hi guys! > > I'm making a sidescroller game and have a software renderer and an OpenGL > renderer, but on separate executables. > I want to know what techniques or tips there are for mix these two into > one executable and select the renderer from a menu (ala Quake, Quake2). > Quake games seem to do this via DLLs, but I want my game portable. If you write an abstracted DLL loader, it should be portable. Make a function that loads in the DLL and performs as much magic as is needed to make all the functions accessable (I use a class myself). In the Windows version, the loader function can use LoadLibrary() or whatever, and you should be able to make a Posix version of the loader function that uses dlopen() for Linux, BSD and probably BeOS as well. If you come across another OS with a different API, you can write another version of the loader that works for it too. CrystalSpace does something like this. > Any hints? Function pointers for call the appropriate rendering function? > (after deinitializing the previous renderer and initializing the new, of > course). Any help would be appreciated. > -- JP Morris - aka DOUG the Eagle (Dragon) -=UDIC=- jp...@it... Fun things to do with the Ultima games http://www.it-he.org Reign of the Just - An Ultima clone http://rotj.it-he.org d+++ e+ N+ T++ Om U1234!56!7'!S'!8!9!KAW u++ uC+++ uF+++ uG---- uLB---- uA--- nC+ nR---- nH+++ nP++ nI nPT nS nT wM- wC- y a(YEAR - 1976) |