Added a hack to video loading to allow the creation of a context in some platforms, and changed the colour of dummy video provider to sky-blue.

Originally committed to SVN as r973.
This commit is contained in:
Rodrigo Braz Monteiro 2007-04-01 23:07:29 +00:00
parent 14edd1fe3b
commit 1d03da6844
3 changed files with 15 additions and 2 deletions

View file

@ -973,7 +973,9 @@ void FrameMain::LoadVideo(wxString file,bool autoload) {
VFR_Output.Unload();
}
}
SetDisplayMode(1,-1);
VideoContext::Get()->SetVideo(file);
SetDisplayMode(0,-1);
}
catch (const wchar_t *error) {
wxString err(error);

View file

@ -134,9 +134,12 @@ void VideoDisplay::Render() {
// Is shown?
if (!IsShownOnScreen()) return;
// Set GL context
// Get video context
VideoContext *context = VideoContext::Get();
wxASSERT(context);
if (!context->IsLoaded()) return;
// Set GL context
SetCurrent(*context->GetGLContext(this));
// Get sizes

View file

@ -87,7 +87,15 @@ DummyVideoProvider::~DummyVideoProvider() {
// Get frame
const AegiVideoFrame DummyVideoProvider::DoGetFrame(int n) {
lastFrame = n;
return AegiVideoFrame(640,480);
AegiVideoFrame frame(640,480,FORMAT_RGB32);
unsigned char *dst = frame.data[0];
for (int i=frame.pitch[0]*frame.h/frame.GetBpp();--i>=0;) {
*dst++ = 254;
*dst++ = 163;
*dst++ = 47;
*dst++ = 0;
}
return frame;
}