Handle user defined IGraphicsDeviceManager
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 3.0.0.6
Platform(s): All
Describe the bug
Currently the engine (specifically Xenko.Engine.GameBase) has a variable protected IGraphicsDeviceManager graphicsDeviceManager; that is explicitly cast to the specific implementation Xenko.Games.GraphicsDeviceManager in several spots. This prevents any attempt to implement a custom version of this interface as it will crash at run time for an invalid cast exception.
To Reproduce
Steps to reproduce the behavior:
- Create any implementation of
Xenko.Games.IGraphicsDeviceManager;. Get it into the system through whatever means (constructor in derived class for example). When the game runs you will receive a crash because several spots are forcing the specific implementionXenko.Games.GraphicsDeviceManager.
Expected behavior
Should be able to create a custom implementation that is accepted by the engine and works against the interface.
Additional context
Being able to provide a custom implementation has many uses. In my scenario I was attempting to take over the graphics for a server that would not (and cannot where I want to run it) use the graphics output, but otherwise uses all of Xenko's functionality as an engine.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in Xenko.Engine.GameBase and inspect each place where the IGraphicsDeviceManager field is cast to Xenko.Games.GraphicsDeviceManager. Trace the interface members those locations require, then verify that a custom IGraphicsDeviceManager can run without an invalid-cast failure, including the server scenario described in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100