Inheritance: OpenTK.GameWindow
Ejemplo n.º 1
0
Archivo: Game.cs Proyecto: tpb3d/TPB3D
        public Game()  
		{
			game = this;
				
			this.Width = 800;
			this.Height = 600;
			this.Title = "OOGL Example";
			
			this.VSync = VSyncMode.Off;
			
			ResourceLocator.RootPath = System.Environment.CurrentDirectory + "/../../../Media/";
			
			ShaderProgram positionColorShader = new ShaderProgram(ResourceLocator.GetFullPath("Shaders/guiColored.vs"), ResourceLocator.GetFullPath("Shaders/guiColored.fs"));
			ShaderProgram positionTextureShader = new ShaderProgram(ResourceLocator.GetFullPath("Shaders/guiTextured.vs"), ResourceLocator.GetFullPath("Shaders/guiTextured.fs"));
			
			this.frameMgr = new BaseFrameMgr(this, positionColorShader, positionTextureShader);

            this.Keyboard.KeyDown += new EventHandler<KeyboardKeyEventArgs>(Game_KeyDown);
            this.Keyboard.KeyUp += new EventHandler<KeyboardKeyEventArgs>(Game_KeyUp);

            this.Mouse.ButtonDown += new EventHandler<MouseButtonEventArgs>(Game_MouseDown);
            this.Mouse.ButtonUp += new EventHandler<MouseButtonEventArgs>(Game_MouseUp);
            this.Mouse.Move += new EventHandler<MouseMoveEventArgs>(Game_MouseMove);
            this.Mouse.WheelChanged += new EventHandler<MouseWheelEventArgs>(Game_WheelChanged);
									
			new DemoWindow(this.frameMgr);
			new PlayerWindow(this.frameMgr);
			new RadarWindow(this.frameMgr);
			new WaypointWindow(this.frameMgr);

            this.frameMgr.LoadWorkspace();
		
			Ms3dLoader.File ms3dFile = new Ms3dLoader.File(ResourceLocator.GetFullPath("Models/Beta_Kamujin/Beta_Kamujin.ms3d"));

            Sample[] tracks = Sample.Load(ResourceLocator.GetFullPath("Models/Beta_Kamujin/Beta_Kamujin.animations"));
			ShaderProgram modelShader = new ShaderProgram(ResourceLocator.GetFullPath("Shaders/skeletalAnimation.vs"), ResourceLocator.GetFullPath("Shaders/skeletalAnimation.fs"));
            this.model = ms3dFile.ToModel(modelShader, tracks);
            this.controller = new Controller(model);
		}
Ejemplo n.º 2
0
Archivo: Game.cs Proyecto: tpb3d/TPB3D
        static void Main()
        {
			TextWriterTraceListener listener = new TextWriterTraceListener(Console.Out);
			Trace.Listeners.Add(listener);
			
            using (Game game = new Game())
            {
                //game.RunSimple(60);
				game.Run(60, 60);
            }
        }