Commit af952595 authored by hybrid's avatar hybrid

Add methods for maximizing and restoring windows again. Some implementations...

Add methods for maximizing and restoring windows again. Some implementations are still empty, but we need the interfaces at least.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@2600 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 243e08ee
......@@ -213,6 +213,12 @@ namespace irr
//! Minimizes the window if possible.
virtual void minimizeWindow() =0;
//! Maximizes the window if possible.
virtual void maximizeWindow() =0;
//! Restore the window to normal size if possible.
virtual void restoreWindow() =0;
//! Activate any joysticks, and generate events for them.
/** Irrlicht contains support for joysticks, but does not generate joystick events by default,
as this would consume joystick info that 3rd party libraries might rely on. Call this method to
......
......@@ -416,18 +416,35 @@ void CIrrDeviceConsole::closeDevice()
IsDeviceRunning = false;
}
//! Sets if the window should be resizable in windowed mode.
void CIrrDeviceConsole::setResizable(bool resize)
{
// do nothing
}
//! Minimize the window.
void CIrrDeviceConsole::minimizeWindow()
{
// do nothing
}
//! Maximize window
void CIrrDeviceConsole::maximizeWindow()
{
// do nothing
}
//! Restore original window size
void CIrrDeviceConsole::restoreWindow()
{
// do nothing
}
void CIrrDeviceConsole::setTextCursorPos(s16 x, s16 y)
{
#ifdef _IRR_WINDOWS_NT_CONSOLE_
......
......@@ -80,6 +80,12 @@ namespace irr
//! Minimizes the window.
virtual void minimizeWindow();
//! Maximizes the window.
virtual void maximizeWindow();
//! Restores the window size.
virtual void restoreWindow();
//! Get the device type
virtual E_DEVICE_TYPE getType() const
{
......
......@@ -1290,7 +1290,7 @@ video::IVideoModeList* CIrrDeviceLinux::getVideoModeList()
}
//! Return pointer to a list with all video modes supported by the gfx adapter.
//! Minimize window
void CIrrDeviceLinux::minimizeWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
......@@ -1299,6 +1299,24 @@ void CIrrDeviceLinux::minimizeWindow()
}
//! Maximize window
void CIrrDeviceLinux::maximizeWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
XMapWindow(display, window);
#endif
}
//! Restore original window size
void CIrrDeviceLinux::restoreWindow()
{
#ifdef _IRR_COMPILE_WITH_X11_
XMapWindow(display, window);
#endif
}
void CIrrDeviceLinux::createKeyMap()
{
// I don't know if this is the best method to create
......
......@@ -93,6 +93,12 @@ namespace irr
//! Minimizes the window.
virtual void minimizeWindow();
//! Maximizes the window.
virtual void maximizeWindow();
//! Restores the window size.
virtual void restoreWindow();
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......
......@@ -757,6 +757,20 @@ void CIrrDeviceSDL::minimizeWindow()
}
//! Maximize window
void CIrrDeviceSDL::maximizeWindow()
{
// do nothing
}
//! Restore original window size
void CIrrDeviceSDL::restoreWindow()
{
// do nothing
}
//! returns if window is active. if not, nothing need to be drawn
bool CIrrDeviceSDL::isWindowActive() const
{
......
......@@ -71,6 +71,12 @@ namespace irr
//! Minimizes the window.
virtual void minimizeWindow();
//! Maximizes the window.
virtual void maximizeWindow();
//! Restores the window size.
virtual void restoreWindow();
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......
......@@ -295,7 +295,7 @@ void CIrrDeviceStub::calculateGammaRamp ( u16 *ramp, f32 gamma, f32 relativebrig
for ( i = 0; i < 256; ++i )
{
value = (s32)(powf( rcontrast * i, gamma)*65535.f + 0.5f );
value = (s32)(pow( rcontrast * i, gamma)*65535.f + 0.5f );
ramp[i] = (u16) core::s32_clamp ( value + rbright, 0, 65535 );
}
......
......@@ -965,6 +965,28 @@ void CIrrDeviceWin32::minimizeWindow()
}
//! Maximizes the window.
void CIrrDeviceWin32::maximizeWindow()
{
WINDOWPLACEMENT wndpl;
wndpl.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(HWnd, &wndpl);
wndpl.showCmd = SW_SHOWMAXIMIZED;
SetWindowPlacement(HWnd, &wndpl);
}
//! Restores the window to its original size.
void CIrrDeviceWin32::restoreWindow()
{
WINDOWPLACEMENT wndpl;
wndpl.length = sizeof(WINDOWPLACEMENT);
GetWindowPlacement(HWnd, &wndpl);
wndpl.showCmd = SW_SHOWNORMAL;
SetWindowPlacement(HWnd, &wndpl);
}
bool CIrrDeviceWin32::activateJoysticks(core::array<SJoystickInfo> & joystickInfo)
{
#if defined _IRR_COMPILE_WITH_JOYSTICK_EVENTS_
......
......@@ -72,6 +72,12 @@ namespace irr
//! Minimizes the window.
virtual void minimizeWindow();
//! Maximizes the window.
virtual void maximizeWindow();
//! Restores the window size.
virtual void restoreWindow();
//! Activate any joysticks, and generate events for them.
virtual bool activateJoysticks(core::array<SJoystickInfo> & joystickInfo);
......
......@@ -781,8 +781,23 @@ void CIrrDeviceWinCE::setResizable(bool resize)
//! Minimizes the window.
void CIrrDeviceWinCE::minimizeWindow()
{
// do nothing
}
//! Maximize window
void CIrrDeviceWinCE::maximizeWindow()
{
// do nothing
}
//! Restore original window size
void CIrrDeviceWinCE::restoreWindow()
{
// do nothing
}
} // end namespace
#endif // _IRR_COMPILE_WITH_WINDOWS_CE_DEVICE_
......
......@@ -72,6 +72,12 @@ namespace irr
//! Minimizes the window.
virtual void minimizeWindow();
//! Maximizes the window.
virtual void maximizeWindow();
//! Restores the window size.
virtual void restoreWindow();
//! Get the device type
virtual E_DEVICE_TYPE getType() const
{
......
......@@ -347,8 +347,6 @@ void CSoftwareDriver::drawVertexPrimitiveList(const void* vertices, u32 vertexCo
break;
}
}
}
......@@ -959,3 +957,4 @@ IVideoDriver* createSoftwareDriver(const core::dimension2d<u32>& windowSize, boo
} // end namespace video
} // end namespace irr
......@@ -1663,7 +1663,6 @@ void CBurningVideoDriver::draw2DImage(const video::ITexture* texture, const core
}
//! Draws a 2d line.
void CBurningVideoDriver::draw2DLine(const core::position2d<s32>& start,
const core::position2d<s32>& end,
......@@ -1672,12 +1671,14 @@ void CBurningVideoDriver::draw2DLine(const core::position2d<s32>& start,
BackBuffer->drawLine(start, end, color );
}
//! Draws a pixel
void CBurningVideoDriver::drawPixel(u32 x, u32 y, const SColor & color)
{
BackBuffer->setPixel(x, y, color, true);
}
//! draw an 2d rectangle
void CBurningVideoDriver::draw2DRectangle(SColor color, const core::rect<s32>& pos,
const core::rect<s32>* clip)
......
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