public RealtimeWorld(GameWindow window, IAudioAdapter audioAdapter, IGraphicsHost graphicsHost) { var graphics = graphicsHost.GetGraphicsAdapter(); var audioSystem = new AudioSystem(this, audioAdapter); var cameraSystem = new CameraSystem(this, graphicsHost); var actorSystem = new ActorSystem(this); var animationSystem = new AnimationSystem(this); // new up systems, order here will be order of update Systems.Add(new OpenTKInputSystem(this, window)); Systems.Add(new BspSystem(this)); Systems.Add(new PhysxPhysicsSystem(this)); Systems.Add(new MoverSystem(this)); Systems.Add(cameraSystem); Systems.Add(audioSystem); Systems.Add(actorSystem); Systems.Add(animationSystem); Systems.Add(new ScriptSystem(this, audioSystem, cameraSystem, actorSystem, animationSystem)); Systems.Add(new RenderCollectorSystem(this, graphics)); RenderSystems.Add(new RenderPipelineSystem(this, graphics)); globalResources.Add(new RenderListStore()); globalResources.Add(new InputStore()); }
public void Draw(IGraphicsHost host) { // TODO: Camera system OpenTK.Matrix4 projection = OpenTK.Matrix4.Identity; OpenTK.Matrix4.CreateOrthographicOffCenter(0, host.Width, host.Height, 0, 0, 1, out projection); this.Draw(projection); }
public Engine() { var host = new OpenGLHost(); gameWindowGetter = host.GetWindow; graphicsHost = host; gameLoop = host; audioHost = OpenALHost.Open(EngineGlobals.Forward, EngineGlobals.Up); }
public Application(IGraphicsHost host = null) { Host = host ?? new VeldridHost(GetType().Name); Host.Resized += HandleHostResize; Host.DrawingContextCreated += OnGraphicsDeviceCreated; Host.Rendering += Draw; Host.KeyPressed += OnKeyDown; ContentProvider = new ContentProvider(); TextureLoader = new TextureLoader(ContentProvider); }
public CameraSystem(World world, IGraphicsHost graphics) : base(world) { this.graphics = graphics; }