Why Genesis 3D is portable for Directx and GL

Posted on 2003-03-03
Medium Priority
Last Modified: 2013-12-04
respected men, i started experimenting with Genesis3D in Last january , i soon found that it is very simple and flexible. One thing i don't understand is how they made it portable for DirectX ,OpenGL and Glide at the same time.I mean how  that "drivers" work? Can any body clear it.
Question by:smallbug005
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2

Expert Comment

ID: 8056656
I haven't used Genesis but I would imagen that they have made an abstract interface and then the interface has to translate the calls to the sublayer that handles DX, GL etc.


Author Comment

ID: 8117546
u re right jo but i ant the answer in more detail
will any body comeup with more details about source code.

Expert Comment

ID: 8221553
the drivers are dll files that are called by the engine. From what I remember, it just changes the dll file name to call based on which driver is selected by the user, but it can also auto-detect which to use.

Accepted Solution

DSole earned 300 total points
ID: 8221624
the drivers available are enumerated in the function

in the system.c file.

it loops through the DriverFileNames Array and adds info abt each one (DriverInfo class) available to an instance of the Sys_DriverInfo object.

this is called in the Sys_EngineCreate() function.

if (!EnumSubDrivers(&NewEngine->DriverInfo, DriverDirectory))
goto ExitWithError;

the drivers are abstracted through a struct called DRV_Driver :

typedef struct
     char                    *Name;
     S32                         VersionMajor;
     S32                         VersionMinor;

     // Error handling hooks set by driver
     S32                         LastError;                                   // Last error driver made
     char                    *LastErrorStr;                              // NULL terminated error string
     // Enum Modes/Drivers
     DRV_ENUM_DRIVER          *EnumSubDrivers;
     DRV_ENUM_MODES          *EnumModes;
     DRV_ENUM_PFORMAT     *EnumPixelFormats;

     // Init/DeInit functions
     DRV_INIT                         *Init;
     DRV_SHUTDOWN                    *Shutdown;
     DRV_RESET                         *Reset;
     DRV_UPDATE_WINDOW               *UpdateWindow;
     DRV_SET_ACTIVE                    *SetActive;
     // Create/Destroy texture functions
     CREATE_TEXTURE          *THandle_Create;
     DESTROY_TEXTURE          *THandle_Destroy;

     // Texture manipulation functions
     LOCK_THANDLE          *THandle_Lock;
     UNLOCK_THANDLE          *THandle_UnLock;

     // Palette access functions
     SET_PALETTE               *THandle_SetPalette;
     GET_PALETTE               *THandle_GetPalette;

     // Palette access functions
     SET_ALPHA               *THandle_SetAlpha;
     GET_ALPHA                 *THandle_GetAlpha;

     THANDLE_GET_INFO     *THandle_GetInfo;

     // Scene management functions
     BEGIN_SCENE               *BeginScene;
     END_SCENE               *EndScene;
     BEGIN_WORLD               *BeginWorld;
     END_WORLD               *EndWorld;
     BEGIN_MESHES          *BeginMeshes;
     END_MESHES               *EndMeshes;
     BEGIN_MODELS          *BeginModels;
     END_MODELS               *EndModels;
     // Render functions
     RENDER_G_POLY          *RenderGouraudPoly;
     RENDER_W_POLY          *RenderWorldPoly;
     RENDER_MT_POLY          *RenderMiscTexturePoly;

     //Decal functions
     DRAW_DECAL               *DrawDecal;

     S32                         NumWorldPixels;
     S32                         NumWorldSpans;
     S32                         NumRenderedPolys;
     DRV_CacheInfo          *CacheInfo;

     SCREEN_SHOT               *ScreenShot;

     SET_GAMMA               *SetGamma;
     GET_GAMMA               *GetGamma;

     DRV_SET_FOG_ENABLE     *SetFogEnable;
     // Driver preferences
     DRV_EngineSettings     *EngineSettings;

     // The engine supplies these for the drivers misc use
     SETUP_LIGHTMAP_CB     *SetupLightmap;

     // Temp hack global
     GInfo                    *GlobalInfo;
} DRV_Driver;

Author Comment

ID: 8277859
Yes Dsole this is the answer i want,but it will be better if you detail the overall working for other viewers in more simple language. Thanks for your efforts

Featured Post

Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As game developers, we quickly learn that Artificial Intelligence (AI) doesn’t need to be so tough.  To reference Space Ghost: “Moltar, I have a giant brain that is able to reduce any complex machine into a simple yes or no answer. (http://www.youtu…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question