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.
This commit is contained in:
Areloch 2014-08-04 21:28:36 -05:00
parent 2864edf291
commit 0878f005c0
6 changed files with 33 additions and 4 deletions

View file

@ -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);
}

View file

@ -108,6 +108,8 @@ protected:
bool mClampTorqueCursor;
bool mAlwaysHandleMouseButtons;
bool mDisplayWindow;
/// @}
/// @name Mouse Input

View file

@ -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

View file

@ -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)

View file

@ -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))

View file

@ -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))