{"id":246,"date":"2008-10-16T01:29:30","date_gmt":"2008-10-15T17:29:30","guid":{"rendered":"http:\/\/130.211.243.36\/523b3.cn\/?p=246"},"modified":"2008-10-16T01:29:30","modified_gmt":"2008-10-15T17:29:30","slug":"opengl-notes1","status":"publish","type":"post","link":"https:\/\/www.523b3.com\/?p=246","title":{"rendered":"OpenGL notes(1)"},"content":{"rendered":"<p>\u6709\u5173Framework\u3002<\/p>\n<p>\u4eca\u5929\u9047\u5230\u4e00\u4e2a\u95ee\u9898\u3002\u67d0\u4e2a\u4f8b\u7a0b\u91cc\u9762\u7528\u4e86#include <openGL\/gl.h>\u8c03\u7528\u4e86Mac OS X\u81ea\u5e26\u7684OpenGL\u5e93\uff0c\u7f16\u8bd1\u6b63\u5e38\u3002\u5728\u5c1d\u8bd5\u7528\u8d34\u56fe\u6e32\u67d33D\u7269\u4f53\u65f6\uff0cNeHe\u6559\u7a0b\u91cc\u7528\u4e86AUX_RGBImageRec\u6765\u50a8\u5b58\u8bfb\u5165\u7684\u56fe\u7247\uff0c\u800c\u8fd9\u4e2a\u7c7b\u578b\u662f\u5305\u542b\u5728glaux\u5e93\u91cc\u7684\uff0c\u8fd9\u4e2a\u5e93\u53c8\u662fwindows only\u7684\u3002Apple\u7ed9\u7684\u5b98\u65b9\u8bf4\u660e\u7ed9\u4e86\u4e00\u4e9b\u9009\u9879\u6765\u5b8c\u6210mac\u4e2d\u7684\u76f8\u540c\u4efb\u52a1\uff0c\u4e00\u662f\u7528Cocoa\u7684NSView\u7c7b\uff0c\u4e8c\u662f\u7528Quartz\u7684image source\uff0c\u4e09\u662f\u76f4\u63a5\u4ece\u89e3\u538b\u7684\u6587\u4ef6\u91cc\u8bfb\u5165Raw\u6570\u636e\u3002\u5f53\u7136\uff0c\u6211\u9009\u4e86\u7b2c\u4e8c\u4e2a\u3002\u7cfb\u7edf\u7684ApplicationServices\/CoreGraphics.framework\/CGImage.h\u91cc\u9762\u5b9a\u4e49\u4e86Quartz\u7684\u56fe\u50cf\u6570\u636e\u7c7b\u578bCGImageRef\uff0c\u6240\u4ee5\uff0c\u6211\u5f97\u628a\u8fd9\u4e2a\u5934\u6587\u4ef6include\u8fdb\u53bb\u3002\u53ef\u662f\u5bfc\u5165\u4e86ApplicationServices Framework\u5230\u5de5\u7a0b\u91cc\uff0c\u5728\u5934\u6587\u4ef6\u91cc\u7528#include <applicationServices\/CGImage.h>\u5374\u603b\u662f\u62a5\u9519\uff0cno such file or directory\u3002\u800c\u5728\u5de5\u7a0b\u6d4f\u89c8\u5668\u91ccCGImage.h\u660e\u660e\u5728ApplicationServices\u4e0b\u9762\u2026\u2026\u540e\u6765\u7ffbXcode\u7684\u6587\u6863\u624d\u53d1\u73b0\uff0c\u6d89\u53ca\u6df1\u5c42\u6b21\u7684\u95ee\u9898\u3002<\/p>\n<p>Mac\u4e0b\u9762\u7684Framework\u90fd\u662f\u7528bundle\u7684\u5f62\u5f0f\u63d0\u4f9b\u7684\uff0c\u4e00\u4e2abundle\u91cc\u9762\u53ef\u4ee5\u5171\u5b58\u591a\u79cd\u7248\u672c\uff0c\u4fdd\u8bc1\u4e86\u5bf9\u65e7\u7248\u672c\u7a0b\u5e8f\u7684\u652f\u6301\u3002\u4e3a\u4e86\u4e3a\u7279\u5b9a\u7684\u5e94\u7528\u73af\u5883\u63d0\u4f9b\u5fc5\u9700\u7684\u7f16\u7a0b\u63a5\u53e3\uff0cApple\u5728\u6807\u51c6\u7684Framework\u4e4b\u5916\u8fd8\u63d0\u4f9b\u4e86Umbrella Framework\u3002\u7167\u6211\u7684\u7406\u89e3\uff0cUF\u987e\u540d\u601d\u4e49\u5e94\u8be5\u662f\u671f\u671b\u7528\u4f1e\u67b6\u7684\u7ed3\u6784\uff0c\u8bb2\u5206\u6563\u5728\u5404\u4e2aStandard Framework\u91cc\u7684subframework\u865a\u62df\u7684\u94fe\u63a5\u8d77\u6765\uff0c\u5f62\u6210\u9488\u5bf9\u67d0\u79cd\u7279\u5b9a\u5e94\u7528\u7684\u65b0\u7684framework\u3002\u4e0eStandard Framework\u4e0d\u540c\uff0cUF\u5e76\u4e0d\u628a\u5b83\u7684subframeworks\u91cc\u7684\u5934\u6587\u4ef6\u90fd\u5305\u62ec\u8fdb\u6765\uff0c\u800c\u4ec5\u4ec5\u5305\u542b\u90a3\u4e2aframework\u7684master header file\uff0c\u4e5f\u5c31\u662f\u4e0eframework\u540c\u540d\u7684\u90a3\u4e2a\u3002\u56e0\u6b64\uff0c\u5728\u8c03\u7528UF\u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981include\u8fd9\u4e2a\u5934\u6587\u4ef6\u5373\u53ef\u3002\u8fd9\u6837\u4e5f\u5e26\u6765\u4e00\u4e2a\u597d\u5904\uff0c\u5c31\u662f\u5982\u679cApple\u5bf9\u67d0\u4e2aframework\u91cc\u7684\u4e1c\u897f\u8fdb\u884c\u4e86\u4fee\u6539\uff0c\u5f00\u53d1\u8005\u5e76\u4e0d\u9700\u8981\u5bf9\u4ed6\u4eec\u7684\u4ee3\u7801\u505a\u6539\u52a8\uff0c\u56e0\u4e3a\u90a3\u4e2amaster header file\u603b\u662f\u4e0d\u4f1a\u6539\u53d8\u7684\u3002<\/p>\n<p>\u597d\u4e86\uff0c\u5e9f\u8bdd\u8fd9\u4e48\u591a\uff0c\u6700\u7ec8\u7ed3\u8bba\u5c31\u662f\uff0c\u53ea\u9700\u8981#include <applicationServices\/ApplicationServices.h>\u5c31\u53ef\u4ee5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u5173Framework\u3002 \u4eca\u5929\u9047\u5230\u4e00\u4e2a\u95ee\u9898\u3002\u67d0\u4e2a\u4f8b\u7a0b\u91cc\u9762\u7528\u4e86#include \u8c03\u7528\u4e86Mac OS X\u81ea\u5e26\u7684OpenGL\u5e93\uff0c\u7f16\u8bd1\u6b63\u5e38\u3002\u5728\u5c1d\u8bd5\u7528\u8d34\u56fe\u6e32\u67d33D\u7269\u4f53\u65f6\uff0cNeHe\u6559\u7a0b\u91cc\u7528\u4e86AUX_RGBImageRec\u6765\u50a8\u5b58\u8bfb\u5165\u7684\u56fe\u7247\uff0c\u800c\u8fd9\u4e2a\u7c7b\u578b\u662f\u5305\u542b\u5728glaux\u5e93\u91cc\u7684\uff0c\u8fd9\u4e2a\u5e93\u53c8\u662fwindows only\u7684\u3002Apple\u7ed9\u7684\u5b98\u65b9\u8bf4\u660e\u7ed9\u4e86\u4e00\u4e9b\u9009\u9879\u6765\u5b8c\u6210mac\u4e2d\u7684\u76f8\u540c\u4efb\u52a1\uff0c\u4e00\u662f\u7528Cocoa\u7684NSView\u7c7b\uff0c\u4e8c\u662f\u7528Quartz\u7684image source\uff0c\u4e09\u662f\u76f4\u63a5\u4ece\u89e3\u538b\u7684\u6587\u4ef6\u91cc\u8bfb\u5165Raw\u6570\u636e\u3002\u5f53\u7136\uff0c\u6211\u9009\u4e86\u7b2c\u4e8c\u4e2a\u3002\u7cfb\u7edf\u7684ApplicationServices\/CoreGraphics.framework\/CGImage.h\u91cc\u9762\u5b9a\u4e49\u4e86Quartz\u7684\u56fe\u50cf\u6570\u636e\u7c7b\u578bCGImageRef\uff0c\u6240\u4ee5\uff0c\u6211\u5f97\u628a\u8fd9\u4e2a\u5934\u6587\u4ef6include\u8fdb\u53bb\u3002\u53ef\u662f\u5bfc\u5165\u4e86ApplicationServices Framework\u5230\u5de5\u7a0b\u91cc\uff0c\u5728\u5934\u6587\u4ef6\u91cc\u7528#include \u5374\u603b\u662f\u62a5\u9519\uff0cno such file or directory\u3002\u800c\u5728\u5de5\u7a0b\u6d4f\u89c8\u5668\u91ccCGImage.h\u660e\u660e\u5728ApplicationServices\u4e0b\u9762\u2026\u2026\u540e\u6765\u7ffbXcode\u7684\u6587\u6863\u624d\u53d1\u73b0\uff0c\u6d89\u53ca\u6df1\u5c42\u6b21\u7684\u95ee\u9898\u3002 Mac\u4e0b\u9762\u7684Framework\u90fd\u662f\u7528bundle\u7684\u5f62\u5f0f\u63d0\u4f9b\u7684\uff0c\u4e00\u4e2abundle\u91cc\u9762\u53ef\u4ee5\u5171\u5b58\u591a\u79cd\u7248\u672c\uff0c\u4fdd\u8bc1\u4e86\u5bf9\u65e7\u7248\u672c\u7a0b\u5e8f\u7684\u652f\u6301\u3002\u4e3a\u4e86\u4e3a\u7279\u5b9a\u7684\u5e94\u7528\u73af\u5883\u63d0\u4f9b\u5fc5\u9700\u7684\u7f16\u7a0b\u63a5\u53e3\uff0cApple\u5728\u6807\u51c6\u7684Framework\u4e4b\u5916\u8fd8\u63d0\u4f9b\u4e86Umbrella Framework\u3002\u7167\u6211\u7684\u7406\u89e3\uff0cUF\u987e\u540d\u601d\u4e49\u5e94\u8be5\u662f\u671f\u671b\u7528\u4f1e\u67b6\u7684\u7ed3\u6784\uff0c\u8bb2\u5206\u6563\u5728\u5404\u4e2aStandard Framework\u91cc\u7684subframework\u865a\u62df\u7684\u94fe\u63a5\u8d77\u6765\uff0c\u5f62\u6210\u9488\u5bf9\u67d0\u79cd\u7279\u5b9a\u5e94\u7528\u7684\u65b0\u7684framework\u3002\u4e0eStandard Framework\u4e0d\u540c\uff0cUF\u5e76\u4e0d\u628a\u5b83\u7684subframeworks\u91cc\u7684\u5934\u6587\u4ef6\u90fd\u5305\u62ec\u8fdb\u6765\uff0c\u800c\u4ec5\u4ec5\u5305\u542b\u90a3\u4e2aframework\u7684master header file\uff0c\u4e5f\u5c31\u662f\u4e0eframework\u540c\u540d\u7684\u90a3\u4e2a\u3002\u56e0\u6b64\uff0c\u5728\u8c03\u7528UF\u7684\u65f6\u5019\uff0c\u53ea\u9700\u8981include\u8fd9\u4e2a\u5934\u6587\u4ef6\u5373\u53ef\u3002\u8fd9\u6837\u4e5f\u5e26\u6765\u4e00\u4e2a\u597d\u5904\uff0c\u5c31\u662f\u5982\u679cApple\u5bf9\u67d0\u4e2aframework\u91cc\u7684\u4e1c\u897f\u8fdb\u884c\u4e86\u4fee\u6539\uff0c\u5f00\u53d1\u8005\u5e76\u4e0d\u9700\u8981\u5bf9\u4ed6\u4eec\u7684\u4ee3\u7801\u505a\u6539\u52a8\uff0c\u56e0\u4e3a\u90a3\u4e2amaster header file\u603b\u662f\u4e0d\u4f1a\u6539\u53d8\u7684\u3002 \u597d\u4e86\uff0c\u5e9f\u8bdd\u8fd9\u4e48\u591a\uff0c\u6700\u7ec8\u7ed3\u8bba\u5c31\u662f\uff0c\u53ea\u9700\u8981#include \u5c31\u53ef\u4ee5\u3002<\/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":[50,57,71,106],"class_list":["post-246","post","type-post","status-publish","format-standard","hentry","category-opengl","tag-mac","tag-opengl","tag-xcode","tag-106"],"_links":{"self":[{"href":"https:\/\/www.523b3.com\/index.php?rest_route=\/wp\/v2\/posts\/246","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=246"}],"version-history":[{"count":0,"href":"https:\/\/www.523b3.com\/index.php?rest_route=\/wp\/v2\/posts\/246\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.523b3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.523b3.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.523b3.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}