{"id":1536,"date":"2013-01-19T23:50:45","date_gmt":"2013-01-19T14:50:45","guid":{"rendered":"http:\/\/mattyan.net\/blog\/?p=1536"},"modified":"2013-01-19T23:50:45","modified_gmt":"2013-01-19T14:50:45","slug":"luabind%e3%81%ae%e3%83%a1%e3%83%a2%e6%9b%b8%e3%81%8d2%e3%81%a8qt%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab","status":"publish","type":"post","link":"https:\/\/mattyan.net\/blog\/?p=1536","title":{"rendered":"luabind\u306e\u30e1\u30e2\u66f8\u304d2\u3068Qt\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb"},"content":{"rendered":"<p>luabind\u3067lua\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u30c6\u30fc\u30d6\u30eb\u3092\u95a2\u6570\u306e\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u53d6\u308b\u65b9\u6cd5<br \/>\nC++\u5074\u306e\u95a2\u6570\u306e\u5f15\u6570\u306b\u306f luabind::object \u578b\u306e\u5909\u6570\u3092\u8a2d\u5b9a\u3057\u3066\u3001<\/p>\n<pre>\n<code class=\"\" data-line=\"\">\nSDL_Rect drawRect = {0, 0, 0, 0};\nif(luabind::type(rect) != LUA_TTABLE)return;\nif(luabind::type(rect[&quot;x&quot;]) == LUA_TNUMBER){drawRect.x = luabind::object_cast&lt;Sint16&gt;(rect[&quot;x&quot;]);}\nif(luabind::type(rect[&quot;y&quot;]) == LUA_TNUMBER){drawRect.y = luabind::object_cast&lt;Sint16&gt;(rect[&quot;y&quot;]);}\nif(luabind::type(rect[&quot;w&quot;]) == LUA_TNUMBER){drawRect.w = luabind::object_cast&lt;Uint16&gt;(rect[&quot;w&quot;]);}\nif(luabind::type(rect[&quot;h&quot;]) == LUA_TNUMBER){drawRect.h = luabind::object_cast&lt;Uint16&gt;(rect[&quot;h&quot;]);}\n<\/code>\n<\/pre>\n<p>\u3053\u3093\u306a\u304b\u3093\u3058\u3067\u30c6\u30fc\u30d6\u30eb\u306e\u30e1\u30f3\u30d0\u3092\u53d6\u5f97\u3059\u308b\u3002<br \/>\n\u578b\u30c1\u30a7\u30c3\u30af\u304c\u8981\u3089\u306a\u3044\u306a\u3089\u3001drawRect.x = luabind::object_cast<sint16>(rect[&#8220;x&#8221;]);\u3060\u3051\u3067\u3082OK\u3002<br \/>\n&#8212;<br \/>\nQT\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<br \/>\n<a href=\"http:\/\/wiki.batcom-it.net\/index.php?title=Building_Qt_on_Windows_%28MinGW%29\">Building Qt on Windows (MinGW)<\/a>\u3092\u898b\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u4e2d\u3002<br \/>\nmake\u3067\u306f\u306a\u304f\u3001mingw32-make\u3092\u4f7f\u3046\u3089\u3057\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>luabind\u3067lua\u30b9\u30af\u30ea\u30d7\u30c8\u304b\u3089\u30c6\u30fc\u30d6\u30eb\u3092\u95a2\u6570\u306e\u5f15\u6570\u3068\u3057\u3066\u53d7\u3051\u53d6\u308b\u65b9\u6cd5 C++\u5074\u306e\u95a2\u6570\u306e\u5f15\u6570\u306b\u306f luabind::object \u578b\u306e\u5909\u6570\u3092\u8a2d\u5b9a\u3057\u3066\u3001 SDL_Rect drawRect = {0, 0, 0, 0} &hellip; <a href=\"https:\/\/mattyan.net\/blog\/?p=1536\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">luabind\u306e\u30e1\u30e2\u66f8\u304d2\u3068Qt\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,1],"tags":[],"class_list":["post-1536","post","type-post","status-publish","format-standard","hentry","category-3","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1536"}],"version-history":[{"count":0,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1536\/revisions"}],"wp:attachment":[{"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mattyan.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}