I don't know what I'm doing wrong here. This code works fine, throws no exception, but as soon as it starts to render the MarkupText list it crashes. Seems like MarkupText::glyph is 0x00000000.
Code: Select all
void FolderBrowser::init()
{
Gorilla::Silverback& gorilla = app.getGuiRoot();
Vector2 viewport_size = app.getViewportSize();
//Vector2 size(0.1f*viewport_size.x, 0.25f*viewport_size.y);
mScreen = gorilla.createScreenRenderable(viewport_size, "dejavu");
mLayer = mScreen->createLayer();
mText = mLayer->createMarkupText(14, 0, 0, "This is a test!");
mNode = scene_mgr.getRootSceneNode()->createChildSceneNode();
mNode->attachObject(mScreen);
mNode->setScale(mScale, mScale, mScale);
}
Any idea why? I previously had a similar crash but it seems that it was because I used the wrong GlyphIndex when creating the MarkupText. But this time, I'm using the same GlyphIndex that already works for another MarkupText, which I use to display debug information.
Edit: mScale is 1.0f during initialisation.
Edit2: Stack trace for reference:
Code: Select all
> AppTouchView.dll!Gorilla::buffer<Gorilla::Kerning>::size() Line 226 + 0x3 bytes C++
AppTouchView.dll!Gorilla::Glyph::getKerning(char left_of='t') Line 356 + 0xb bytes C++
AppTouchView.dll!Gorilla::MarkupText::_calculateCharacters() Line 2263 + 0x13 bytes C++
AppTouchView.dll!Gorilla::Layer::_render(Gorilla::buffer<Gorilla::Vertex> & vertices={...}, bool force=false) Line 1336 C++
AppTouchView.dll!Gorilla::LayerContainer::_redrawAllIndexes(bool force=false) Line 899 C++
AppTouchView.dll!Gorilla::LayerContainer::_renderVertices(bool force=false) Line 915 C++
AppTouchView.dll!Gorilla::ScreenRenderable::renderOnce() Line 1026 C++
AppTouchView.dll!Gorilla::ScreenRenderable::frameStarted() Line 1018 + 0xf bytes C++
AppTouchView.dll!Gorilla::Silverback::frameStarted(const Ogre::FrameEvent & evt={...}) Line 666 + 0xf bytes C++
OgreMain_d.dll!Ogre::Root::_fireFrameStarted(Ogre::FrameEvent & evt={...}) Line 680 + 0x28 bytes C++
OgreMain_d.dll!Ogre::Root::_fireFrameStarted() Line 753 C++
OgreMain_d.dll!Ogre::Root::renderOneFrame() Line 837 + 0x8 bytes C++
OgreMain_d.dll!Ogre::Root::startRendering() Line 830 + 0x8 bytes C++
TouchscapeMain_d.dll!Touchscape::System::run() Line 228 + 0x11 bytes C++
TouchscapeLobby.exe!Touchscape::Lobby::run() Line 77 + 0xe bytes C++
TouchscapeLobby.exe!WinMain(HINSTANCE__ * hInst=0x00fa0000, HINSTANCE__ * __formal=0x00000000, char * strCmdLine=0x00425083, HINSTANCE__ * __formal=0x00000000) Line 125 C++
TouchscapeLobby.exe!__tmainCRTStartup() Line 578 + 0x35 bytes C
TouchscapeLobby.exe!WinMainCRTStartup() Line 403 C
kernel32.dll!76d21194()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!7728b495()
ntdll.dll!7728b468()
The locals window @ Gorilla::buffer<Gorilla::Kerning>::size() Line 226 + 0x3 bytes:
Code: Select all
- this 0x00000044 {mBuffer=??? mUsed=??? mCapacity=??? } const Gorilla::buffer<Gorilla::Kerning> * const
mBuffer CXX0017: Error: symbol "" not found
mUsed CXX0030: Error: expression cannot be evaluated
mCapacity CXX0030: Error: expression cannot be evaluated
The locals window @ Gorilla::Glyph::getKerning(char left_of='t') Line 356 + 0xb bytes:
Code: Select all
- this 0x00000000 {texCoords=0x00000000 uvTop=??? uvBottom=??? ...} const Gorilla::Glyph * const
Ogre::AllocatedObject<Ogre::CategorisedAllocPolicy<0> > {...} Ogre::AllocatedObject<Ogre::CategorisedAllocPolicy<0> >
+ texCoords 0x00000000 {x=??? y=??? } Ogre::Vector2 [4]
uvTop CXX0030: Error: expression cannot be evaluated
uvBottom CXX0030: Error: expression cannot be evaluated
uvWidth CXX0030: Error: expression cannot be evaluated
uvHeight CXX0030: Error: expression cannot be evaluated
uvLeft CXX0030: Error: expression cannot be evaluated
uvRight CXX0030: Error: expression cannot be evaluated
glyphWidth CXX0030: Error: expression cannot be evaluated
glyphHeight CXX0030: Error: expression cannot be evaluated
glyphAdvance CXX0030: Error: expression cannot be evaluated
+ kerning {mBuffer=??? mUsed=??? mCapacity=??? } Gorilla::buffer<Gorilla::Kerning>
left_of 116 't' char
The locals window @ Gorilla::MarkupText::_calculateCharacters() Line 2263 + 0x13 bytes:
Code: Select all
- c {mPosition=0x002ce11c mUV=0x002ce13c mColour={...} ...} Gorilla::MarkupText::Character
+ mPosition 0x002ce11c {x=107.00000 y=0.00000000 } Ogre::Vector2 [4]
+ mUV 0x002ce13c {x=0.022460938 y=0.090820313 } Ogre::Vector2 [4]
+ mColour {r=1.0000000 g=1.0000000 b=1.0000000 ...} Ogre::ColourValue
mIndex 13 unsigned int
i 14 unsigned int
- this 0x0a9f1128 {mLayer=0x0a995b00 mDefaultGlyphData=0x0a9fc5c8 mLeft=0.00000000 ...} Gorilla::MarkupText * const
Ogre::AllocatedObject<Ogre::CategorisedAllocPolicy<0> > {...} Ogre::AllocatedObject<Ogre::CategorisedAllocPolicy<0> >
+ mLayer 0x0a995b00 {mIndex=0 mRectangles=[0]() mPolygons=[0]() ...} Gorilla::Layer *
+ mDefaultGlyphData 0x0a9fc5c8 {mGlyphs=[93](0x0a9fcac8 {texCoords=0x0a9fcac8 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fc848 {texCoords=0x0a9fc848 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fc8e8 {texCoords=0x0a9fc8e8 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fca28 {texCoords=0x0a9fca28 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fc988 {texCoords=0x0a9fc988 uvTop=0.00097656250 uvBo Gorilla::GlyphData *
mLeft 0.00000000 float
mTop 0.00000000 float
mWidth 0.00000000 float
mHeight 0.00000000 float
+ mText "This is a test!" std::basic_string<char,std::char_traits<char>,std::allocator<char> >
+ mBackground {r=1.0000000 g=1.0000000 b=1.0000000 ...} Ogre::ColourValue
mDirty true bool
mTextDirty true bool
+ mCharacters {mBuffer=0x0a9bc838 mUsed=11 mCapacity=16 } Gorilla::buffer<Gorilla::MarkupText::Character>
+ mVertices {mBuffer=0x00000000 mUsed=0 mCapacity=0 } Gorilla::buffer<Gorilla::Vertex>
mClippedIndex 500203293 unsigned int
fixedWidth false bool
+ glyph 0x00000000 {texCoords=0x00000000 uvTop=??? uvBottom=??? ...} Gorilla::Glyph *
+ glyphData 0x0a9fc5c8 {mGlyphs=[93](0x0a9fcac8 {texCoords=0x0a9fcac8 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fc848 {texCoords=0x0a9fc848 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fc8e8 {texCoords=0x0a9fc8e8 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fca28 {texCoords=0x0a9fca28 uvTop=0.00097656250 uvBottom=0.043945313 ...},0x0a9fc988 {texCoords=0x0a9fc988 uvTop=0.00097656250 uvBo Gorilla::GlyphData *
cursorX 114.00000 float
lastChar 116 unsigned int
lineHeight 22.000000 float
top 0.00000000 float
cursorY 0.00000000 float
right 115.00000 float
markupMode false bool
kerning 0.00000000 float
left 0.00000000 float
texelOffsetX 0.00000000 float
texelOffsetY 0.00000000 float
bottom 23.000000 float
thisChar 33 unsigned int
+ colour {r=1.0000000 g=1.0000000 b=1.0000000 ...} Ogre::ColourValue