Jump to content
  • Advertisement
Sign in to follow this  
FeverGames

Interfacing XNA

This topic is 3415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!