Set Atlas canvas size before potentially rendering to it. Fixes #987.

This was SVN commit r10526.
This commit is contained in:
Ykkrosh 2011-11-13 12:57:34 +00:00
parent 72237c32a2
commit e7f0639054
3 changed files with 8 additions and 1 deletions

View File

@ -500,7 +500,8 @@ ScenarioEditor::ScenarioEditor(wxWindow* parent, ScriptInterface& scriptInterfac
// Send setup messages to game engine:
POST_MESSAGE(SetCanvas, (static_cast<wxGLCanvas*>(canvas)));
POST_MESSAGE(SetCanvas, (static_cast<wxGLCanvas*>(canvas),
canvas->GetClientSize().GetWidth(), canvas->GetClientSize().GetHeight()));
POST_MESSAGE(InitGraphics, ());

View File

@ -154,6 +154,10 @@ MESSAGEHANDLER(SetActorViewer)
MESSAGEHANDLER(SetCanvas)
{
// Need to set the canvas size before possibly doing any rendering,
// else we'll get GL errors when trying to render to 0x0
CVideoMode::UpdateRenderer(msg->width, msg->height);
g_GameLoop->glCanvas = msg->canvas;
Atlas_GLSetCurrent(const_cast<void*>(g_GameLoop->glCanvas));
}

View File

@ -122,6 +122,8 @@ QUERY(Ping, , );
MESSAGE(SetCanvas,
((void*, canvas))
((int, width))
((int, height))
);
MESSAGE(ResizeScreen,