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) ; }
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; }
static public void Initialize(string mediapath) { StartTime = DateTime.Now; World = new World(); Media.SearchPath = mediapath; Media.LoadFileMap(); SetCurrentThreadCores(1); }