OSDN Git Service

Direct3D描画をテクスチャに対して行い、それをレイヤードウィンドウに描画するように変更した。
[winaudioj/winwrapper.git] / winwrapper / test_window.cpp
index 252aa58..7abf07f 100644 (file)
@@ -41,7 +41,7 @@ namespace sf
   test_window::test_window(\r
     const std::wstring& title,\r
     const std::wstring& name,bool fit_to_display,\r
-    float width,float height) : base_win32_window_t(title,name,fit_to_display,width,height)\r
+    float width,float height) : base_win32_window_t(title,name,fit_to_display,width,height),x_(0),y_(0),click_(false)\r
 \r
   {\r
     register_class();\r
@@ -59,6 +59,35 @@ namespace sf
     create_window();\r
   }\r
 \r
+  test_window::result_t test_window::on_left_mouse_button_down(uint32_t mouse_key,int x,int y ) \r
+  {\r
+    click_ = true;\r
+    RECT r;\r
+    GetWindowRect(hwnd_,&r);\r
+    POINT p={x,y};\r
+    ClientToScreen(hwnd_,&p);\r
+    x_ = p.x - r.left;\r
+    y_ = p.y - r.top;\r
+    return 0; \r
+  }\r
+\r
+\r
+\r
+  test_window::result_t test_window::on_left_mouse_button_up(uint32_t mouse_key,int x,int y) \r
+  { \r
+    click_ = false;\r
+    return 0; \r
+  }\r
+\r
+  test_window::result_t test_window::on_mouse_move(uint32_t mouse_key,int x,int y)\r
+  {\r
+    if(click_){\r
+      POINT p = {x,y};\r
+      ClientToScreen(hwnd_,&p);\r
+      SetWindowPos(hwnd_,NULL,p.x - x_,p.y - y_,0,0,SWP_NOOWNERZORDER | SWP_NOREDRAW | SWP_NOSIZE | SWP_NOZORDER);\r
+    }\r
+    return 0;\r
+  }\r
   //base_win32_window_t::result_t test_window::on_create(CREATESTRUCT *p)\r
   //{\r
   //  return 0;\r