public void Load(ContentManager contentManager) { _contentManager = new ThreadSafeContentManager(contentManager.ServiceProvider) { RootDirectory = "Content" }; rollTexture2D = _contentManager.Load <Texture2D>("Graphical User Interface/ring"); skyboxCube = _contentManager.Load <TextureCube>("ShaderModules/Skybox/skyboxCubemap"); fresnelMap = _contentManager.Load <Texture>("ShaderModules/AnimatedModelShader/fresnel2"); model = _contentManager.Load <Model>("ShaderModules/Skybox/isosphere" /*"ShaderModules/AnimatedModelShader/cube"*/); _skyboxRenderModule = new SkyboxRenderModule(); _skyboxRenderModule.Load(_contentManager, "ShaderModules/Skybox/skybox", "ShaderModules/Skybox/isosphere"); _skyboxRenderModule.SetSkybox(skyboxCube); _animatedModelShader = new AnimatedModelShader(); _animatedModelShader.Load(_contentManager, "ShaderModules/AnimatedModelShader/AnimatedModelShader"); _animatedModelShader.EnvironmentMap = skyboxCube; _animatedModelShader.FresnelMap = fresnelMap; int test = 1024; int level = 7; int outp = test >> level; _ambientOcclusionShader = new AmbientOcclusionShader(); _ambientOcclusionShader.Load(_contentManager, "ShaderModules/AmbientOcclusionShader/AmbientOcclusionShader"); }
public void Load(ContentManager content, string path) { //Hot swapping _contentManager = new ThreadSafeContentManager(content.ServiceProvider) { RootDirectory = "Content" }; ReloadShader(path); }
public void Load(ContentManager content, string path) { //Hot swapping _contentManager = new ThreadSafeContentManager(content.ServiceProvider) { RootDirectory = "Content" }; WireFrameRasterizer = new RasterizerState(); WireFrameRasterizer.FillMode = FillMode.WireFrame; WireFrameRasterizer.CullMode = CullMode.None; ReloadShader(path); }
/// <summary> /// Loads the asset asynchronously on another thread. /// </summary> /// <typeparam name="T">The type of the asset to load</typeparam> /// <param name="contentManager">The content manager that will load the asset</param> /// <param name="assetName">The path and name of the asset (without the extension) relative to the root directory of the content manager</param> /// <param name="action">Callback that is called when the asset is loaded</param> public static void Load <T>(this ThreadSafeContentManager contentManager, string assetName, Action <T> action) { #if MONOMAC // Loading content on a background thread seems to be completely undoable on Mac //Yeti return; #endif return; ThreadPool.QueueUserWorkItem((s) => { //T asset = contentManager.DefaultLoad<T>(assetName); // non-blocking version, maybe? //Debug T asset = contentManager.Load <T>(assetName); if (action != null) { // Silverlight/Windows Phone version, or something idk //Deployment.Current.Dispatcher.BeginInvoke(action, asset); action.BeginInvoke(asset, null, null); } }); }
public static void init(Game game, ContentManager content, GameServiceContainer services) { Content = new ThreadSafeContentManager(services, "Content"); Battler_Content = new ThreadSafeContentManager(services, "Content"); Chapter_Text_Content = new ThreadSafeContentManager(services, "Content"); if (Services == null) { Services = new GameServiceContainer(); Services.AddService(typeof(IAudioService), new Audio_Engine.Audio_Service()); Services.AddService( typeof(Tactile.Services.Rumble.BaseRumbleService), new Tactile.Services.Rumble.RumbleService(game)); Services.AddService( typeof(Tactile.Services.Input.BaseInputService), new Tactile.Services.Input.InputService(game)); Item_Data.equipment_data = new Equipment_Service(); Data_Class.class_data = new Class_Service(); Data_Weapon.weapon_type_data = new WeaponTypeService(); TactileBattlerImage.animation_battler_data = new BattlerAnimsService(); Global.game_state = new Game_State(); Global.game_options = new Game_Options(); Global.game_system = new Game_System(); Global.game_temp = new Game_Temp(); #if DEBUG && WINDOWS DebugMonitor = new Debug_Monitor.DebugMonitorState(); #endif } load_data_content(); Scene_Map.set_content(services); }
/// <summary> /// Initializes the control, creating the ContentManager /// and using it to load a SpriteFont. /// </summary> protected override void Initialize() { content = new ThreadSafeContentManager(Services, "Content"); playState = PlayState.Stopped; Stage.renderer = new Renderer(GraphicsDevice); Stage.renderer.Initialize(); GameLib.Renderer.DrawTriggers = true; timer = Stopwatch.StartNew(); Stage.Content = content; Stage.Editor = true; Stage.renderer.LoadContent(); font = content.Load<SpriteFont>("DefaultFont"); Mouse.WindowHandle = this.Handle; Application.Idle += delegate { Invalidate(); }; SlowMotion = false; SlowAmount = 2.0f; dispatcherService = new XNAFrameworkDispatcherService(); }