-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Example using an FBO #63
Comments
While the documentation (the comment in If you explain that maybe someone here can help you. |
Thank you for getting back to me so quickly! I download youtube videos and watch them later in mpv instead of relying on the god-awful youtube interface. I have the videos, thumbnails, metadata, and comments all downloaded, and I can manually sift through them, but it's a pain in the neck. I'm doing my best (which isn't very good) to use C++, SDL, and mpv, to write something that kinda looks and acts like youtube, minus the suggestions and search. Sort of a file browser specifically for my "watch later" directory, where I can scroll through thumbnails, click on them to play videos, and read through the comments. From what I understand (which is very little), this requires me to create a framebuffer object, to which mpv can render its output. My terminology is going to be mixed up here, but from there I believe I can use the FBO as a texture, allowing me to scale and transform it as I wish, which is an important difference from |
This is all correct. |
The plan was to see how far I could get with things like I'm clearly in over my head, but my understanding was that SDL was a layer on top of OpenGL (or maybe other graphics APIs, but SDL in this case at least), so the interop wouldn't be so bad - I'd just have to make sure to update the view from the texture mpv is rendering to often enough, and make sure not to try and draw on top of it. Even if I'm headed for a brick wall, it seems like it'll be fun to get there, so I'm glad I got the above correct. Would you be able to point me in the direction of some documentation/examples rendering to an FBO that don't assume quite as much knowledge? |
The SDL renderer is a software renderer. Your options are to either switch to OpenGL or use the software rendering support as in main_sw, which works with SDL_Renderer. Be warned that it will not be fast/efficient. |
Followup to #19, which was for some reason closed without a resolution. I'll reproduce my comment from there, here, for convenience.
Please forgive me for being extremely stupid.
Where is it "all documented"? The comment in
libmpv/sdl/main.c
referencesrender_gl.h
, which I think might bempv/libmpv/render_gl.h
which in turn referencesglGenFrameBuffers()
, which isn't mentioned in the SDL docs I found, nor is "frame", nor "buffer".Googling for "sdl glgenframebuffers", or "sdl get framebuffer", or "sdl get fbo" all lead to the same couple of StackOverflow questions about directly modifying pixels, not getting an int I can give to
mpv_opengl_fbo.fbo
.Googling for "sdl mpv fbo" gets me an example of using the opengl-cb API which the README in this repo says doesn't exist any more, an arch linux BBS thread where some guy symlinks his system python2 to
python
to get libreoffice to work, and this dang issue.Could someone please point me towards where this is "all documented"? Please remember that if I try really hard, I can just about reach 30 IQ.
The text was updated successfully, but these errors were encountered: