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:
parent
14edd1fe3b
commit
1d03da6844
3 changed files with 15 additions and 2 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue