Commit 0878f005 authored by Jeff Raab's avatar Jeff Raab

Fixed the pure virtual function to be an empty one, which should resolve the linux build failure.

Also tweaked the loading methodology to have the canvas by default assume it should force the window display as soon as it can. You can set the canvas to not do that when it's created via the new displayWindow variable.

This way, old templates and projects should work as normal without changes, while the new templates are built to take advantage of the nicer splash screen arrangement.
parent 2864edf2
......@@ -121,7 +121,8 @@ GuiCanvas::GuiCanvas(): GuiControl(),
mMiddleMouseLast(false),
mRightMouseLast(false),
mPlatformWindow(NULL),
mLastRenderMs(0)
mLastRenderMs(0),
mDisplayWindow(true)
{
setBounds(0, 0, 640, 480);
mAwake = true;
......@@ -176,6 +177,8 @@ void GuiCanvas::initPersistFields()
addGroup("Canvas Rendering");
addProtectedField( "numFences", TypeS32, Offset( mNumFences, GuiCanvas ), &setProtectedNumFences, &defaultProtectedGetFn, "The number of GFX fences to use." );
addField("displayWindow", TypeBool, Offset(mDisplayWindow, GuiCanvas), "Controls if the canvas window is rendered or not." );
endGroup("Canvas Rendering");
Parent::initPersistFields();
......@@ -252,6 +255,19 @@ bool GuiCanvas::onAdd()
// Make sure we're able to render.
newDevice->setAllowRender( true );
if(mDisplayWindow)
{
getPlatformWindow()->show();
WindowManager->setDisplayWindow(true);
getPlatformWindow()->setDisplayWindow(true);
}
else
{
getPlatformWindow()->hide();
WindowManager->setDisplayWindow(false);
getPlatformWindow()->setDisplayWindow(false);
}
// Propagate add to parents.
// CodeReview - if GuiCanvas fails to add for whatever reason, what happens to
// all the event registration above?
......@@ -2700,4 +2716,6 @@ ConsoleMethod( GuiCanvas, hideWindow, void, 2, 2, "" )
return;
object->getPlatformWindow()->hide();
WindowManager->setDisplayWindow(false);
object->getPlatformWindow()->setDisplayWindow(false);
}
\ No newline at end of file
......@@ -108,6 +108,8 @@ protected:
bool mClampTorqueCursor;
bool mAlwaysHandleMouseButtons;
bool mDisplayWindow;
/// @}
/// @name Mouse Input
......
......@@ -134,7 +134,7 @@ public:
virtual void raiseCurtain()=0;
/// This method indicates to created windows to show as normal.
virtual void setDisplayWindow(bool set)=0;
virtual void setDisplayWindow(bool set){}
private:
/// Process command line arguments from StandardMainLoop. This is done to
......
......@@ -268,7 +268,10 @@ PlatformWindow *Win32WindowManager::createWindow(GFXDevice *device, const GFXVid
w32w->setDisplayWindow(mDisplayWindow);
if (!mOffscreenRender && mDisplayWindow)
{
ShowWindow( w32w->mWindowHandle, SW_SHOWDEFAULT );
CloseSplashWindow(winState.appInstance);
}
// Bind the window to the specified device.
if(device)
......
......@@ -38,7 +38,10 @@ function createCanvas(%windowTitle)
}
// Create the Canvas
%foo = new GuiCanvas(Canvas);
%foo = new GuiCanvas(Canvas)
{
displayWindow = false;
};
// Set the window title
if (isObject(Canvas))
......
......@@ -38,7 +38,10 @@ function createCanvas(%windowTitle)
}
// Create the Canvas
%foo = new GuiCanvas(Canvas);
%foo = new GuiCanvas(Canvas)
{
displayWindow = false;
};
// Set the window title
if (isObject(Canvas))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment