I have this code, its puts a green frame around a black rectangle, I was going for a green screen but close enough!
Code: Select all
uint32_t screen_width;
uint32_t screen_height;
int32_t success = 0;
DISPMANX_ELEMENT_HANDLE_T dispman_element;
DISPMANX_DISPLAY_HANDLE_T dispman_display;
DISPMANX_UPDATE_HANDLE_T dispman_update;
DISPMANX_RESOURCE_HANDLE_T dispman_resource;
VC_RECT_T dst_rect;
VC_RECT_T src_rect;
uint32_t img_handle;
uint32_t img_result;
bcm_host_init();
success = graphics_get_display_size(0 /* LCD */, &screen_width, &screen_height);
assert( success >= 0 );
dispman_display = vc_dispmanx_display_open( 0 /* LCD */);
dispman_update = vc_dispmanx_update_start( 0 );
dst_rect.x = 0;
dst_rect.y = 0;
dst_rect.width = screen_width;
dst_rect.height = screen_height;
src_rect.x = 0;
src_rect.y = 0;
src_rect.width = 720;
src_rect.height = 576;
dispman_element = vc_dispmanx_element_add ( dispman_update, dispman_display,
0/*layer*/, &dst_rect, 0/*src*/,
&src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0/*clamp*/, 0/*transform*/);
vc_dispmanx_display_set_background( dispman_update, dispman_display, 0x00, 0xaa, 0x00 );
vc_dispmanx_update_submit_sync( dispman_update );
Then I guess something needs to be called to show the resource? Is it just vc_dispmanx_display_set_destination? Or do more things need to be done with updates?
Also - sorry for the re-post but there's no edit and my original thread wasn't very clear!
