{"id":358,"date":"2008-11-22T21:12:23","date_gmt":"2008-11-23T05:12:23","guid":{"rendered":"http:\/\/130.211.243.36\/523b3.cn\/?p=276"},"modified":"2008-11-22T21:12:23","modified_gmt":"2008-11-23T05:12:23","slug":"opengl-notes5","status":"publish","type":"post","link":"https:\/\/www.523b3.com\/?p=358","title":{"rendered":"OpenGL notes(5)"},"content":{"rendered":"<p>\u6362\u5230Glut\u4e0a\u9762\uff0c\u539f\u5148\u627e\u5230\u7684cocoa\u90a3\u5c42\u90fd\u5f97\u91cd\u65b0\u5199\u8fc7\u3002\u8003\u8651\u5230\u5c06\u6765\u7684\u79fb\u690d\u95ee\u9898\uff0c\u8bfb\u53d6BMP\u7684\u90e8\u5206\u4e5f\u5c31\u6ca1\u7528glaux\uff08\u8fd9\u73a9\u610f\u513f\u53ea\u6709windows\u4e0b\u80fd\u7528\u2026\u2026\uff09\u548cmac\u7684\u5e93\uff0c\u81ea\u5df1\u5f04\u4e86\u4e2a\u8bfbbmp\u7684\u51fd\u6570\u3002\u5199\u597d\u4e4b\u540e\u6d4b\u4e86\u534a\u5929\uff0c\u56fe\u7247\u660e\u660e\u8bfb\u8fdb\u6765\u4e86\u5c31\u662f\u4e0d\u663e\u793a\u7eb9\u7406\u3002\u6298\u817e\u4e86\u4e00\u4e2a\u4e0b\u5348\uff0c\u6700\u540e\u53d1\u73b0\u662f\u4e2a\u83ab\u540d\u5176\u5999\u7684\u95ee\u9898\u5bfc\u81f4bmp\u7684\u5934\u90e8\u8bfb\u53d6\u4e0d\u6b63\u5e38\u3002<\/p>\n<p>typedef struct tagBITMAPFILEHEADER<br \/>\n{<br \/>\n\tshort int bfType;  \/\/specifies the file type<br \/>\n\tint bfSize;  \/\/specifies the size in bytes of the bitmap file<br \/>\n\tshort int bfReserved1;  \/\/reserved; must be 0<br \/>\n\tshort int bfReserved2;  \/\/reserved; must be 0<br \/>\n\tint bfOffBits;  \/\/species the offset in bytes from the bitmapfileheader to the bitmap bits<\/p>\n<p>}BITMAPFILEHEADER;<\/p>\n<p>\u5f88\u6e05\u695a\u7684\u7ed3\u6784\uff0cshort int\u957f\u5ea62\uff0cint\u957f\u5ea64\uff0c\u60f3\u5f53\u7136\u7684sizeof(BITMAPFILEHEADER)=14\uff0c\u8bd5\u4e86\u4e00\u4e0b\uff0c\u5c45\u7136\u662f16\u2026\u2026\u641c\u4e86\u641c\uff0c\u53d1\u73b0\u8fd9\u6d89\u53ca\u7ed3\u6784\u4f53\u6210\u5458\u7684\u5bf9\u9f50\u65b9\u5f0f\uff0c\u628a\u8fd9\u6bb5\u5b9a\u4e49\u653e\u8fdb#pragma pack(1)\u548c#pargma pack()\u4e4b\u95f4\u5373\u53ef\u3002<\/p>\n<p>\u539f\u56e0\u662f#pragma pack(n)\u6307\u5b9a\u4e86\u6210\u5458\u7684\u5bf9\u9f50\u65b9\u5f0f\u3002\u5bf9\u9f50\u7684\u65f6\u5019\uff0c\u5047\u8bbe\u67d0\u4e2a\u6210\u5458\u957f\u5ea6len\uff0c\u5219\u53d6x=min(len, n)\uff0c\u8fd9\u4e2a\u6210\u5458\u7684\u8d77\u59cb\u5730\u5740\u5c31\u662fx\u7684\u6574\u6570\u500d\u3002<\/p>\n<p>\u636e\u8bf4intel\u548cm$\u7684\u9762\u8bd5\u9898\u4e5f\u8003\u5230\u8fd9\u70b9\uff0c\u5f53\u7136\u66f4\u6df1\u5165\u3002http:\/\/www.sf.org.cn\/Article\/base\/200509\/260.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6362\u5230Glut\u4e0a\u9762\uff0c\u539f\u5148\u627e\u5230\u7684cocoa\u90a3\u5c42\u90fd\u5f97\u91cd\u65b0\u5199\u8fc7\u3002\u8003\u8651\u5230\u5c06\u6765\u7684\u79fb\u690d\u95ee\u9898\uff0c\u8bfb\u53d6BMP\u7684\u90e8\u5206\u4e5f\u5c31\u6ca1\u7528glaux\uff08\u8fd9\u73a9\u610f\u513f\u53ea\u6709windows\u4e0b\u80fd\u7528\u2026\u2026\uff09\u548cmac\u7684\u5e93\uff0c\u81ea\u5df1\u5f04\u4e86\u4e2a\u8bfbbmp\u7684\u51fd\u6570\u3002\u5199\u597d\u4e4b\u540e\u6d4b\u4e86\u534a\u5929\uff0c\u56fe\u7247\u660e\u660e\u8bfb\u8fdb\u6765\u4e86\u5c31\u662f\u4e0d\u663e\u793a\u7eb9\u7406\u3002\u6298\u817e\u4e86\u4e00\u4e2a\u4e0b\u5348\uff0c\u6700\u540e\u53d1\u73b0\u662f\u4e2a\u83ab\u540d\u5176\u5999\u7684\u95ee\u9898\u5bfc\u81f4bmp\u7684\u5934\u90e8\u8bfb\u53d6\u4e0d\u6b63\u5e38\u3002 typedef struct tagBITMAPFILEHEADER { short int bfType; \/\/specifies the file type int bfSize; \/\/specifies the size in bytes of the bitmap file short int bfReserved1; \/\/reserved; must be 0 short int bfReserved2; \/\/reserved; must be 0 int bfOffBits; \/\/species the offset in bytes from the bitmapfileheader to the bitmap bits }BITMAPFILEHEADER; \u5f88\u6e05\u695a\u7684\u7ed3\u6784\uff0cshort int\u957f\u5ea62\uff0cint\u957f\u5ea64\uff0c\u60f3\u5f53\u7136\u7684sizeof(BITMAPFILEHEADER)=14\uff0c\u8bd5\u4e86\u4e00\u4e0b\uff0c\u5c45\u7136\u662f16\u2026\u2026\u641c\u4e86\u641c\uff0c\u53d1\u73b0\u8fd9\u6d89\u53ca\u7ed3\u6784\u4f53\u6210\u5458\u7684\u5bf9\u9f50\u65b9\u5f0f\uff0c\u628a\u8fd9\u6bb5\u5b9a\u4e49\u653e\u8fdb#pragma pack(1)\u548c#pargma [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[34,57],"class_list":["post-358","post","type-post","status-publish","format-standard","hentry","category-opengl","tag-c","tag-opengl"],"_links":{"self":[{"href":"https:\/\/www.523b3.com\/index.php?rest_route=\/wp\/v2\/posts\/358","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.523b3.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.523b3.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.523b3.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.523b3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=358"}],"version-history":[{"count":0,"href":"https:\/\/www.523b3.com\/index.php?rest_route=\/wp\/v2\/posts\/358\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.523b3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.523b3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.523b3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}