stride3d / stride3d/stride

Handle user defined IGraphicsDeviceManager

Open
#276 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-Graphics enhancement
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:

  1. 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 implemention Xenko.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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.