
Red X on GLControl
Posted Monday, 16 April, 2012 - 06:24 by scyth3s inSo, 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: http://ubuntuone.com/7WLVnGG899Lwc64wVpff1a , 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!


Comments
Re: Red X on GLControl
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.
-P
Re: Red X on GLControl
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.