我试图将ogre3d widget植入乌班图的qt widget,但我们看到黑色屏幕。
当我们:Root:RenderWindow没有父母的植被(作为主要窗口)时,一切都可行。 但是,当我们创造活力时:Root:RenderWindow作为其他主要窗口的儿童窗口时,我们会遇到无法工作的问题。
该守则是:
我有这个问题,我需要用下文所示的<代码>XSync方法。 这是<代码>的一部分。 OgreWidget: initialize methods, where OgreWidget/code> subclasses
QWidget
initialize
is calls as part of Construction of OgreWidget
,在m_OgreRoot
之后,分配并设定了成因系统。
setAttribute(Qt::WA_PaintOnScreen, true);
setAttribute(Qt::WA_NoSystemBackground, true);
setFocusPolicy(Qt::StrongFocus);
Ogre::String winHandle;
QX11Info info = x11Info();
winHandle = Ogre::StringConverter::toString((unsigned long)(info.display()));
winHandle += ":";
winHandle += Ogre::StringConverter::toString((unsigned int)(info.screen()));
winHandle += ":";
winHandle += Ogre::StringConverter::toString((unsigned long)(winId()));
Ogre::NameValuePairList params;
params["parentWindowHandle"] = winHandle;
params["FSAA"] = Ogre::String("8");
int w = width();
int h = height();
// Need to call XSync or the window handles will be invalid.
XSync(info.display(), False);
m_OgreWindow =
m_OgreRoot->createRenderWindow("OgreWidget_RenderWindow",
qMax(w, 640), qMax(h, 480), false, ¶ms);
此处为经修改的编号5.1.0的同一代码:QX11Info
被移至Qt 5.0.x,然后添加到Qt 5.1.0的“Exras”部分。 新的<代码>QX11Info类别只有固定方法。
#include <QtX11Extras/QX11Info>
...
setAttribute(Qt::WA_PaintOnScreen, true);
setAttribute(Qt::WA_NoSystemBackground, true);
setFocusPolicy(Qt::StrongFocus);
Ogre::String winHandle;
winHandle = Ogre::StringConverter::toString((unsigned long)(QX11Info::display()));
winHandle += ":";
winHandle += Ogre::StringConverter::toString((unsigned int)(QX11Info::appScreen()));
winHandle += ":";
winHandle += Ogre::StringConverter::toString((unsigned long)(winId()));
Ogre::NameValuePairList params;
params["parentWindowHandle"] = winHandle;
params["FSAA"] = Ogre::String("8");
int w = width();
int h = height();
// Need to call XSync or the window handles will be invalid.
XSync(QX11Info::display(), False);
m_OgreWindow =
m_OgreRoot->createRenderWindow("OgreWidget_RenderWindow",
qMax(w, 640), qMax(h, 480), false, ¶ms);
I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...
I have been searching for sample code creating iterator for my own container, but I haven t really found a good example. I know this been asked before (Creating my own Iterators) but didn t see any ...
Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...
I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?
Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...
Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?