Add minimum window size

This commit is contained in:
Benau 2020-06-06 01:02:01 +08:00
parent 2f1acc8139
commit d4cd6d6fc9
4 changed files with 13 additions and 1 deletions

View File

@ -318,6 +318,7 @@ namespace irr
virtual s32 getBottomPadding() { return 0; }
virtual s32 getLeftPadding() { return 0; }
virtual s32 getRightPadding() { return 0; }
virtual void setWindowMinimumSize(u32 width, u32 height) {}
//! Check if a driver type is supported by the engine.
/** Even if true is returned the driver may not be available
for a configuration requested when creating the device. */

View File

@ -726,6 +726,12 @@ bool CIrrDeviceSDL::getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightne
return false;
}
void CIrrDeviceSDL::setWindowMinimumSize(u32 width, u32 height)
{
if (Window)
SDL_SetWindowMinimumSize(Window, width, height);
}
//! returns color format of the window.
video::ECOLOR_FORMAT CIrrDeviceSDL::getColorFormat() const
{

View File

@ -95,6 +95,8 @@ namespace irr
//! Get the current Gamma Value for the Display
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, f32 &brightness, f32 &contrast );
virtual void setWindowMinimumSize(u32 width, u32 height);
//! Get the device type
virtual E_DEVICE_TYPE getType() const
{

View File

@ -2168,7 +2168,10 @@ int main(int argc, char *argv[])
}
Log::warn("main", "Screen size is too small!");
}
else
{
irr_driver->getDevice()->setWindowMinimumSize(480, 480);
}
#ifdef MOBILE_STK
if (UserConfigParams::m_multitouch_controls == MULTITOUCH_CONTROLS_UNDEFINED)
{