// Destructor
//-----------------------------------------------------------------------------
CPUTGuiController::~CPUTGuiController()
{
    SAFE_RELEASE(mpFont);

    // cleanup
    DeleteAllControls();
}
// destructor
//--------------------------------------------------------------------------------
CPUTGuiControllerOGL::~CPUTGuiControllerOGL()
{
    SAFE_RELEASE(mpMaterial);
    SAFE_RELEASE(mpConstantBufferVS);
    SAFE_RELEASE(mpUberBuffer);
    DeleteAllControls();
}
// Constructor
//-----------------------------------------------------------------------------
CPUTGuiController::CPUTGuiController():
    mControlPanelIDList(NULL),
    mActiveControlPanelSlotID(CPUT_CONTROL_ID_INVALID),
    mpHandler(NULL),
    mpFocusControl(NULL),
    mbAutoLayout(true),
    mResourceDirectory(_L("./")),
    mUberBufferDirty(true),
    mRecalculateLayout(false)
{
    // clear all controls and panel lists
    DeleteAllControls();
}
// destructor
//--------------------------------------------------------------------------------
CPUTGuiControllerOGL::~CPUTGuiControllerOGL()
{
    // delete all the controls under you
    ReleaseResources();
    DeleteAllControls();
    SAFE_RELEASE(mpTextMaterial);
    SAFE_RELEASE(mpControlMaterial);
    // FPS counter

    // delete arrays
    SAFE_DELETE_ARRAY(mpTextMirrorBuffer);
    SAFE_DELETE_ARRAY(mpMirrorBuffer);
    SAFE_DELETE_ARRAY(mpFocusedControlMirrorBuffer);
    SAFE_DELETE_ARRAY(mpFocusedControlTextMirrorBuffer);
}
// destructor
//--------------------------------------------------------------------------------
CPUTGuiControllerDX11::~CPUTGuiControllerDX11()
{
    // delete all the controls under you
	ReleaseResources();
    DeleteAllControls();

    // FPS counter
    SAFE_DELETE(mpFPSCounter);
    SAFE_DELETE(mpFPSTimer);

    // delete arrays
    SAFE_DELETE_ARRAY(mpTextMirrorBuffer);
    SAFE_DELETE_ARRAY(mpMirrorBuffer);
    SAFE_DELETE_ARRAY(mpFocusedControlMirrorBuffer);
    SAFE_DELETE_ARRAY(mpFocusedControlTextMirrorBuffer);
    SAFE_DELETE_ARRAY(mpFPSMirrorBuffer);
}
// Destructor
//-----------------------------------------------------------------------------
CPUTGuiController::~CPUTGuiController()
{
    // cleanup
    DeleteAllControls();
}
// Destructor
//-----------------------------------------------------------------------------
CPUTGuiController::~CPUTGuiController()
{
    SAFE_RELEASE(mpFont);
    SAFE_DELETE_ARRAY(mpMirrorBuffer);
    DeleteAllControls();
}