BlizzCrafter / MonoGame.Forms

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.
Other
287 stars 28 forks source link

Referencing GraphicsDevice causes a NullReferenceException #29

Closed CatoNator closed 4 years ago

CatoNator commented 4 years ago

As of version 2.3.9, evoking GraphicsDevice (MonoGame.Forms.Controls.get_GraphicsDevice) causes a nullreferenceexception. Happens in both GL and DX builds, doesn't seem to be a way around it.

BlizzCrafter commented 4 years ago

Are you using visual studio 2019?

CatoNator commented 4 years ago

Yes I am.

I managed to solve the issue already, but here's what I tried to do:

I tried to render each node from a TreeView by calling the drawing function from inside the node itself. Apparently this causes just about every variable to be nullified, not just GraphicsDevice specifically returning null.

Traversing through the tree from inside the preview window works fine.