private void setTWGlobals(DataWrapper container) { var context = new TW.Context(); context.Graphics = game; context.Data = container; context.Physics = physX; context.Audio = new AudioWrapper(); TW.SetContext(context); }
public EngineTWContext(TWEngine engine) { this.engine = engine; Context = new TW.Context(); game = new GraphicsWrapper(); // TODO: make better setting resolution game.Form.FormSize = new Size(1280, 720); game.InitDirectX(); // TODO: more resolution sjit game.SpectaterCamera.AspectRatio = (float)game.Form.Form.ClientSize.Width / game.Form.Form.ClientSize.Height; typeSerializer = new TypeSerializer(engine); var container = new DataWrapper(engine.TraceLogger); physX = new PhysicsWrapper(); physX.Initialize(); setTWGlobals(container); //updateActiveGameplayAssembly(); //createSimulators(); var stringSerializer = StringSerializer.Create(); stringSerializer.AddConditional(new FilebasedAssetSerializer()); TW.Data.ModelSerializer = new ModelSerializer(stringSerializer, typeSerializer); TW.Data.TypeSerializer = typeSerializer; }