Build everything, but the Demos do not work

compyler

08-04-2012 19:08:40

Hello!

This is the first time I am using MyGUI. I just build everything (Windows 7, VS 2010) successfully into an out of source folder MyGUI_3.2.0/Build.
Unter MyGUI_3.2.0/Build I have the debug and release folders and in both of them the executables Demo_Colour.exe etc.
But when I start any of these .exe the program crashes. I debugged a little bit and it seems like MyGUI can not find Wallpaper.layout.

I tried to copy the whole bin folder info MyGUI_3.2.0, so that the bin folder is next to the Media folder. But this does not work (program still crashes).

Where should I copy the built executables so that they run?

Altren

08-04-2012 21:11:47

You should not copy anything anywhere. CMake configure resources.xml and visual studio .user file to make all demos working from both - visual studio and from running exe itself.
Check, that there is resources.xml in Build/bin/debug and that it contain valid information. Here's mine:
<?xml version="1.0" encoding="UTF-8"?>

<Paths>
<Path root="true">D:/my-gui/trunk/Media</Path>
<Path>D:/my-gui/trunk/Media/MyGUI_Media</Path>
</Paths>

compyler

08-04-2012 22:50:58

There is a resources.xml, but the path seems to be wrong:
<?xml version="1.0" encoding="UTF-8"?>

<Paths>
<Path root="true">../../Media</Path>
<Path>../../Media/MyGUI_Media</Path>
</Paths>

If I go two folders up there is a Media folder, but its basically empty (contains only CMakeFiles folder, INSTALL.vcxproj, INSTALL.vcyproj.filters and cmake_install.cmake)

The real Media folder (with subfolders MyGUI_Media, Common etc) is one folder up.
So I changed it to ../../../Media and now the program exits with this message:
23:50:23 | Platform | Critical | Failed to lock texture (error code -2005530516). | ..\..\..\..\Platforms\DirectX\DirectXPlatform\src\MyGUI_DirectXTexture.cpp | 183

Do you know what this means and how I could fix this?

Altren

09-04-2012 09:35:13

What about resources.xml - disable MYGUI_INSTALL_* options, since they are used for making binary package and set such paths.
What about second problem with texture lock - try different demos, I guess only demos with direct texture access won't work (Demo_colour is one of them). I'm not sure why this happens though.

compyler

09-04-2012 11:27:18

I build everything new without the MYGUI_INSTALL options and now my resources.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>

<Paths>
<Path root="true">E:/Programmieren/MyGUI/MyGUI_3.2.0/Media</Path>
<Path>E:/Programmieren/MyGUI/MyGUI_3.2.0/Media/MyGUI_Media</Path>
</Paths>


When I start ANY of the demo executables (again under MyGUI_3.2.0/Build/bin/debug), it immediatelly crashes. The logfile says:
12:08:14 | Platform | Critical | Failed to lock texture (error code -2005530516). | ..\..\..\..\Platforms\DirectX\DirectXPlatform\src\MyGUI_DirectXTexture.cpp | 183

I manually debugged the application Demo_PanelView and it crashes in this method:
void* DirectXTexture::lock(TextureUsage _access)
{
D3DLOCKED_RECT d3dlr;
int lockFlag = (_access == TextureUsage::Write) ? D3DLOCK_DISCARD : D3DLOCK_READONLY;

HRESULT result = mpTexture->LockRect(0, &d3dlr, NULL, lockFlag);
if (FAILED(result))
{
MYGUI_PLATFORM_EXCEPT("Failed to lock texture (error code " << result << ").");
}

mLock = true;
return d3dlr.pBits;
}

To be more precise: LockRect() fails ("Invalid Call"). lockFlag is set to D3DLOCK_DISCARD. What could cause this? How can I fix this?