public ResourceManager(IMaterialFactory materialFactory, IShaderFactory shaderFactory, ITextureFactory textureFactory)
 {
   if (materialFactory == null) throw new ArgumentNullException("materialFactory");
   if (shaderFactory == null) throw new ArgumentNullException("shaderFactory");
   if (textureFactory == null) throw new ArgumentNullException("textureFactory");
   _materialFactory = new MaterialFactory();
   _shaderFactory = shaderFactory;
   _textureFactory = textureFactory;
 }
Example #2
0
        public UserInterfaceManager(IKernel kernel)
        {
            IDeviceProvider provider = kernel.Get<IDeviceProvider>();

            provider.RenderForm.Resize += OnRenderFormResize;

            _device = provider.Device;
            _textureFactory = kernel.Get<ITextureFactory>();
            _renderer = kernel.Get<IUserInterfaceRenderer>();
            _elements = new List<Element>();
            _projectionDirty = true;
        }
Example #3
0
        /// <summary>Default constructor of the base Game class does nothing. Only when Initialize is called
        /// is anything useful done.
        /// </summary>
        public GameEngine(
            IWindowFactory windowFactory,
            IRendererFactory rendererFactory,
            ITextureFactory textureFactory,
            ISurfaceFactory surfaceFactory,
            ITrueTypeTextFactory trueTypeTextFactory,
            IEventManager eventManager,
            ILogger <GameEngine> logger = null)
        {
            WindowFactory       = windowFactory ?? throw new ArgumentNullException(nameof(windowFactory));
            RendererFactory     = rendererFactory ?? throw new ArgumentNullException(nameof(rendererFactory));
            TextureFactory      = textureFactory ?? throw new ArgumentNullException(nameof(textureFactory));
            SurfaceFactory      = surfaceFactory ?? throw new ArgumentNullException(nameof(surfaceFactory));
            EventManager        = eventManager ?? throw new ArgumentNullException(nameof(eventManager));
            TrueTypeTextFactory = trueTypeTextFactory ?? throw new ArgumentNullException(nameof(trueTypeTextFactory));
            this.logger         = logger;

            EventManager.WindowClosed += OnExiting;
            EventManager.Quitting     += OnExiting;
        }
Example #4
0
        protected override void Initialize()
        {
            SfxrSynth.AudioPlayerFactory = new Audio.AudioPlayerFactory();

            base.Initialize();

            engineRef      = new EngineReference();
            displayTarget  = new DisplayTarget(engineRef, Window, graphics);
            textureFactory = new TextureFactory(this.GraphicsDevice);
            spriteBatch    = new SpriteBatch(GraphicsDevice);
            inputFactory   = new InputFactory(displayTarget);

            runner = new RunnerWrapper("./Content/MusicDemo.pv8", engineRef, displayTarget, textureFactory, inputFactory);

            runner.Initialize();

            // forces viewport adapter to refresh position/scaling
            graphics.PreferredBackBufferWidth  = graphics.PreferredBackBufferWidth;
            graphics.PreferredBackBufferHeight = graphics.PreferredBackBufferHeight;
            graphics.ApplyChanges();
        }
 public PixelDataExporter(string fileName, int[] pixelData, int width, int height, IColor[] colors, ITextureFactory textureFactory) : base(fileName, textureFactory, colors)
 {
     this.pixelData = pixelData;
     this.width     = width;
     this.height    = height;
 }
Example #6
0
 public TilemapFlagExporter(string fileName, IEngine engine, ITextureFactory textureFactory) : base(fileName, engine, textureFactory)
 {
 }
 public TilemapExporter(string fileName, IEngine engine, ITextureFactory textureFactory) : base(fileName, textureFactory)
 {
     this.engine = engine;
 }
Example #8
0
 public ResourceManager(IMaterialFactory materialFactory, IShaderFactory shaderFactory, ITextureFactory textureFactory)
 {
     if (materialFactory == null)
     {
         throw new ArgumentNullException("materialFactory");
     }
     if (shaderFactory == null)
     {
         throw new ArgumentNullException("shaderFactory");
     }
     if (textureFactory == null)
     {
         throw new ArgumentNullException("textureFactory");
     }
     _materialFactory = new MaterialFactory();
     _shaderFactory   = shaderFactory;
     _textureFactory  = textureFactory;
 }
Example #9
0
 public TextureAtlasBuilder(ITextureFactory <TTexture> textureFactory) => this.textureFactory = textureFactory;
Example #10
0
 public Runner(ITextureFactory textureFactory)
 {
     loadService = new LoadService(textureFactory);
 }
Example #11
0
 public SceneFactory(IMeshFactory meshFactory, ITextureFactory textureFactory, ILogger <SceneFactory> logger)
 {
     this.meshFactory    = meshFactory;
     this.textureFactory = textureFactory;
     this.logger         = logger;
 }
Example #12
0
 public TextRenderer(ITextureFactory <TTexture> textureFactory, SpriteBatch <TTexture> spriteBatch)
 {
     this.textureFactory = textureFactory;
     this.spriteBatch    = spriteBatch;
 }
Example #13
0
 public ImageExporter(string fileName, ITextureFactory textureFactory, IColor[] colors = null) : base(fileName)
 {
     this.textureFactory = textureFactory;
     this.colors         = colors;
 }
Example #14
0
 internal Style(ITextureFactory textureFactory)
 {
     this.textureFactory = textureFactory;
 }
 public OBJToRAMMeshConverter(ITextureFactory _textureFactory)
 {
     textureFactory = _textureFactory;
 }
Example #16
0
        public LoadService(ITextureFactory textureFactory)
        {
            this.textureFactory = textureFactory;
//            this.colorFactory = colorFactory;
        }