0

I'm planning on creating a map editor for a C# game I'm building. I've done this previously using XNA and XNA's old GraphicsDeviceControl, GraphicsDeviceService and ServiceContainer. I want the ability to create a class and inherit from the GraphicsDeviceControl class and then drag that class onto the form from the toolbox just like this: Youtube Video

I've installed OpenTK using NuGet and followed this tutorial but when I create a class and inherit GraphicsDeviceControl it doesn't show up in the form toolbox. Am I doing something wrong? Isn't this possible using monogame? If it's possible, what should I do to get it working?

Thanks in advance!

TS1997
  • 106
  • 1
  • 11

2 Answers2

0

If your simply after a GL window within a form, look into GLControl, it does exactly that. Right click in some empty space of the Toolbox, browse and select OpenTK.GLControl.dll.

enter image description here

enter image description here

livin_amuk
  • 1,285
  • 12
  • 26
0

I finally managed to get it working :D I added every class that exists in the project called MGWinFormsControls in this github repo to my project. I already had a monogame.framework as well as OpenTK and OpenTK.GlControl reference. Then I created a class and inherited from GraphicsDeviceControl. At first this didn't work but after only writing one line of code in the draw function in my class it worked. I just wrote GraphicsDevice.Clear(Color.Black). Now the class shows up in the toolbox

TS1997
  • 106
  • 1
  • 11