Original Post
Hail All, Short Form: I've implemented the first NeHe tutorial in XNA. The project and related files are located here. Features: - 800x600 Resizeable Window - Fullscreen Toggleable (F1 Key) - Mouse is visible in Windowed Mode, Hidden in Full-Screen Mode - Update and Draw only if Window has Focus - 16 bit(565) BackBuffer (Same as NeHe's Tutorials) - Clears BackBuffer and DepthBuffer on Draw Call - Terminates with ESC Key Anyone interested in downloading the zip file, checking out the code, running the program etc...are encouraged. Please provide feedback about coding style, implementation details, etc... Long Form: Through a series of fortunate events I've suddenly found myself in a situation of needing to learn XNA relatively quickly. For me, the best way to learn something new is to just give it a try, "kick the tires" so to speak, and see what I can do with the framework or language. In the spirit of that, I've decided to implement all of the NeHe tutorials in XNA. I'm sure it has probably been done before already, but that doesn't solve my immediate problem of needing to learn the framework, and learning best through experience. At any rate, I just wanted to post here and make my XNA Framework, as implemented in NeHe's Tutorial 1, available to everyone. Please feel free to provide feedback, and as I work my way through the tutorials I'll continue to post my projects, etc... Once again, the download is located here. Updates/Errata: While working on project #2 I found a bug in the ResetProjection() method. I will update it in the downloadable source. However, if you want to make the changes locally, it should read: Cheers! [Edited by - JWalsh on September 25, 2007 1:03:27 PM]
protected void ResetProjection()
{
Viewport viewport = graphics.GraphicsDevice.Viewport;
// Set the Projection Matrix. Make sure to cast one of the viewport sides
// to a FLOAT. Otherwise it's truncated, and you dont get a correct aspect ratio.
projectionMatrix = Matrix.CreatePerspectiveFieldOfView(MathHelper.PiOver4,
(float)viewport.Width / viewport.Height, 0.1f, 100.0f);
}




