{"id":5711,"date":"2018-06-21T23:53:15","date_gmt":"2018-06-21T14:53:15","guid":{"rendered":"https:\/\/ukaapple.selfip.com\/support\/?p=5711"},"modified":"2018-06-22T00:14:01","modified_gmt":"2018-06-21T15:14:01","slug":"original_app_250","status":"publish","type":"post","link":"https:\/\/minnano.app\/support\/2018\/06\/21\/original_app_250\/","title":{"rendered":"\u72ec\u5275\u30a2\u30d7\u30ea\u958b\u767a\u65e5\u8a18 250\u65e5\u76ee C++\u306b\u3088\u308b\u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc\u306eOpenGL\u30b3\u30fc\u30c9\u7b2c\u4e00\u6b69"},"content":{"rendered":"<p>\u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc\u306eOpenGL\u30b3\u30fc\u30c9\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002<\/p>\n<p>\u3068\u308a\u3042\u3048\u305amac\u3067C++\u3092\u4f7f\u3063\u3066\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u5404\u7a2eOS\u3067\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306bGLFW\u3092\u5229\u7528\u3057\u307e\u3059\u3002GLFW\u306f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3001Window\u8868\u793a\u3084\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8\u3001\u5165\u529b\u30a4\u30d9\u30f3\u30c8\u306a\u3069\u3092\u6271\u3048\u307e\u3059\u3002GLEW\u306fOpenGL\u62e1\u5f35\u3092\u624b\u8efd\u306b\u7528\u3044\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u4fbf\u5229\u30c4\u30fc\u30eb\u3067\u3001\u3053\u3061\u3089\u3082\u5229\u7528\u3057\u307e\u3059\u3002\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>brew install glfw\r\nbrew install glew\r\n<\/code><\/pre>\n<p>\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002\u5fb9\u591c\u3067\u66f8\u304d\u4e0a\u3052\u307e\u3057\u305f\u3002\u89e3\u8aac\uff1f\u521d\u3081\u3066\u5229\u7528\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u306a\u306e\u3067\u89e3\u8aac\u3067\u304d\u308b\u307b\u3069\u306e\u77e5\u8b58\u306f\u6301\u3063\u3066\u3044\u307e\u305b\u3093\u30fb\u30fb\u30fb<\/p>\n<pre><code>#include &lt;iostream&gt;\r\n#include &lt;GL\/glew.h&gt;\r\n#include &lt;GLFW\/glfw3.h&gt;\r\n\r\nusing namespace std;\r\n\r\nint main() {\r\n    \/\/ GLFW init\r\n    if (glfwInit() == GL_FALSE) {\r\n        cout << \"failed to glfwInit\" << endl;\r\n        return 1;\r\n    }\r\n    atexit(glfwTerminate);\r\n    \r\n    \/\/ create window\r\n    GLFWwindow *const window(glfwCreateWindow(1200, 720, \"GameInsWindow\", NULL, NULL));\r\n    if (NULL == window) {\r\n        cout << \"failed to create window\" << endl;\r\n        return 1;\r\n    }\r\n    \r\n    \/\/ OpenGL 4.1\r\n    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);\r\n    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);\r\n\r\n    \/\/ make context\r\n    glfwMakeContextCurrent(window);\r\n    glfwSwapInterval(1);\r\n    \r\n    \/\/ GLEW init\r\n    if (GLEW_OK != glewInit()) {\r\n        cout << \"failed to glewInit\" << endl;\r\n        return -1;\r\n    }\r\n\r\n    \/\/ clear\r\n    glClearColor(0.0f, 0.5f, 0.0f, 1.0f);\r\n    \r\n    while (glfwWindowShouldClose(window) == GL_FALSE) {\r\n        glClear(GL_COLOR_BUFFER_BIT);\r\n        glfwSwapBuffers(window);\r\n        glfwPollEvents();\r\n    }\r\n    \r\n    return 0;\r\n}\r\n<\/code><\/pre>\n<p>\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u307e\u3057\u3087\u3046\u3002IDE\uff1fCMake\uff1f\u306a\u306b\u305d\u308c\u7f8e\u5473\u3057\u3044\u306e\uff1f<\/p>\n<pre><code>g++ Program.cpp -lglfw -lglew -framework OpenGL\r\n<\/code><\/pre>\n<p>\u3068\u308a\u3042\u3048\u305amac\u3067\u52d5\u4f5c\u3059\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/minnano.app\/support\/wp-content\/uploads\/2018\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-06-22-0.00.38.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/minnano.app\/support\/wp-content\/uploads\/2018\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-06-22-0.00.38-300x185.png\" alt=\"\" width=\"300\" height=\"185\" class=\"alignnone size-medium wp-image-5721\" srcset=\"https:\/\/minnano.app\/support\/wp-content\/uploads\/2018\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-06-22-0.00.38-300x185.png 300w, https:\/\/minnano.app\/support\/wp-content\/uploads\/2018\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-06-22-0.00.38-768x474.png 768w, https:\/\/minnano.app\/support\/wp-content\/uploads\/2018\/06\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2018-06-22-0.00.38-1024x632.png 1024w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u660e\u65e5\u306fLinux(Ubuntu)\u3084\u3001Edge\u3084Cortana\u306e\u5229\u7528\u3092\u5f37\u5236\u3057\u3066\u304f\u308b\u90aa\u60aa\u306aWindows\u3067\u3082\u52d5\u4f5c\u78ba\u8a8d\u3092\u884c\u306a\u3063\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc\u306eOpenGL\u30b3\u30fc\u30c9\u306e\u7b2c\u4e00\u6b69\u3067\u3059\u3002 \u3068\u308a\u3042\u3048\u305amac\u3067C++\u3092\u4f7f\u3063\u3066\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u8868\u793a\u3057\u307e\u3059\u3002 \u5404\u7a2eOS\u3067\u52d5\u4f5c\u3055\u305b\u308b\u305f\u3081\u306bGLFW\u3092\u5229\u7528\u3057\u307e\u3059\u3002GLFW\u306f\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b9\u306e\u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc &hellip; <a href=\"https:\/\/minnano.app\/support\/2018\/06\/21\/original_app_250\/\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u72ec\u5275\u30a2\u30d7\u30ea\u958b\u767a\u65e5\u8a18 250\u65e5\u76ee C++\u306b\u3088\u308b\u30de\u30eb\u30c1\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u5bfe\u5fdc\u306eOpenGL\u30b3\u30fc\u30c9\u7b2c\u4e00\u6b69<\/span> <span class=\"meta-nav\">&rarr;<\/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":[16],"tags":[],"class_list":["post-5711","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/posts\/5711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/comments?post=5711"}],"version-history":[{"count":15,"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/posts\/5711\/revisions"}],"predecessor-version":[{"id":5727,"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/posts\/5711\/revisions\/5727"}],"wp:attachment":[{"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/media?parent=5711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/categories?post=5711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/minnano.app\/support\/wp-json\/wp\/v2\/tags?post=5711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}