Game object from Nuclex.GameWindow?

Xeno's picture

Im currently using Nuclex.GameWindow to make an editor for my game, however some of the GameComponents im using require passing a reference to a Game object in the constructor, and I cat find any reference to a Game class anywhere. Am I just being realy thick here, and missing it totally?

Cygon's picture

Not Possible

Bad news:

Because I cannot inherit from Game or otherwise fabricate a Game instance from thin air, the GameComponent class cannot be used. Sorry.

I have written my own GameComponent that is identical in behavior and usage to the XNA GameComponent class in every way except that its constructor expects a GameService collection instead of the Game class, so it works with the XNA Game and with my GameComponent.

You can get this class from here: Drawable.cs (required base class) and DrawableComponent.cs. An example using this class is here: DebugDrawer.cs, but except for the constructor, it's really 100% identical to the GameComponent class.

Xeno's picture

So any component built off

So any component built off the XNA standard GameComponent class cant be used?

Bugger.

Cygon's picture

I know...

There are other solutions out there which will work with the standard GameComponent class but then break when you have more than one XNA control active.

Until XNA 2.0 comes out, you can only choose between having a defective Game class or working around the problem by the price of loosing GameComponent compatibility :-/

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Lines and paragraphs break automatically.
  • Allowed HTML tags: <br> <a> <em> <strong> <u> <i> <b> <cite> <blockcode> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <pre> <span>
  • You can highlight code with any of the following tags: <blockcode>

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.