12-19-2012 02:44 AM
Hi,
I had this code working in previous versions of the sdk, but now, it doesn't work anymore.
Anyone can help me to understand what is not working (I got it almost as is of the documentation).
Thanks for any help you can bring,
Cheers,
Fred
void PlayerApp::initExternalDisplay()
{
int rect[4] =
{
0, 0,0,0
};
screen_get_context_property_iv(mScreenCtx, SCREEN_PROPERTY_DISPLAY_COUNT, &miDispNb);
if ( miDispNb > 1 )
{
screen_display_t *screen_dpy = (screen_display_t *)calloc(miDispNb, sizeof(screen_display_t));
screen_get_context_property_pv(mScreenCtx, SCREEN_PROPERTY_DISPLAYS, (void **) screen_dpy);
int active = 0;
screen_get_display_property_iv(screen_dpy[1], SCREEN_PROPERTY_ATTACHED, &active);
screen_create_context(&mScreenCtx2, SCREEN_APPLICATION_CONTEXT);
screen_get_context_property_pv(mScreenCtx2, SCREEN_PROPERTY_DISPLAYS, (void **) screen_dpy);
screen_create_window(&mScreenWindow2, mScreenCtx2);
screen_set_window_property_pv(mScreenWindow2, SCREEN_PROPERTY_DISPLAY, (void **) &screen_dpy[1]);
int usage = SCREEN_USAGE_NATIVE;
screen_set_window_property_iv(mScreenWindow2, SCREEN_PROPERTY_USAGE, &usage);
screen_get_display_property_iv(screen_dpy[1], SCREEN_PROPERTY_SIZE, rect + 2);
screen_set_window_property_iv(mScreenWindow2, SCREEN_PROPERTY_BUFFER_SIZE, rect + 2);
screen_create_window_buffers(mScreenWindow2, 2);
screen_buffer_t screen_buf[2];
screen_get_window_property_pv(mScreenWindow2, SCREEN_PROPERTY_RENDER_BUFFERS, (void **) screen_buf);
screen_get_display_property_iv(screen_dpy[1], SCREEN_PROPERTY_SIZE, rect + 2);
int bg[] =
{
SCREEN_BLIT_COLOR, 0xff0000ff, SCREEN_BLIT_END
};
screen_fill(mScreenCtx2, screen_buf[0], bg);
screen_post_window(mScreenWindow2, screen_buf[0], 1, rect, 0);
free(screen_dpy);
}
}
Solved! Go to Solution.
12-19-2012 09:49 AM
Found the problem.
The code is working fine, but memory was a mess because of a qml slider problem...
Did not yet get to the bottom of this, but this code is working fine.
Fred
12-19-2012 11:55 AM
Great to hear its back on track for you :-)
Ash