Jump to content

[SOLVED] WidgetSpriteNode bug


photo

Recommended Posts

Posted

Due to the issues I have had with lower end graphics cards (https://developer.un...dgetspritenode/) the use of WidgetSpirteNode in my project has been disabled for some time. As I'm trying to now make this compatible with all hardware, I've re-enabled it, and it seems I've found a bug with later version of the SDK. Using setNode on a WidgetSpriteNode on an Object with a material assigned will cause the dreaded "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." on reaching UnigineApp::update(). Nothing appears suspicious in log file.

 

Example crash code;

 

Gui gui = engine.getGui();
viewport = new WidgetSpriteNode(gui, 200, 200);
viewport.setViewportMask(bitmask);
viewport.setBlendFunc(GUI_BLEND_SRC_ALPHA,GUI_BLEND_ONE_MINUS_SRC_ALPHA);
viewport.setLayerTexCoord(0,vec4(0, 1, 1, 0));
Object mesh = Unigine::createBox(vec3(1,1,1));
mesh..setViewportMask(bitmask, 0);
mesh.setMaterial("basic_material","*"); //ensure you set a material or it won't crash
viewport.setNode(mesh);

gui.addChild(viewport, GUI_ALIGN_OVERLAP);

 

Funnily enough I did a similar thing somewhere else in my project with the Unigine::createPlane function and added it to the WidgetSpriteNode and it ran fine?

 

I confirmed this bug by rolling back to 02-27 build of the SDK (where this code executes fine). I'm currently using 07-17, but the bug may have existed earlier than this.

Posted

I did make a test scene and it was pretty simple to reproduce. I'll dig it up and post it here and see if we can make it happen your side.

Posted

It crashes on the 2 computers I tried it on in the office, so hopefully thats the case, will report back next update I guess.

  • 4 weeks later...
Posted

Small UPD #1:
I've put test folder in archive to the %SDK%/data/test.

  • Open Samples & Demos tab in SDK library.
  • Load Cool Materials library.
  • Type in console
    world_load ../data/test/test_sample
  • And it is launched correctly.

But when I try to launch through the bat file I get crash. I've tried in Windows 7 x64/x86 and Ubuntu 12.04 x64/x86 - everything was fine. Maybe it will be useful for you smile.png

test_sample.jpg

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Posted

How peculiar! I too can get this to run using the steps you provided, but it looks as if I need to write a horrible hack in code that loads an empty world on start before loading the main one (if indeed thats what is enabling the WidgetSpirteNode to function properly). I'd rather keep the WidgetSpirteNode objects disabled than resort to that, so I'll be patient and wait for the bug to be fixed.

×
×
  • Create New...