Page 1 of 1
OpenVg graphics output to wrong display
Posted: Thu Jan 28, 2016 10:00 pm
by tddyer
I have written a small program with simple graphics using C++ and OpenVg. I am using a 3.5" spi LCD. When I am running on my hdmi monitor the program runs as expected. However when I switch to the lcd everything seems to work as expected except my graphics from my program appear on the hdmi instead of my LCD. I have read many posts and believe it is related to the framebuffer or EGL. I have tried changing /boot/config.txt from fb0 to fb1. This causes both displays to be blank. I am a noob with Linux, Raspberry Pi, and programming. Any help on this would be greatly appreciated.
Re: OpenVg graphics output to wrong display
Posted: Thu Jan 28, 2016 11:13 pm
by Paeryn
The OpenVG display is a separate entity from the framebuffer, it isn't drawn onto it. The VC4 composites the framebuffer along with any other graphical layers (OpenVG, OpenGLES, dispman) in realtime when generating the display over HDMI or the official display (and VGA666 I think). The spi based displays just have an ARM side framebuffer. To get the OpenVG window on an spi display you'd need to grab a copy of the OpenVG window with vgReadPixels() and copy it onto the framebuffer you want.
Re: OpenVg graphics output to wrong display
Posted: Fri Jan 29, 2016 3:26 am
by tddyer
Thank you very much for the reply. Is there a graphics library that runs well on the Pi and can write to the frame buffers directly?
Re: OpenVg graphics output to wrong display
Posted: Fri Jan 29, 2016 10:41 am
by Paeryn
SDL & SDL_gfx or the newer versions SDL2 & SDL2_gfx would be worth looking at.
Re: OpenVg graphics output to wrong display
Posted: Sat Jan 30, 2016 3:04 am
by tddyer
Thanks for pointing me in the right direction. The SDL library looks to be the easiest. I am concerned about the speed of my display. I am planning on trying the copy and also rewriting the code to use SDL and see if there is a noticeable speed difference. Thanks again for your help.
Terry