示例#1
0
文件: Game.cs 项目: whztt07/vengine
        static public void Initialize(Size resolution, int msaasamples, string mediapath, GameWindowFlags flags = GameWindowFlags.Default)
        {
            StartTime = DateTime.Now;
            MSAASamples = msaasamples;
            World = new World();
            Media.SearchPath = mediapath;
            Media.LoadFileMap();
            ShadowMaps = new ShadowMapsArrayTexture(512, 512);
            Resolution = resolution;
            SetCurrentThreadCores(1);

            ShaderPool = new ShaderPool();

            var thread = Task.Factory.StartNew(() =>
            {
                SetCurrentThreadCores(2);
                DisplayAdapter = new VEngineWindowAdapter("VEngine App", resolution.Width, resolution.Height, flags);

                GraphicsSettings.UseDeferred = true;
                GraphicsSettings.UseRSM = false;
                GraphicsSettings.UseVDAO = true;
                GraphicsSettings.UseFog = false;
                GraphicsSettings.UseBloom = false;
                GraphicsSettings.UseLightPoints = true;

                DisplayAdapter.CursorVisible = false;

                Invoke(() => Initialized = true);
                DisplayAdapter.Run();
            });
            while(!Initialized)
                ;
        }
示例#2
0
文件: World.cs 项目: yanko/vengine
 public World()
 {
     Children = new List<IRenderable>();
     LinesPool = new Line2dPool();
     CollisionConf = new DefaultCollisionConfiguration();
     Dispatcher = new CollisionDispatcher(CollisionConf);
     Broadphase = new DbvtBroadphase();
     PhysicalWorld = new DiscreteDynamicsWorld(Dispatcher, Broadphase, null, CollisionConf);
     PhysicalWorld.Gravity = new Vector3(0, -10, 0);
     PhysicalWorld.SolverInfo.SolverMode = SolverModes.InterleaveContactAndFrictionConstraints;
     PhysicalWorld.SolverInfo.Restitution = 0;
     CollisionObjects = new Dictionary<IRenderable, CollisionObject>();
     UI = new UIRenderer();
     if(Root == null)
         Root = this;
 }
示例#3
0
文件: Game.cs 项目: whztt07/vengine
 static public void Initialize(string mediapath)
 {
     StartTime = DateTime.Now;
     World = new World();
     Media.SearchPath = mediapath;
     Media.LoadFileMap();
     SetCurrentThreadCores(1);
 }