Skip to content

Instantly share code, notes, and snippets.

@carlosrivera
Created July 25, 2012 02:27
Show Gist options
  • Save carlosrivera/3174012 to your computer and use it in GitHub Desktop.
Save carlosrivera/3174012 to your computer and use it in GitHub Desktop.
F# and XNA
#light
#I @"C:\Program Files\XNA\v2.0\References\Windows\x86"
#r "Microsoft.Xna.Framework.dll"
#r "Microsoft.Xna.Framework.Game.dll"
open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Graphics
open System
type XNAGame = class
inherit Game as base
val mutable graphics : GraphicsDeviceManager
new() as this =
{
graphics = null
}
then
this.graphics <- new GraphicsDeviceManager(this)
override this.Draw(gameTime) =
let gd = this.graphics.GraphicsDevice
gd.Clear(Color.CornflowerBlue)
end
let Main() =
let game = new XNAGame()
game.Run()
[<STAThread>]
do Main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment