dwmkerr / sharpgl

Use OpenGL in .NET applications. SharpGL wraps all modern OpenGL features and offers a powerful scene graph to aid development.
MIT License
766 stars 300 forks source link

OpenFileDialog.ShowDialog() => OK affects my buffers. #38

Open jochemgeussens opened 10 years ago

jochemgeussens commented 10 years ago

Dear SharpGL developers

I've been enhancing SharpGL a little and I'm creating some more modern OGL samples as practice. At the moment I'm creating a buffer based OBJ-file loader. I've created the import algorithm from scratch, so it might not be perfect.

The OBJ import works quite fine when I'm loading a file from a URL. However, when I use the OpenFileDialog.ShowDialog(), choose a file and press OK it seems to do something with my Buffers. After this all my objects disappear and I can't add any others anymore either.

After some debugging it seems that the ShowDialog => OK is causing the issue (it doesn't do it when I press Cancel instead).

When the ShowDialog closes it always continues to HiddenWindowRenderContextProvider.WndProc(...).

Do you have any idea what the problem might be? Note that I've been messing around with the OpenGLControl.xaml.cs, but I don't think that I did anything that influences this.

The full source code can be found here: https://github.com/jochemgeussens/sharpgl/tree/master/source/SharpGL/Samples/WPF/JOG/SharpGLObjFileImport

For the project to work, you'll have to use my version of SharpGL/SharpGL.WPF and SharpGL.SceneGraph.

Thanks in advance.

Kind regards, Jochem