/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. m_SpriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here m_MonogameLogoTexture = Content.Load <Texture2D>("MonogameLogo"); m_NoesisGuiLogoTexture = Content.Load <Texture2D>("NoesisGuiLogo"); m_RenderTarget = new RenderTarget2D( GraphicsDevice, 512, 512, true, SurfaceFormat.Color, DepthFormat.None, 0, RenderTargetUsage.PreserveContents); // An example of how to share a monogame texture with Noesis var textureSource = NoesisWrapper.Wrap(m_MonogameLogoTexture); m_WrappedRenderTarget = NoesisWrapper.Wrap(m_RenderTarget); m_ViewModel = new ViewModel(textureSource, m_WrappedRenderTarget); m_NoesisWrapper.View.Content.DataContext = m_ViewModel; }
public ViewModel(IWrappedTexture monogameTexture, IWrappedTexture monogameRenderTarget) { MonogameTextureSource = new Noesis.TextureSource(monogameTexture.NoesisTexture); MonogameRenderTargetSource = new Noesis.TextureSource(monogameRenderTarget.NoesisTexture); }