Exemplo n.º 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
#if WINDOWS
            ConsoleHelper.OpenConsole();
#endif
            _assetEngineService = new AssetEngineService(this);

            // Create storage
            _gameStorage = _assetEngineService.AssetEngine.CreateStorage(StorageName);
            Output.WriteLine(AssetMessages.StorageCreated, StorageName);

            // Create folder in storage
            _gameStorage.AddFolder(CustomAssetFolder);
            Output.WriteLine(AssetMessages.FolderCreated, CustomAssetFolder);

            /*
             * A loader must implement the IAssetLoader interface
             * When a loader is added to the engine, it is available for all storage
             * To add a new loader you have to call the AddLoader method of the AssetEngine :
             */
            _assetEngineService.AssetEngine.AddLoader(new CustomAssetLoader());
            Output.WriteLine(AssetMessages.AssetLoaderAdded, typeof(CustomAssetLoader));

            base.Initialize();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor of MeshBoundingBox class
        /// </summary>
        /// <param name="name">Name of the mesh</param>
        /// <param name="assetEngine">AssetEngine</param>
        internal MeshBoundingBox(string name, AssetEngine assetEngine)
        {
            Debug.Assert(assetEngine != null);

            Name = name;
            _storage = assetEngine[GraphicsConstant.Storage];

            LoadAsset();
            InitializeMesh();
        }
        /// <summary>
        /// Constructor of SimpleRenderingTechnique class
        /// </summary>
        /// <param name="renderer">Renderer</param>
        /// <param name="graphicsStorage">Storage</param>
        internal SimpleRenderingTechnique(Renderer renderer, Storage graphicsStorage)
        {
            _renderer = renderer;

            ShaderParameters shaderParameters = new ShaderParameters
            {
                Filename = ShaderFile,
                ShaderType = typeof(SimpleRenderingShader)
            };
            _shader = graphicsStorage[GraphicsConstant.ShaderFolderName].Load<Shader>(ShaderName, shaderParameters) as SimpleRenderingShader;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
#if WINDOWS
            ConsoleHelper.OpenConsole();
#endif
            _assetEngineService = new AssetEngineService(this);
            _gameStorage = _assetEngineService.AssetEngine.CreateStorage(StorageName);
            Output.WriteLine(AssetMessages.StorageCreated, StorageName);

            _gameStorage.AddFolder(MeshFolder);
            Output.WriteLine(AssetMessages.FolderCreated, MeshFolder);

            base.Initialize();
        }