Here's an example in F# version 1.1.13.8 or Higher:
// An XNA game in F#
#light
#I @"C

rogram FilesMicrosoft XNAXNA Game Studio Expressv1.0ReferencesWindowsx86"
#r "Microsoft.Xna.Framework.dll"
#r "Microsoft.Xna.Framework.Game.dll"
// Not all of these opens are required for this sample, but you will need them to write a full game
open Collections
open Compatibility
open Idioms
open Microsoft.Xna.Framework
open Microsoft.Xna.Framework.Audio
open Microsoft.Xna.Framework.Content
open Microsoft.Xna.Framework.Graphics
open Microsoft.Xna.Framework.Input
open Microsoft.Xna.Framework.Storage
open System
open System.IO
type MyGame = 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.Green)
end
let main() =
let game = new MyGame()
game.Run()
[<STAThread>]
do main()