I have created the device and used setResizeAble(true) so it has the maximize and minimize buttons in the top right corner.
What I want to know is, is there a way to have the screen start off maximized? I couldnt find any SetMaximize() type functions...
Is there a way to Maximize a window?
-
- Posts: 81
- Joined: Sat Sep 09, 2006 6:46 am
Your going to have to use Windows API for this. Pretty simple stuff though. Seeing as most people don't do it liek they should, I'll break it down for you:
First, include windows.h:
Second, you need to get the HWND (The window in which Irrlicht draws). This is assuming your video driver's pointer is named video:
Third, you'll need to call ShowWindow on the HWND.
And presto, the window should maximize once ShowWindow is called. I haven't tested this, just seems like it'll work :]. I haven't used Windows API in awhile, since I started using Irrlichts built-in GUI.
First, include windows.h:
Code: Select all
#include <windows.h>
Code: Select all
For DirectX 9:
HWND h = reinterpret_cast<HWND>(video->getExposedVideoData().D3D9.HWnd);
For DirectX 8:
HWND h = reinterpret_cast<HWND>(video->getExposedVideoData().D3D8.HWnd);
For OpenGL:
HWND h = reinterpret_cast<HWND>(video->getExposedVideoData().OpenGLWin32.HWnd);
Code: Select all
ShowWindow(h,SW_SHOW | SW_MAXIMIZE);
thanks, it did work nearly as you posted.( I had the windows api included anyway)
I'm using OpenGL. with the code you posted, the device prints:
Ignoring resize Operation to (0,0)
and minimizes the window.
but if I use
it works just fine
I'm using OpenGL. with the code you posted, the device prints:
Ignoring resize Operation to (0,0)
and minimizes the window.
but if I use
Code: Select all
ShowWindow(h,SW_MAXIMIZE);