Ejemplo n.º 1
0
LRESULT CALLBACK HiliteWndProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam ) 
{
   LONG_PTR id = GetWindowLongPtr(hwnd,GWLP_ID);
   HWND hwParent = GetParent(hwnd);
   ShaderParamDlg *theDlg = DLGetWindowLongPtr<ShaderParamDlg *>(hwParent);
   if (theDlg==NULL) return FALSE;

    switch (msg) {
      case WM_COMMAND:  
      case WM_MOUSEMOVE:   
      case WM_LBUTTONUP: 
      case WM_CREATE:
      case WM_DESTROY: 
      break;

      case WM_PAINT:    
      {
         PAINTSTRUCT ps;
         Rect rect;
         HDC hdc = BeginPaint( hwnd, &ps );
         if (!IsRectEmpty(&ps.rcPaint)) {
            GetClientRect( hwnd, &rect );
            Shader* pShader = theDlg->GetShader();
            DrawHilite(hdc, rect, pShader );
         }
         EndPaint( hwnd, &ps );
      }                                      
      break;
   }
   return DefWindowProc(hwnd,msg,wParam,lParam);
} 
Ejemplo n.º 2
0
void OrenNayarShaderDlg::UpdateHilite()
{
	HDC hdc = GetDC(hwHilite);
	Rect r;
	GetClientRect(hwHilite,&r);
	DrawHilite(hdc, r, pShader );
	ReleaseDC(hwHilite,hdc);
}
Ejemplo n.º 3
0
void UpdateHilite( HWND hwHilite, Shader* pShader, int layer  )
{
Rect r;

      HDC hdc = GetDC( hwHilite );
      GetClientRect( hwHilite, &r );
      DrawHilite( hdc, r, pShader );
      ReleaseDC( hwHilite, hdc );
}