Interfacing XNA

Started by
2 comments, last by NickGravelyn 15 years, 1 month ago
we are trying (for fun mostly) to interface XNA (we did DX9 as well). The problem is that a device is created with an associated Game class, where we use our own structure. Is there a way to avoid this? We are mostly doing this so we can publish something on the xbox market place someday.
Advertisement
This has been working quite well for me:
			var presentParams = new PresentationParameters();			presentParams.BackBufferWidth = RenderPanel.ClientSize.Width;			presentParams.BackBufferHeight = RenderPanel.ClientSize.Height;			presentParams.BackBufferFormat = SurfaceFormat.Unknown;			presentParams.BackBufferCount = 1;			presentParams.AutoDepthStencilFormat = DepthFormat.Depth24Stencil8;			presentParams.EnableAutoDepthStencil = true;			presentParams.IsFullScreen = false;			presentParams.SwapEffect = SwapEffect.Discard;			Device = new GraphicsDevice(adapter, DeviceType.Hardware, RenderPanel.Handle, presentParams);

Unless I'm misunderstanding your question.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
omg thats what i hate about xna it hides everything with fancy stuff :) there's a simple graphicsDevice thanks.
Quote:Original post by FeverGames
omg thats what i hate about xna it hides everything with fancy stuff :) there's a simple graphicsDevice thanks.
It doesn't hide it, per se. The developers simply realized that 90% or more of their audience would not want anything to do with handling the graphics device or run loop, so they created the Game class to encapsulate that. You're free to replace that class with your own implementation if you want. You can use MSDN to see all the docs about XNA and use Reflector to peer into the Game class if you want to see how they did something in there, then take all that knowledge and make your own version of the Game class.

This topic is closed to new replies.

Advertisement