Ejemplo n.º 1
0
        public OpenTKGameWindow(int width, int height, IInputCallbackSubscriber inputSubscriber, IImagePaintEventPublisher paintEventPublisher, IGameStateHookable gameStateHookable)
            : base(width, height, new RsOpenTkGraphicsMode(), "Rs317.Sharp by Glader")
        {
            InputSubscriber     = inputSubscriber ?? throw new ArgumentNullException(nameof(inputSubscriber));
            PaintEventPublisher = paintEventPublisher ?? throw new ArgumentNullException(nameof(paintEventPublisher));
            GameStateHookable   = gameStateHookable ?? throw new ArgumentNullException(nameof(gameStateHookable));

            ImageProducerCreationQueue = new ConcurrentQueue <IOpenTKImageRenderable>();
            Renderables             = new List <OpenGlRegisteredOpenTKImageRenderable>(25);
            InGameStaticRenderables = new List <OpenGlRegisteredOpenTKImageRenderable>(10);
            SetupGameEventCallbacks();

            PaintEventPublisher.OnImageRenderableCreated      += OnImageProducerCreated;
            gameStateHookable.LoggedIn.OnVariableValueChanged += OnLoginStateChanged;
        }
Ejemplo n.º 2
0
 public void RegisterInputSubscriber(IInputCallbackSubscriber subscriber)
 {
     InputSubscriber = subscriber ?? throw new ArgumentNullException(nameof(subscriber));
 }