background preloader

Monogame

Facebook Twitter

Let the 3D Rendering Start (XNA Game Studio 4.0 Programming) Part 1. Now that we covered the basics of the graphics pipeline and some of the math that is involved, let’s see how these concepts relate to the types exposed by XNA Game Studio and draw some triangles on the screen. GraphicsAdapter Use the GraphicsAdapter class to enumerate and update graphics adapters. Most single monitor PCs have one graphics adapter that represents their physical graphics card and the one connection it has to the monitor. Some graphics cards provide two graphics adapters so you can plug two monitors into a single graphics card.

The static GraphicsAdapter.DefaultAdapter property returns the default adapter in which there are multiple adapters to chose from. The static GraphicsAdapter.Adapters property returns a read-only collection of the adapters available.You rarely need to enumerate graphics adapters. Note A graphics driver is a piece of software that enables the operating system to communicate with the graphics hardware. GraphicsDevice Creating the GraphicsDevice. SpriteBatch.Draw Method (Microsoft.Xna.Framework.Graphics) | MonoGame. MonoDevelop - MonoDevelop. XNA Tutorial > Terrain from file. It's time to finally create a nice looking landscape. Instead of manually entering the data into our heightData array, we are going to fill it from a file.

To do this, we are going to load a grayscale image of 128x128 pixel. We are going to use the 'white value' of every pixel as the height coordinate for the corresponding pixel! You can download my example file here (link). Once you’ve downloaded the file, add it to your project as you’ve done for your .fx file. You can also do this by selecting the file in Windows Explorer, and dragging it onto the Content entry of your XNA Project.

If everything is OK, you should see the heightmap.bmp file added in your Content entry. The image file should be loaded in the LoadContent method. Texture2D heightMap = Content.Load<Texture2D> ("heightmap");LoadHeightData(heightMap); By using the default Content Pipeline, it doesn’t matter whether you’re using a .bmp, .jpg or .pgn file. As you can see, this method receives the image as argument. XNA Tutorials - RB Whitaker's Wiki. Welcome to the XNA Tutorials, the largest and easiest to use collection of XNA 4.0 tutorials on the Internet! There are plenty of other sites out there, but as far as I know they are either much smaller than this, or way out of date, which is a big deal, since so much changed in version 4.0. You may also find my MonoGame tutorials of interest.

MonoGame is an open source port of XNA that runs on a very wide variety of programs, and may ultimately have a longer lifespan than XNA. About These XNA Tutorials XNA is an extremely powerful and easy to use set of tools for game making, created by Microsoft. If you are interested in making your own game, XNA is the way to do it, and my tutorials on this website should help you get going. I have divided these tutorials up into multiple categories. Below is a diagram of the ordering of the tutorials. RB's Game Development Kit I have also created a list of free software that you can download and use in your game development: RB's Game Development Kit.