However, my implamentation acts a bit different, as you can see.
I used dark_sylinc suggestions on way #2... and the projection is upside down. Not sure how I can fix this.
Also, as you can see, the font is not being loaded. From the previous thread it was said:
How can I set this manually? Any examples? Front is being loaded via:Hi,
When loading from JSON, Ogre will use the HlmsTextureManager (which is a texture manager built on top of the regular TextureManager); thus it won't see the font texture living in TextureManager.
You can set it manually from C++ though (I know it's a hassle though, that needs improving)
// Source: https://bitbucket.org/LMCrashy/ogreimgu ... ew-default
// Auther: Jean-Baptiste Griffo (I think?)
Code: Select all
void ImgGuiRenderable::createFontTexture()
{
// Build texture atlas
ImGuiIO& io = ImGui::GetIO();
unsigned char* pixels;
int width, height;
io.Fonts->GetTexDataAsRGBA32(&pixels, &width, &height);
mFontTex = Ogre::TextureManager::getSingleton().createManual("ImguiFontTex", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, width, height, 1, 1, Ogre::PF_R8G8B8A8);
const Ogre::PixelBox & lockBox = mFontTex->getBuffer()->lock(Ogre::Image::Box(0, 0, width, height), Ogre::v1::HardwareBuffer::HBL_DISCARD);
size_t texDepth = Ogre::PixelUtil::getNumElemBytes(lockBox.format);
memcpy(lockBox.data, pixels, width*height*texDepth);
mFontTex->getBuffer()->unlock();
}