Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7161807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:37:45+00:00 2026-05-28T13:37:45+00:00

Some time in the near future, I will begin developing a game engine. One

  • 0

Some time in the near future, I will begin developing a game engine. One feature that I want to include is having multiple render systems such as directx 9/10/11 and OpenGL. This way, a game using this engine will be able to support more players since if one render system doesn’t work, it will revert to a different one.

So my question, how would I go about doing this? I researched a bit and saw that Ogre3D uses something like this but I have no idea how they do it. I basically want to be able to plug in different render systems and use the same code to run it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:37:46+00:00Added an answer on May 28, 2026 at 1:37 pm

    You could create an interface class that allows you to further extend for the API you are hoping to expand to.

    I have done this in the past to create a DirectX9\11 Renderer and I am hoping to expand this to OpenGL soon. There is certainty a lot to the task, but it is easy to explain a basic working of it. Unfortunately the project I am on is closed source, so if you have any questions about this please don’t hesitate to ask.

    First you will want to create a separate project to be used as a .lib/.dll, I called this “RenderInterface”. This will contain basic interfaces for VertexBuffer’s, IndexBuffer’s, Shaders, and most importantly, IRenderInterface and IRenderUtility, which in the later implementation could potentially hold items such as such as ID3D11DeviceContext and ID3D11Device.

    My two most important items in the “RenderInterface” project, are IRenderInterface and IRenderUtility. The idea here is to have IRenderInterface do the heavily lifting, such as creating render targets, presenting, and initializing the API. Where as IRenderUtility will do more common things, such as creating vertex/index buffers, creating shaders and rendering. I pass IRenderUtility around more frequently on initialization and rendering, and IRenderInterface is rarely passed around. This is to prevent the users from doing accidental operations when they do not need to. This project will also include some common structs\enums that will be used throughout the code base.

    I then create another project, such as D3D11RenderInterface. This D3D11RenderInterface will have the implementations of the IRenderInterface, IRenderUtlity, IVertexShader, IVertexBuffer, etc.

    An overlysimple example would be

    class IRenderUtility
    {
    public:
        virtual void Draw(unsigned int vertexCount, unsigned int vertexStartOffset) = 0;
    };
    
    class D3D11RenderUtility : public IRenderUtility
    {
    protected:
        ID3D11DeviceContext *mD3D11DeviceContext;
    public:
        void Draw(unsigned int vertexCount, unsigned int vertexStartOffset)
        {
            mD3D11DeviceContext->Draw(vertexCount, vertexStartOffset);
        };
    };
    

    This works by having the VertexBuffer and IVertexBuffer being set by a call to IRenderUtility, before the IRenderUtility::Draw call.

    Then, in your application will only need to load the RenderInterface project, and api implementation. There are other ways to do this, such as a #define’ing code throughout your code base, but imo, that is just messy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some time in the near future I will need to implement a cross-language word
Some time ago I put together a time based library that could be used
Some time ago, I came across a piece of code, that used some piece
I'm writing a Java application that will run for a long time (essentially, it
In the very near future I'll be migrating some web applications from VS2003 projects
I am having fun with Visual C++ some time already. And today i decided,
I have a little app that has been under development for some time. My
Some time ago I got this error when building ANY Visual Studio Deployment project.
Some time ago I wrote a little piece of code to ask about on
some time ago I found an article ( Roles: Composable Units of Object Behavior

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.