forked from 0ad/0ad
Set Atlas canvas size before potentially rendering to it. Fixes #987.
This was SVN commit r10526.
This commit is contained in:
parent
72237c32a2
commit
e7f0639054
@ -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, ());
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -122,6 +122,8 @@ QUERY(Ping, , );
|
||||
|
||||
MESSAGE(SetCanvas,
|
||||
((void*, canvas))
|
||||
((int, width))
|
||||
((int, height))
|
||||
);
|
||||
|
||||
MESSAGE(ResizeScreen,
|
||||
|
Loading…
Reference in New Issue
Block a user