metadata
Wenzel Jakob 2011-03-21 19:51:55 +01:00
parent df2992f2b7
commit 4bf6f3728c
1 changed files with 9 additions and 3 deletions

View File

@ -40,7 +40,9 @@
#define WGL_STENCIL_BITS_ARB 0x2023 #define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_DOUBLE_BUFFER_ARB 0x2011 #define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_FULL_ACCELERATION_ARB 0x2027 #define WGL_FULL_ACCELERATION_ARB 0x2027
typedef BOOL (APIENTRY * wglChoosePixelFormatARBProc) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
typedef BOOL (APIENTRY * wglChoosePixelFormatARBProc) (HDC hdc, const int *piAttribIList,
const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif #endif
MTS_NAMESPACE_BEGIN MTS_NAMESPACE_BEGIN
@ -67,7 +69,7 @@ LONG WINAPI WGLDevice::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
break; break;
case WM_SIZE: { case WM_SIZE: {
Vector2i size = Vector2i(LOWORD(lParam), HIWORD(lParam)); Vector2i size = Vector2i(LOWORD(lParam), HIWORD(lParam));
if (device->m_size == size) { if (device->m_size != size) {
device->m_size = size; device->m_size = size;
deviceEvent.setType(EResizeEvent); deviceEvent.setType(EResizeEvent);
device->fireDeviceEvent(deviceEvent); device->fireDeviceEvent(deviceEvent);
@ -280,10 +282,14 @@ void WGLDevice::init(Device *other) {
(windows is soo bugged!), the second pass creates the actual (windows is soo bugged!), the second pass creates the actual
window with the matching pixel format window with the matching pixel format
*/ */
int extra = 0;
if (m_resizeAllowed)
extra = WS_SIZEBOX | WS_MAXIMIZEBOX;
m_hwnd = CreateWindow( m_hwnd = CreateWindow(
session->m_wndClassName.c_str(), session->m_wndClassName.c_str(),
m_title.c_str(), m_title.c_str(),
m_fullscreen ? WS_POPUP : (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_SIZEBOX), m_fullscreen ? WS_POPUP : (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | extra),
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
getSize().x, getSize().y, getSize().x, getSize().y,