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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Highlighted
Developer
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10
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);
}
}

Developer
Posts: 36
Registered: ‎09-17-2012
My Device: 9810-Playbooks-devalpha-Z10
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

Retired
Posts: 17
Registered: ‎11-27-2012
My Device: Bold 9900
My Carrier: VodaFone UK

Re: problem with Dual Screen in bb10 gold sdk

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

 

Ash