+ registeredGLCanvasClass = TRUE;
+ }
+
+ wxCHECK_MSG( parent, FALSE, wxT("can't create wxWindow without parent") );
+
+ if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
+ return FALSE;
+
+ parent->AddChild(this);
+
+ DWORD msflags = 0;
+ if ( style & wxBORDER )
+ msflags |= WS_BORDER;
+ if ( style & wxTHICK_FRAME )
+ msflags |= WS_THICKFRAME;
+
+ /*
+ A general rule with OpenGL and Win32 is that any window that will have a
+ HGLRC built for it must have two flags: WS_CLIPCHILDREN & WS_CLIPSIBLINGS.
+ You can find references about this within the knowledge base and most OpenGL
+ books that contain the wgl function descriptions.
+ */
+
+ msflags |= WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS;
+ // if ( style & wxCLIP_CHILDREN )
+ // msflags |= WS_CLIPCHILDREN;
+ msflags |= WS_CLIPCHILDREN;
+
+ bool want3D;
+ WXDWORD exStyle = Determine3DEffects(WS_EX_CLIENTEDGE, &want3D);
+
+ // Even with extended styles, need to combine with WS_BORDER
+ // for them to look right.
+ if ( want3D || (m_windowStyle & wxSIMPLE_BORDER) || (m_windowStyle & wxRAISED_BORDER ) ||
+ (m_windowStyle & wxSUNKEN_BORDER) || (m_windowStyle & wxDOUBLE_BORDER))
+ {
+ msflags |= WS_BORDER;
+ }
+
+ // calculate the value to return from WM_GETDLGCODE handler
+ if ( GetWindowStyleFlag() & wxWANTS_CHARS )
+ {
+ // want everything: i.e. all keys and WM_CHAR message
+ m_lDlgCode = DLGC_WANTARROWS | DLGC_WANTCHARS |
+ DLGC_WANTTAB | DLGC_WANTMESSAGE;
+ }
+
+ MSWCreate(m_windowId, parent, wxGLCanvasClassName, this, NULL,
+ pos.x, pos.y,
+ WidthDefault(size.x), HeightDefault(size.y),
+ msflags, NULL, exStyle);
+
+ return TRUE;
+}