Пример #1
0
void* IGraphicsWin::OpenWindow(void* pParentWnd)
{
  int x = 0, y = 0, w = Width(), h = Height();
  mParentWnd = (HWND) pParentWnd;

	if (mPlugWnd) {
		RECT pR, cR;
		GetWindowRect((HWND) pParentWnd, &pR);
		GetWindowRect(mPlugWnd, &cR);
		CloseWindow();
		x = cR.left - pR.left;
		y = cR.top - pR.top;
		w = cR.right - cR.left;
		h = cR.bottom - cR.top;
	}

	if (nWndClassReg++ == 0) {
		WNDCLASS wndClass = { CS_DBLCLKS, WndProc, 0, 0, mHInstance, 0, LoadCursor(NULL, IDC_ARROW), 0, 0, wndClassName };
		RegisterClass(&wndClass);
	}

  sFPS = FPS();
  mPlugWnd = CreateWindow(wndClassName, "IPlug", WS_CHILD | WS_VISIBLE, // | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
		x, y, w, h, (HWND) pParentWnd, 0, mHInstance, this);
	//SetWindowLong(mPlugWnd, GWL_USERDATA, (LPARAM) this);

	if (!mPlugWnd && --nWndClassReg == 0) {
		UnregisterClass(wndClassName, mHInstance);
	}
  else {
    SetAllControlsDirty();
  }  

	return mPlugWnd;
}
Пример #2
0
void IGraphics::SetStrictDrawing(bool strict)
{
  mStrict = strict;
  SetAllControlsDirty();
}