MonoGame.Forms is the easiest way of integrating a MonoGame render window into your Windows Forms project. It should make your life much easier, when you want to create your own editor environment.
Is it possible to use in net core? I have not managed to make it work.
The further I have managed to go is by using my own copy of MonoGame.Framework.WindowsDX, which at least builds. However I get this error on startup:
If instead of my own copy I use <PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.7.1.189" /> Then it straight up doesn't compile.
I'm trying to have a local copy of MonoGame.Forms and Monogame and be able to compile them on net core.
Exception has occurred: CLR/SharpDX.SharpDXException
An unhandled exception of type 'SharpDX.SharpDXException' occurred in SharpDX.dll: 'HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect.'
at SharpDX.Result.CheckError()
at SharpDX.Direct3D11.Device.CreateTexture2D(Texture2DDescription& descRef, DataBox[] initialDataRef, Texture2D texture2DOut)
at SharpDX.Direct3D11.Texture2D..ctor(Device device, Texture2DDescription description)
at Microsoft.Xna.Framework.Graphics.RenderTarget2D.CreateTexture() in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame\MonoGame.Framework\Platform\Graphics\RenderTarget2D.DirectX.cs:line 161
at Microsoft.Xna.Framework.Graphics.RenderTarget2D.GenerateIfRequired() in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame\MonoGame.Framework\Platform\Graphics\RenderTarget2D.DirectX.cs:line 34
at Microsoft.Xna.Framework.Graphics.RenderTarget2D.PlatformConstruct(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, DepthFormat preferredDepthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage, Boolean shared) in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame\MonoGame.Framework\Platform\Graphics\RenderTarget2D.DirectX.cs:line 25
at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat preferredFormat, DepthFormat depthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage, SurfaceType surfaceType, Boolean shared, Int32 arraySize) in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame\MonoGame.Framework\Graphics\RenderTarget2D.cs:line 82
at Microsoft.Xna.Framework.Graphics.RenderTarget2D..ctor(GraphicsDevice graphicsDevice, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat format, DepthFormat depthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage, SurfaceType surfaceType) in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame\MonoGame.Framework\Graphics\RenderTarget2D.cs:line 58
at Microsoft.Xna.Framework.Graphics.SwapChainRenderTarget..ctor(GraphicsDevice graphicsDevice, IntPtr windowHandle, Int32 width, Int32 height, Boolean mipMap, SurfaceFormat surfaceFormat, DepthFormat depthFormat, Int32 preferredMultiSampleCount, RenderTargetUsage usage, PresentInterval presentInterval) in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame\MonoGame.Framework\Platform\Graphics\SwapChainRenderTarget.cs:line 51
at Microsoft.Xna.Framework.Graphics.SwapChainRenderTarget..ctor(GraphicsDevice graphicsDevice, IntPtr windowHandle, Int32 width, Int32 height) in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame\MonoGame.Framework\Platform\Graphics\SwapChainRenderTarget.cs:line 27
at MonoGame.Forms.Controls.GraphicsDeviceControl.OnCreateControl() in C:\Users\OscarA\Documents\git_Projects\MyGame\MonoGame.Forms\MonoGame.Forms.DX\Controls\GraphicsDeviceControl.cs:line 247
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Is it possible to use in net core? I have not managed to make it work. The further I have managed to go is by using my own copy of MonoGame.Framework.WindowsDX, which at least builds. However I get this error on startup: If instead of my own copy I use
<PackageReference Include="MonoGame.Framework.WindowsDX" Version="3.7.1.189" />
Then it straight up doesn't compile. I'm trying to have a local copy of MonoGame.Forms and Monogame and be able to compile them on net core.