public WindowManagerOpenTk( AppOpenTk parentApp, IDiscardableNode parentDiscardableNode) { this.parent_ = parentApp; this.discardableImpl_ = parentDiscardableNode.CreateChild(); }
protected EventOwner(IDiscardableNode parentDiscardable) { this.owner_ = IContractFactory.INSTANCE.NewWeakOwner( parentDiscardable, this.set_); }
public EventRelay(IDiscardableNode parentDiscardable) { this.listener_ = IEventFactory.INSTANCE.NewListener(parentDiscardable); this.emitter_ = IEventFactory.INSTANCE.NewEmitter(parentDiscardable); }
public AudioBufferOpenTk(IDiscardableNode parent) { this.Id = AL.GenBuffer(); this.node_ = parent.CreateChild(); this.node_.OnDiscard += _ => this.Destroy_(); }
public SingleAudioSourceOpenTk(IDiscardableNode parent) { this.Id = AL.GenSource(); this.node_ = parent.CreateChild(); this.node_.OnDiscard += _ => this.Destroy_(); }
public AudioOpenTk(IDiscardableNode parent) { this.node_ = parent.CreateChild(); this.node_.Using(new AudioContext()); this.factory_ = new AudioFactoryOpenTk(this.node_); }
public ProactiveAudioStreamSourceOpenTk( IDiscardableNode parent, Action <byte[]> populateFunc, int channels, int bytesPerSample, int frequency, int numBuffers, int bufferSize) { this.node_ = parent.CreateChild(); this.node_.OnDiscard += _ => this.Destroy_(); this.sourceId_ = AL.GenSource(); this.bufferIds_ = AL.GenBuffers(numBuffers).ToImmutableArray(); this.populateFunc_ = populateFunc; this.format_ = PcmHelperOpenTk.GetPcmFormat(channels, bytesPerSample); this.frequency_ = frequency; this.bufferSize_ = bufferSize; this.currentBufferIndex_ = new CircularRangedInt(0, 0, numBuffers); // TODO: Delay this until the observable has returned some value. Stream // should remember stop/play/paused state as expected in the meantime. this.readyBuffersIds_ = new Queue <int>(); foreach (var bufferId in this.bufferIds_) { this.readyBuffersIds_.Enqueue(bufferId); } this.PopulateAndQueueReadyBuffers_(); }
public void BeforeEachDiscardableTest() { this.discardableFactory_ = new DiscardableNodeFactoryImpl( rootDiscardable => this.OnRootDiscardableCreated( this.rootDiscardable_ = rootDiscardable)); }
public ContractPointerOwnerImpl( IDiscardableNode parentDiscardable, IContractPointerSet <T> set) { this.discardableImpl_ = parentDiscardable.CreateChild(); this.discardableImpl_.OnDiscard += _ => this.BreakAll(); this.set_ = set; }
public AppNodeImpl(IDiscardableNode parentDiscardableNode) { this.discardableImpl_ = parentDiscardableNode.CreateChild(); this.discardableImpl_.OnDiscard += _ => this.Discard_(); this.listener_ = IEventFactory.INSTANCE.NewListener(this.discardableImpl_); this.downwardRelay_ = IEventFactory.INSTANCE.NewRelay(this.discardableImpl_); this.forOnTickMethod_ = new ForOnTickMethodImpl(this); }
public WindowOpenTk( IDiscardableNode parentDiscardable, IWindowArgs args, InputOpenTk input, Action onClose) { this.discardableImpl_ = parentDiscardable.CreateChild(); this.discardableImpl_.OnDiscard += _ => this.Discard_(); var initialWidth = args.Dimensions.Width; var initialHeight = args.Dimensions.Height; this.nativeWindow_ = new NativeWindow(initialWidth, initialHeight, "SimpleGame", GameWindowFlags.Default, GraphicsMode.Default, DisplayDevice.Default); this.AttachToNativeInputEvents_(input); this.nativeWindow_.Closed += (_, _2) => onClose(); var windowInfo = this.nativeWindow_.WindowInfo; this.glContext_ = new GraphicsContext(GraphicsMode.Default, windowInfo, 1, 0, GraphicsContextFlags.Default); this.glContext_.MakeCurrent(windowInfo); ((IGraphicsContextInternal)this.glContext_).LoadAll(); //this.glContext_.SwapInterval = 0; this.windowBoundingBox_ = new MutableBoundingBox <int>(0, 0, initialWidth, initialHeight); var windowTopLeft = this.windowBoundingBox_.TopLeft; var windowDimensions = this.windowBoundingBox_.Dimensions; this.nativeWindow_.Move += (_, _2) => (windowTopLeft.X, windowTopLeft.Y) = (this.nativeWindow_.X, this.nativeWindow_.Y); this.nativeWindow_.Resize += (_, _2) => (windowDimensions.Width, windowDimensions.Height) = (this.nativeWindow_.Width, this.nativeWindow_.Height); this.viewport_.Push(new AggregationBoundingBox <int>( new ImmutableVector2 <int>(0, 0), this.windowBoundingBox_.Dimensions)); }
public AppOpenTk() { new DiscardableNodeFactoryImpl( root => this.rootDiscardableNode_ = root); this.Audio = new AudioOpenTk(this.rootDiscardableNode_); this.Instantiator = new InstantiatorImpl(this.rootDiscardableNode_); this.windowManager_ = new WindowManagerOpenTk(this, this.rootDiscardableNode_); this.root_ = this.Instantiator.NewRoot(); var settings = Settings.Load(); this.ticker_ = RecurrentCaller.FromFrequency(settings.Framerate, this.CompileTick_()); }
public IEventListener NewListener(IDiscardableNode parentDiscardable) => new EventListener(parentDiscardable);
public EventListener(IDiscardableNode parentDiscardable) : base(parentDiscardable) { }
public EventEmitter(IDiscardableNode parentDiscardable) : base(parentDiscardable) { }
public IEventEmitter NewEmitter(IDiscardableNode parentDiscardable) => new EventEmitter(parentDiscardable);
protected EventSource(IDiscardableNode parentDiscardable) : base(parentDiscardable) { }
public AudioFactoryOpenTk(IDiscardableNode parent) { this.node_ = parent.CreateChild(); }
protected override void OnRootDiscardableCreated( IDiscardableNode rootDiscardable) => INSTANTIATOR = new InstantiatorImpl(rootDiscardable);
public IStrongContractPointerOwner <T> NewStrongOwner <T>( IDiscardableNode parentDiscardable, IContractPointerSet <T> set) => new StrongContractPointerOwner <T>(parentDiscardable, set);
public IStrongContractPointerOwner <T> NewStrongOwner <T>( IDiscardableNode parentDiscardable) => this.NewStrongOwner(parentDiscardable, new DefaultContractPointerSet <T>());
public StrongContractPointerOwner( IDiscardableNode parentDiscardable, IContractPointerSet <T> set) : base(parentDiscardable, set) { }
public void SetParent(IDiscardableNode parent) => this.SetParent_(Expect.That(parent).AsA <DiscardableNodeImpl>());
protected abstract void OnRootDiscardableCreated( IDiscardableNode rootDiscardable);
public IEventRelay NewRelay(IDiscardableNode parentDiscardable) => new EventRelay(parentDiscardable);
protected override void OnRootDiscardableCreated( IDiscardableNode rootDiscardable) => this.rootDiscardable_ = rootDiscardable;
public InstantiatorImpl(IDiscardableNode parentDiscardable) { this.discardableImpl_ = parentDiscardable.CreateChild(); }
public IWeakContractPointerOwner <T> NewWeakOwner <T>( IDiscardableNode parentDiscardable, IContractPointerSet <T> set) => new WeakContractPointerOwner <T>(parentDiscardable, set);