How can I create a ui with my code for 2.1

I have code which uses screen.h currently to display video frames from ffmpeg. I am now trying to create a simple user interface for this code.

However it seems its not as simple as it sounds, I still have some questions after a lot of researching. I only need a few buttons, textviews and images but its looking like I might have to recode a lot of it just to have ui controls.

Will QT be ok for this? I can't understand if by me using screen.h then does it makes QT unusable for me? (I have no experience with QT - currently cant even build it).

Can EGL be used for simple ui controls and is screen.h compatible with EGL?

Re: How can I create a ui with my code for 2.1

Qt and screen.h don't integrate - either you paint your windows with Qt, or with libscreen, but they can't be combined. Mainly because Qt doesn't expose the internal screen resources it uses, like screen_window_t, in any API.

You could of course ditch libscreen completely and draw everything with Qt, even the videos.

Re: How can I create a ui with my code for 2.1

It was a difficult task learning how to paint the frames from ffmpeg AVPacket to screen.h and it works great so if I can stick with that then great. So what is the way to create a button with screen.h?

If no way for screen, would it be difficult do you think to change the painting code to qt for someone who has never touched it before?

Also, when cascades comes to playbook, will that work with this screen.h code?

Sorry for the questions, it's looking like I have just written weeks of code and now there is no way for a user to do anything with it so I need to be sure before I cry!

Re: How can I create a ui with my code for 2.1

libscreen does not offer any high-level functions to draw widgets. Of course you can draw them yourself using libscreen, by accessing the image data directly and drawing every pixel manually, but that is going to be hard, and will not look nice.

If you want to draw a button, use a high-level API like Cascades or Qt to draw it for you.

At least Cascades supports the class ForeignWindow, which lets you embed a screen window into the Cascades scene - that would allow you to continue using your existing code.

In Qt, it might be possible to create a window with libscreen yourself, and display that on top of Qt's window, which would also solve your usecase.

And the last option, which I mentioned earlier, is to simply draw the video frames with Qt, after getting the frame data from ffmpeg. I can't judge how difficult that would be. Probably just a matter of overriding QWidget:aintEvent() and blitting the video frame there.

Re: How can I create a ui with my code for 2.1

Is c code I have written (which has char arrays, sockets, calls ffmpeg library, libbps, strcat and strcpy) a waste of time because no ui is available in c and never will so this code will need to be converted to c++ to have a ui.

Re: How can I create a ui with my code for 2.1

You can certainly create a simple UI using a few image assets blitted to a libscreen window. eg. load a few PNGs for the buttons you want, display them at the appropriate co-ordinates, and detect touch events within the bounds of each button. Or get a blank button PNG and render text over them. Or use whatever primitives OpenGL provides for you.