10-11-2012 12:38 PM
Hi,
I'm trying to write an app that will display real time information on a "small" foreign window, and I would like to be able to have this tiny windows in full screen to the second screen when the bb is linked to hdmi. I succeeded to implement this when I'm not using cascade thanks to the quite complicated sample here :https://developer.blackberry.com/native/reference/
in my native code, I simply use a pixmap that I copy on buffer created on the 2 display with different scale. When I'll be able to do that in my cascade app, I think i'll be close to my goal.
What I have in my cascade app is always the same screen on both displays.
Thanks for any idea, input, or solution you can provide.
Cheers,
Fred
Solved! Go to Solution.
10-12-2012 08:15 AM
Hi,
I found a few more information here:
https://developer.blackberry.com/cascades/referenc
I deduced from there that cascade is aware of multiple display, can retrieve their informations. What can I do with it now?
I still found no way to write on the second display or no explanatino why this is not working.
I was thinking of maybe a new foreignwindow, but in this case, i need to tell cascade on wich display will be draw a page, and I want to have multiple page displayed in the same time on different displays, here again, I'm stuck.
My development is dead now, this is a functionnality I need to continue what I'm trying to achieve. I could rewrite everything in full native, but it will be a pain to do that (and cascade UI is beautiful, so I don't really want to lose it).
cheers
10-15-2012 01:31 PM
Info on this subject ?
Nicolas
10-15-2012 01:34 PM
nothing new,
I'm still trying a few things to work this out, but without success till now...
10-16-2012 02:51 PM
Good news, at least for me! Doing a short program, I succeeded to have it working, I'll post an example as soon as I'll have finished my implementation. My first app on AppWorld soon.
01-14-2013 10:07 AM
glad to hear you found a solution - are you still thinking of sharing a sample?
01-14-2013 10:12 AM
Will do for sure, but a bit in a hurry now (after I published my karaoke app, I got requests for more).
Cheers
Fred
01-14-2013 10:32 AM
As a starter, here is the function that initialize the external display.
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);
}
}
Fred