Sign in to follow this  

Interfacing XNA

Recommended Posts

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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this