Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Carrier: Free mobile
Accepted Solution

problem with Dual Screen in bb10 gold sdk

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);
}
}

Please use plain text.
Developer
FredTBB
Posts: 36
Registered: ‎09-17-2012
My Carrier: Free mobile

Re: problem with Dual Screen in bb10 gold sdk

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

Please use plain text.
BlackBerry Development Advisor (Retired)
ashnazir
Posts: 17
Registered: ‎11-27-2012
My Carrier: VodaFone UK

Re: problem with Dual Screen in bb10 gold sdk

Great to hear its back on track for you :-)

 

Ash

Please use plain text.