scyth3s's picture

Red X on GLControl

So, I've got this level editor that I'm creating for a 2D side scrolling game.

I figured the simplest way to save and load levels was to serialize and deserialize the level object, but upon deserialization, the GLControl shows nothing but a white background with a giant red X. I certainly did NOT expect textures to display properly when deserialized (because of how OpenGL handles them), I was going to figure that out later, but even with texturing disabled, the red X still shows.

I'm curious if anybody has any ideas on what could be causing this. I know I've given very little info, but I have a lot of code and no idea where to look, and maybe it's something terribly obvious to someone else.

You can download the editor here: , and it's use is crudely explained by the help button. In order to reproduce this glitch, add an Actor or a Platform to the level, save the level, and then load the level. Ignore the messagebox saying it's not implemented-- it's just a reminder!

Inline Images


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Paril's picture

Basically this just means an exception was thrown in one of the events, and as a result the control was disabled by WinForms in order to prevent data loss. Set your debugger to catch all unhandled exceptions and run your deserialization routine - it should halt on the line that caused it.


scyth3s's picture

So I did end up figuring out the problem. It was that you really can't serialize Texture's with openGL so I set some things to non-serializeable attributes, and saved paths for proper reloading. Problem fixed.