{"id":257,"date":"2009-07-12T23:23:57","date_gmt":"2009-07-12T17:53:57","guid":{"rendered":"http:\/\/techtwaddle.net\/?p=257"},"modified":"2011-04-12T23:24:15","modified_gmt":"2011-04-12T17:54:15","slug":"draggin-the-marbles-around-directdraw-part-9","status":"publish","type":"post","link":"https:\/\/techtwaddle.co.in\/blog\/2009\/07\/12\/draggin-the-marbles-around-directdraw-part-9\/","title":{"rendered":"Draggin the marbles around, DirectDraw, Part 9"},"content":{"rendered":"<div style=\"text-align: justify; font-family: Comic Sans MS;\">You could sure use some mouse input with the marbles. Remove the timer stuff from the <span style=\"font-family: Verdana;\">DDEX3<\/span> program that we modified and add handling for <span style=\"font-family: Verdana; color: rgb(0, 0, 128);\">WM_LBUTTONDOWN<\/span>, <span style=\"font-family: Verdana; color: rgb(0, 0, 128);\">WM_LBUTTONUP<\/span> and <span style=\"font-family: Verdana; color: rgb(0, 0, 128);\">WM_MOUSEMOVE<\/span> messages in the <span style=\"font-family: Verdana; color: rgb(0, 0, 128);\">WindowProc()<\/span> function. You will need to add some code to find out if <span style=\"font-family: Verdana;\"><span style=\"color: rgb(0, 0, 128);\">WM_LBUTTONDOWN<\/span><\/span> was on the marble and then move the position of the marble relative to its last position whenever you get <span style=\"font-family: Verdana; color: rgb(0, 0, 128);\">WM_MOUSEMOVE<\/span> message.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify; font-family: Comic Sans MS;\">Here is a video of it:<\/div>\n<p>&nbsp;<\/p>\n<p><object width=\"425\" height=\"344\" style=\"font-family: Comic Sans MS;\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/L_vgYR1gtEo&amp;hl=en&amp;fs=1&amp;\" \/><param name=\"allowFullScreen\" value=\"true\" \/><param name=\"allowscriptaccess\" value=\"always\" \/><\/object><\/p>\n<p>&nbsp;<\/p>\n<div style=\"text-align: justify;\"><span style=\"font-family: Comic Sans MS;\"><\/p>\n<p>If you run this in debug mode you can notice considerable lag because it runs over the debugger. The video here shows the application running normally, i.e. I select the program to &quot;Start Without Debugging&quot; (ctrl + F5).<\/span><\/div>\n","protected":false},"excerpt":{"rendered":"<p>You could sure use some mouse input with the marbles. Remove the timer stuff from the DDEX3 program that we modified and add handling for WM_LBUTTONDOWN, WM_LBUTTONUP and WM_MOUSEMOVE messages in the WindowProc() function. You will need to add some code to find out if WM_LBUTTONDOWN was on the marble and then move the position &hellip; <a href=\"https:\/\/techtwaddle.co.in\/blog\/2009\/07\/12\/draggin-the-marbles-around-directdraw-part-9\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Draggin the marbles around, DirectDraw, Part 9<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[1],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1ktFF-49","_links":{"self":[{"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/posts\/257"}],"collection":[{"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":1,"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"predecessor-version":[{"id":258,"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions\/258"}],"wp:attachment":[{"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtwaddle.co.in\/blog\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}