Rscorpiox
11-07-2009 06:17:05
HI guys.
I am using the chinese font , it's worked fine under the D3D mode , but crash at OpenGL mode.
Here's my code.
And my core_font.xml define like this.
The log shows
Don't know if it caused by myGUI .
But hope can find way to solve it here.
Thx for the reading .
I am using the chinese font , it's worked fine under the D3D mode , but crash at OpenGL mode.
Here's my code.
class MyOwnGUI : public Ogre::FrameListener, public OIS::MouseListener
{
public:
MyOwnGUI()
{
button = mGUI->createWidget<MyGUI::Button>("Button", 10,10, 300, 80, MyGUI::Align::Bottom, "Main");
button->setFontName("mingliu.38");
button->setCaption(L"退出");
button->eventMouseButtonClick = MyGUI::delegates::newDelegate(this,&MyOwnGUI::exit);
button->eventMouseButtonClick = MyGUI::delegates::newDelegate(this,&MyOwnGUI::exit);
}
void MyOwnGUI::exit(MyGUI::WidgetPtr _widget)
{
button->hide();
}
private:
MyGUI::ButtonPtr button;
};
And my core_font.xml define like this.
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Font">
.....
.....
<Font name="mingliu.38" default_height="38" source="mingliu.ttc" size="19" resolution="90" antialias_colour="false" space_width="4" tab_width="8" cursor_width="2" distance="5" offset_height="-2">
<Code range="33 126"/>
<Code range="19968 39999"/>
</Font>
</MyGUI>
The log shows
......
13:28:58: Texture: Default_Texture: Loading 1 faces(PF_BYTE_LA,1024x128x1) with 0 generated mipmaps from Image. Internal format is PF_BYTE_LA,1024x128x1.
13:29:05: OGRE EXCEPTION(3:RenderingAPIException): Zero sized texture surface on texture mingliu.38_Texture face 0 mipmap 0. Probably, the GL driver refused to create the texture. in GLTexture::_createSurfaceList at ..\src\OgreGLTexture.cpp (line 380)
13:29:05: Unregistering ResourceManager for type BspLevel
......
Don't know if it caused by myGUI .
But hope can find way to solve it here.
Thx for the reading .