tddyer
Posts: 3
Joined: Thu Jan 28, 2016 7:51 pm

OpenVg graphics output to wrong display

Thu Jan 28, 2016 10:00 pm

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.

User avatar
Paeryn
Posts: 2058
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: OpenVg graphics output to wrong display

Thu Jan 28, 2016 11:13 pm

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.
She who travels light — forgot something.

tddyer
Posts: 3
Joined: Thu Jan 28, 2016 7:51 pm

Re: OpenVg graphics output to wrong display

Fri Jan 29, 2016 3:26 am

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?

User avatar
Paeryn
Posts: 2058
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: OpenVg graphics output to wrong display

Fri Jan 29, 2016 10:41 am

SDL & SDL_gfx or the newer versions SDL2 & SDL2_gfx would be worth looking at.
She who travels light — forgot something.

tddyer
Posts: 3
Joined: Thu Jan 28, 2016 7:51 pm

Re: OpenVg graphics output to wrong display

Sat Jan 30, 2016 3:04 am

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

Return to “OpenVG”

Who is online

Users browsing this forum: No registered users and 3 guests