I recently Integrated kspes' Theora Playback Library
http://sourceforge.net/projects/libtheoraplayer/to use SFML images and sprites for cut-scenes in my game, I thought I would share it here for anybody who found it useful. Its not to much more than a simple wrapper, but it works quite well for most situations
with this you can get a video up and playing in about 5 lines,
the test program,
//Project files!
#include <iostream>
#include "movie_player.h"
/* Minimal Example */
int main()
{
sf::RenderWindow Rendow( sf::VideoMode(800, 600, 32), "Ubar Videoz", 6 );
MoviePlayer movieManager;
//Load and play Cutscenes
std::string vid_location = "resources/demo.ogv";
movieManager.playCutscene(&Rendow, vid_location, sf::Key::Escape, true);
Rendow.Close();
return EXIT_SUCCESS;
}//End ov Main!
the
playCutscene()
is just a utility function to play a full screened video, that can be exited by a button you specify, you can also tell it to let the user control the video or not (seek, pause, etc).
you can also create an instance of MovieClip and control how/when to update/draw your movie, since it inherits from sf::Sprite, you can treat it like any other sprite object. So,
MoviePlayer movieManager;
//Load video manually
MovieClip *clip;
clip = movieManager.loadClip( vid_location, TH_RGBA );
//TH_RGBA is an enum for how to load the video pixel data,
//SFML's LoadFromPixel function likes this one
...
//in while loop
//Do silly Sprite things to the video
clip->SetPosition(30, 50);
clip->Rotate(10);
clip->SetColor( sf::Color(255,255,255,100) );
clip->Resize(800, 600);
clip->Update( Rendow->GetFrameTime() );
Rendow->Clear();
clip->Draw( &Rendow );
Rendow->Display();
This would play a movie that sets its position, rotates, resizes, and is partially transparent, not sure why you would do that, however the option is there!
here it is,
...
Includes the sources, VS2010 project, dependencies to compile it, and a simple test program,
note I didn't include the debug version of the dependencies, so the test program will only compile in Release mode. You should be able to fix this if you include it in your game
Let me know what you think of it.
[EDIT] Newer Version: Just updated to include vs2008 project, nothing really new
Win.PS. I used the OpenAL interface straight from the Theora playback lib examples, if any body wants to make and share an interface using SFML's audio library, I would be most grateful.
PSS. If you need to convert video into the Theora format, i would suggest Theora Converter.NET if your on windows, Dead simple to use and works quite well.