Commit 0aab2f19 authored by hybrid's avatar hybrid

Added device method minimizeWindow which minimizes the render window (as if...

Added device method minimizeWindow which minimizes the render window (as if the minimize button has been clicked)
Renamed setResizeAble to setResizeable

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2258 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 2bfc416e
Changes in 1.6 Changes in 1.6
- Renamed setResizeAble to setResizeable
- Added new device method minimizeWindow which minimizes the window (just as if the minimize button has been clicked).
- SkyDome is now serialized correctly - SkyDome is now serialized correctly
- Added PLY mesh reader and writer - Added PLY mesh reader and writer
......
...@@ -297,6 +297,11 @@ public: ...@@ -297,6 +297,11 @@ public:
elem->setVisible(!elem->isVisible()); elem->setVisible(!elem->isVisible());
} }
} }
else if (event.KeyInput.Key == irr::KEY_KEY_M)
{
if (Device)
Device->minimizeWindow();
}
} }
if (event.EventType == EET_GUI_EVENT) if (event.EventType == EET_GUI_EVENT)
...@@ -576,7 +581,7 @@ int main(int argc, char* argv[]) ...@@ -576,7 +581,7 @@ int main(int argc, char* argv[])
if (Device == 0) if (Device == 0)
return 1; // could not create selected driver. return 1; // could not create selected driver.
Device->setResizeAble(true); Device->setResizeable(true);
Device->setWindowCaption(L"Irrlicht Engine - Loading..."); Device->setWindowCaption(L"Irrlicht Engine - Loading...");
...@@ -589,7 +594,7 @@ int main(int argc, char* argv[]) ...@@ -589,7 +594,7 @@ int main(int argc, char* argv[])
smgr->addLightSceneNode(); smgr->addLightSceneNode();
smgr->addLightSceneNode(0, core::vector3df(50,-50,GUI_ID_OPEN_MODEL), smgr->addLightSceneNode(0, core::vector3df(50,-50,GUI_ID_OPEN_MODEL),
video::SColorf(1.0f,1.0f,1.0f),20000); video::SColorf(1.0f,1.0f,1.0f),2000)->setPosition(core::vector3df(200,200,200));
// add our media directory as "search path" // add our media directory as "search path"
Device->getFileSystem()->addFolderFileArchive("../../media/"); Device->getFileSystem()->addFolderFileArchive("../../media/");
......
...@@ -206,7 +206,10 @@ namespace irr ...@@ -206,7 +206,10 @@ namespace irr
/** The default is false. This method only works in windowed /** The default is false. This method only works in windowed
mode. mode.
\param resize Flag whether the window should be resizeable. */ \param resize Flag whether the window should be resizeable. */
virtual void setResizeAble(bool resize=false) = 0; virtual void setResizeable(bool resize=false) = 0;
//! Minimizes the window if possible.
virtual void minimizeWindow() =0;
//! Activate any joysticks, and generate events for them. //! Activate any joysticks, and generate events for them.
/** Irrlicht contains support for joysticks, but does not generate joystick events by default, /** Irrlicht contains support for joysticks, but does not generate joystick events by default,
...@@ -216,17 +219,15 @@ namespace irr ...@@ -216,17 +219,15 @@ namespace irr
\return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ \return true if joysticks are supported on this device and _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
is defined, false if joysticks are not supported or support is compiled out. is defined, false if joysticks are not supported or support is compiled out.
*/ */
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo) = 0; virtual bool activateJoysticks(core::array<SJoystickInfo>& joystickInfo) =0;
//! Set the current Gamma Value for the Display //! Set the current Gamma Value for the Display
/** Gamma in virtual bool setGammaRamp(f32 red, f32 green, f32 blue,
*/ f32 relativebrightness, f32 relativecontrast) =0;
virtual bool setGammaRamp( f32 red, f32 green, f32 blue,
f32 relativebrightness, f32 relativecontrast ) = 0;
//! Get the current Gamma Value for the Display //! Get the current Gamma Value for the Display
virtual bool getGammaRamp( f32 &red, f32 &green, f32 &blue, virtual bool getGammaRamp(f32 &red, f32 &green, f32 &blue,
f32 &brightness, f32 &contrast ) = 0; f32 &brightness, f32 &contrast) =0;
}; };
......
...@@ -407,7 +407,13 @@ void CIrrDeviceConsole::closeDevice() ...@@ -407,7 +407,13 @@ void CIrrDeviceConsole::closeDevice()
} }
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceConsole::setResizeAble(bool resize) void CIrrDeviceConsole::setResizeable(bool resize)
{
// do nothing
}
//! Minimize the window.
void CIrrDeviceConsole::minimizeWindow()
{ {
// do nothing // do nothing
} }
......
...@@ -76,7 +76,10 @@ namespace irr ...@@ -76,7 +76,10 @@ namespace irr
virtual void closeDevice(); virtual void closeDevice();
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
virtual void setResizeAble(bool resize=false); virtual void setResizeable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
void addPostPresentText(s16 X, s16 Y, const wchar_t *text); void addPostPresentText(s16 X, s16 Y, const wchar_t *text);
......
...@@ -1051,7 +1051,7 @@ video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const ...@@ -1051,7 +1051,7 @@ video::ECOLOR_FORMAT CIrrDeviceLinux::getColorFormat() const
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceLinux::setResizeAble(bool resize) void CIrrDeviceLinux::setResizeable(bool resize)
{ {
#ifdef _IRR_COMPILE_WITH_X11_ #ifdef _IRR_COMPILE_WITH_X11_
if (CreationParams.DriverType == video::EDT_NULL) if (CreationParams.DriverType == video::EDT_NULL)
...@@ -1157,6 +1157,15 @@ video::IVideoModeList* CIrrDeviceLinux::getVideoModeList() ...@@ -1157,6 +1157,15 @@ video::IVideoModeList* CIrrDeviceLinux::getVideoModeList()
} }
//! Return pointer to a list with all video modes supported by the gfx adapter.
void CIrrDeviceLinux::minimizeWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
XUnmapWindow(display, window);
#endif
}
void CIrrDeviceLinux::createKeyMap() void CIrrDeviceLinux::createKeyMap()
{ {
// I don't know if this is the best method to create // I don't know if this is the best method to create
......
...@@ -88,7 +88,10 @@ namespace irr ...@@ -88,7 +88,10 @@ namespace irr
video::IVideoModeList* getVideoModeList(); video::IVideoModeList* getVideoModeList();
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
virtual void setResizeAble(bool resize=false); virtual void setResizeable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
//! Activate any joysticks, and generate events for them. //! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo); virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......
...@@ -661,7 +661,7 @@ video::IVideoModeList* CIrrDeviceSDL::getVideoModeList() ...@@ -661,7 +661,7 @@ video::IVideoModeList* CIrrDeviceSDL::getVideoModeList()
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceSDL::setResizeAble(bool resize) void CIrrDeviceSDL::setResizeable(bool resize)
{ {
if (resize != Resizeable) if (resize != Resizeable)
{ {
...@@ -677,6 +677,13 @@ void CIrrDeviceSDL::setResizeAble(bool resize) ...@@ -677,6 +677,13 @@ void CIrrDeviceSDL::setResizeAble(bool resize)
} }
//! Minimizes window if possible
void CIrrDeviceSDL::minimizeWindow()
{
SDL_WM_IconifyWindow();
}
//! returns if window is active. if not, nothing need to be drawn //! returns if window is active. if not, nothing need to be drawn
bool CIrrDeviceSDL::isWindowActive() const bool CIrrDeviceSDL::isWindowActive() const
{ {
......
...@@ -65,7 +65,10 @@ namespace irr ...@@ -65,7 +65,10 @@ namespace irr
video::IVideoModeList* getVideoModeList(); video::IVideoModeList* getVideoModeList();
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
virtual void setResizeAble(bool resize=false); virtual void setResizeable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
//! Activate any joysticks, and generate events for them. //! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo); virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......
...@@ -893,7 +893,7 @@ void CIrrDeviceWin32::OnResized() ...@@ -893,7 +893,7 @@ void CIrrDeviceWin32::OnResized()
} }
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceWin32::setResizeAble(bool resize) void CIrrDeviceWin32::setResizeable(bool resize)
{ {
if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen) if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen)
return; return;
...@@ -927,6 +927,17 @@ void CIrrDeviceWin32::setResizeAble(bool resize) ...@@ -927,6 +927,17 @@ void CIrrDeviceWin32::setResizeAble(bool resize)
} }
//! Minimizes the window.
void CIrrDeviceWin32::minimizeWindow()
{
WINDOWPLACEMENT wndpl;
wndpl.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(HWnd, &wndpl);
wndpl.showCmd = SW_SHOWMINNOACTIVE;
SetWindowPlacement(HWnd, &wndpl);
}
bool CIrrDeviceWin32::activateJoysticks(core::array<SJoystickInfo> & joystickInfo) bool CIrrDeviceWin32::activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
{ {
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_ #if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
......
...@@ -67,7 +67,10 @@ namespace irr ...@@ -67,7 +67,10 @@ namespace irr
void OnResized(); void OnResized();
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
virtual void setResizeAble(bool resize=false); virtual void setResizeable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
//! Activate any joysticks, and generate events for them. //! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo); virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......
...@@ -742,7 +742,7 @@ void CIrrDeviceWinCE::OnResized() ...@@ -742,7 +742,7 @@ void CIrrDeviceWinCE::OnResized()
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
void CIrrDeviceWinCE::setResizeAble(bool resize) void CIrrDeviceWinCE::setResizeable(bool resize)
{ {
if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen) if (ExternalWindow || !getVideoDriver() || CreationParams.Fullscreen)
return; return;
...@@ -776,6 +776,12 @@ void CIrrDeviceWinCE::setResizeAble(bool resize) ...@@ -776,6 +776,12 @@ void CIrrDeviceWinCE::setResizeAble(bool resize)
} }
//! Minimizes the window.
void CIrrDeviceWinCE::minimizeWindow()
{
}
IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx( IRRLICHT_API IrrlichtDevice* IRRCALLCONV createDeviceEx(
const SIrrlichtCreationParameters& parameters) const SIrrlichtCreationParameters& parameters)
{ {
......
...@@ -67,7 +67,10 @@ namespace irr ...@@ -67,7 +67,10 @@ namespace irr
void OnResized(); void OnResized();
//! Sets if the window should be resizeable in windowed mode. //! Sets if the window should be resizeable in windowed mode.
virtual void setResizeAble(bool resize=false); virtual void setResizeable(bool resize=false);
//! Minimizes the window.
virtual void minimizeWindow();
//! Implementation of the win32 cursor control //! Implementation of the win32 cursor control
class CCursorControl : public gui::ICursorControl class CCursorControl : public gui::ICursorControl
......
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