wheybags / freeablo

[ARCHIVED] Modern reimplementation of the Diablo 1 game engine
GNU General Public License v3.0
2.16k stars 195 forks source link

Add video playback #409

Closed grantramsay closed 5 years ago

grantramsay commented 5 years ago

Works although:

Details from source:

// Adapted from https://wiki.videolan.org/LibVLC_SampleCode_SDL/
// Make sure VLC_PLUGIN_PATH env variable is set and using newish VLC (tested with 3.0.4).
// Currently a pretty hacky implementation, and there's bound to be a much easier way.
// Creates a new SDL window and GL context for video, as otherwise SDL_CreateRenderer alters
// the current GL context, causing a crash. Attempts to swap GL context back and forth when
// video is playing/stopped.
// VIDEO_DIRECT_WINDOW_RENDER is an attempt at rendering directly to an existing window,
// although seems to crash after video has finished. Also seems to require all the functions
// in sdl_gl_funcs.h/.cpp to be renamed to non-default GL names or crashes beforehand.

Fix for #27

Seemed like an interesting task so I had a look. Might be worth just leaving this PR open and someone with more OpenGL/VLC/SDL knowledge could fix it up... would be a good starting point at least.

grantramsay commented 5 years ago

Reckon we ditch vlc in favour of libmpv: