{"id":2208,"date":"2021-10-10T13:00:50","date_gmt":"2021-10-10T04:00:50","guid":{"rendered":"https:\/\/sirius10.net\/blog\/wordpress\/?p=2208"},"modified":"2021-10-10T13:00:52","modified_gmt":"2021-10-10T04:00:52","slug":"post-2208","status":"publish","type":"post","link":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/2021\/10\/10\/2208\/","title":{"rendered":"SDL2 \u3067\u753b\u50cf\u3092\u8868\u793a\u3059\u308b"},"content":{"rendered":"\n<p>\u3000SDL2 \u3067\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u30d3\u30c3\u30c8\u30de\u30c3\u30d7\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3001\u30b5\u30fc\u30d5\u30a7\u30b9\u3092\u4f5c\u6210\u3057\u3001\u30c6\u30af\u30b9\u30c1\u30e3\u306b\u5909\u3048\u307e\u3059\u3002\u305d\u3057\u3066\u3001renderer \u3092\u4f7f\u3063\u3066\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3000SDL2 \u3060\u3051\u3067\u3042\u308c\u3070\u3001bmp \u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3048\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u30d5\u30a1\u30a4\u30eb\u5f62\u5f0f\u306f\u3001SDL2_image \u3092\u4f7f\u3046\u3068\u8aad\u307f\u8fbc\u307f\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3000bmp \u30d5\u30a1\u30a4\u30eb\u304b\u3089 SDL_Surface \u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001SDL_LoadBMP() \u95a2\u6570\u3092\u4f7f\u3044\u307e\u3059\u3002\u5f15\u6570\u306f\u8aad\u307f\u8fbc\u3080 bmp \u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3000\u4f5c\u6210\u3057\u305f\u30b5\u30fc\u30d5\u30a7\u30b9\u306f\u3001SDL_CreateTextureFromSurface() \u95a2\u6570\u3067\u30c6\u30af\u30b9\u30c1\u30e3\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u5f15\u6570\u306f\u30ec\u30f3\u30c0\u30e9\u3068\u30b5\u30fc\u30d5\u30a7\u30b9\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3000\u30c6\u30af\u30b9\u30c1\u30e3\u306f\u3001SDL_RenderCopy() \u95a2\u6570\u3067\u753b\u9762\u306b\u8868\u793a\u3067\u304d\u307e\u3059\u3002\u5f15\u6570\u306f\u30ec\u30f3\u30c0\u30e9\u3001\u30b5\u30fc\u30d5\u30a7\u30b9\u3001\u30b3\u30d4\u30fc\u5143\u306e SDL_Rect\u3001\u30b3\u30d4\u30fc\u5148\u306e SDL_Rect \u3067\u3059\u3002\u30b3\u30d4\u30fc\u5143\u306f NULL \u3060\u3068\u5168\u4f53\u3092\u8868\u3057\u307e\u3059\u3002\u30b3\u30d4\u30fc\u5148\u3092 NULL \u306b\u3059\u308b\u3068\u3001\u753b\u9762\u5168\u4f53\u306b\u306a\u308a\u307e\u3059\u3002\u3053\u306e\u6642\u62e1\u5927\u3001\u7e2e\u5c0f\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3000\u307e\u3068\u3081\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted file\">SDL_Renderer *renderer;\nSDL_Surface *image;\nSDL_Texture *bitmapTex;\n\u30fb\n\u30fb\nimage = SDL_LoadBMP(\"test.bmp\");\nbitmapTex = SDL_CreateTextureFromSurface(renderer, image);\nSDL_FreeSurface(image);\nSDL_RenderCopy(renderer, bitmapTex, NULL, NULL);\n\u30fb\n\u30fb\nSDL_RenderPresent(renderer);\nSDL_DestroyTexture(textTex);\n<\/pre>\n\n\n\n<p>\u3000SDL_RenderCopy() \u95a2\u6570\u306e\u4ee3\u308f\u308a\u306b SDL_RenderCopyEx() \u95a2\u6570\u3092\u4f7f\u3046\u3068\u753b\u50cf\u306e\u56de\u8ee2\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000SDL2 \u3067\u753b\u50cf\u3092\u8868\u793a\u3059\u308b\u306b\u306f\u3001\u30d3\u30c3\u30c8\u30de\u30c3\u30d7\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3001\u30b5\u30fc\u30d5\u30a7\u30b9\u3092\u4f5c\u6210\u3057\u3001\u30c6\u30af\u30b9\u30c1\u30e3\u306b\u5909\u3048\u307e\u3059\u3002\u305d\u3057\u3066\u3001renderer \u3092\u4f7f\u3063\u3066\u30b3\u30d4\u30fc\u3057\u307e\u3059\u3002 \u3000SDL2 \u3060\u3051\u3067\u3042\u308c\u3070\u3001bmp \u30d5\u30a1\u30a4\u30eb\u3092\u6271\u3048\u307e\u3059\u3002\u305d\u308c\u4ee5\u5916\u306e\u30d5\u30a1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[27],"tags":[],"class_list":["post-2208","post","type-post","status-publish","format-standard","hentry","category-sdl2"],"_links":{"self":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=2208"}],"version-history":[{"count":3,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2208\/revisions"}],"predecessor-version":[{"id":2224,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/2208\/revisions\/2224"}],"wp:attachment":[{"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=2208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=2208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sirius10.net\/blog\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=2208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}