Dennis Kellly
|
Re: How to combine Qml window and native openglES window better?
|
Dennis Kellly
04/12/2017 7:05 AM
post117636
|
Re: How to combine Qml window and native openglES window better?
You can make opengl appear "on top" of qml by setting z-order. Numeric number for z-order must be higher than your qml
window (which is normally a low integer).
The following calls set size, position and z-order for your opengl window:
int wf_pos[2] = { WF_UL_X, WF_UL_Y };
int wf_size[2] = { WF_WIDTH, WF_HEIGHT }; // fixed
int zorder = 100; // some default
...
if (wf_size[0] > 0 && wf_size[1] > 0)
{
rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_SIZE, wf_size);
if (rc)
{
perror("screen_set_window_property_iv(SCREEN_PROPERTY_SIZE)");
goto fail5;
}
}
else
{
rc = screen_get_window_property_iv(screen_win, SCREEN_PROPERTY_SIZE, wf_size);
if (rc)
{
perror("screen_get_window_property_iv(SCREEN_PROPERTY_SIZE)");
goto fail5;
}
}
if (wf_pos[0] != 0 || wf_pos[1] != 0)
{
rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_POSITION, wf_pos);
if (rc)
{
perror("screen_set_window_property_iv(SCREEN_PROPERTY_POSITION)");
goto fail5;
}
}
rc = screen_set_window_property_iv(screen_win, SCREEN_PROPERTY_ZORDER, &zorder);
if (rc)
{
perror("screen_set_window_property_iv(SCREEN_PROPERTY_ZORDER)");
goto fail5;
}
|
|
|