{"id":9639,"date":"2019-05-20T00:48:19","date_gmt":"2019-05-19T15:48:19","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=9639"},"modified":"2019-05-20T00:48:19","modified_gmt":"2019-05-19T15:48:19","slug":"ubuntu-18-04-lts%e3%81%a7-opengl%e9%96%8b%e7%99%ba","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=9639","title":{"rendered":"Ubuntu 18.04 LTS\u3067 OpenGL\u958b\u767a"},"content":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u3082OpenGl\u5468\u308a\u306a\u306e\u3067\u3059\u304c\u3001\u5e38\u65e5\u9803Mac\u30e1\u30a4\u30f3\u3067\u958b\u767a\u3057\u3066\u3044\u308b\u79c1\u3067\u3059\u304c\u3001\u53bb\u5e74\u306f\u7d50\u69cb\u885d\u6483\u7684\u306a\u30cb\u30e5\u30fc\u30b9\u304c\u767a\u8868\u3055\u308c\u307e\u3057\u305f\u306d\u3002<\/p>\n<p>\u3068\u3044\u3046\u306e\u3082\u30012018\u5e746\u6708\u306bApple\u306f\u3001macOS 10.14 Mojave\u306b\u304a\u3051\u308bOpen GL \/GL ES\u3068OpenCL\u306e\u6271\u3044\u306f\u3001\u975e\u63a8\u5968\u306b\u306a\u308a\u3001\u4eca\u5f8c\u306f\u3001\u72ec\u81ea\u306e3D\u30b0\u30e9\u30d5\u30a3\u30c3\u30af\u30b9API\u3001Metal\u304a\u3088\u3073Metal Performance Shaders\u306e\u5229\u7528\u3092\u63a8\u5968\u3059\u308b\u65b9\u5411\u3068\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3068\u306a\u308a\u3001\u30de\u30b8\u304b\u3088Apple\uff01\uff1f\u72b6\u614b\u306b\u306a\u3063\u305f\u306e\u306f\u8a18\u61b6\u306b\u65b0\u3057\u3044\u3067\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u3053\u3093\u306a\u3067Apple\u306b\u5bfe\u3059\u308b\u5fe0\u8aa0\u5fc3\u3082\u6614\u307b\u3069\u306a\u304f\u306a\u308a\u3001\u6700\u8fd1\u3067\u306fAndroid\u3084\u3001Linux\u5468\u308a\u3092\u6271\u3046\u3088\u3046\u306b\u3082\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u3082\u305d\u3082\u305d\u3082\u3001OpenGL\u3082\u67af\u308c\u3066\u304d\u305f\u6280\u8853\u306a\u308f\u3051\u3067\u3001API\u8a2d\u8a08\u306f\u5f90\u3005\u306b\u9673\u8150\u5316\u3057\u3066\u304d\u3066\u3044\u308b\u3053\u3068\u3082\u3042\u3063\u3066\u3001\u30d9\u30f3\u30c0\u30fc\u305d\u308c\u305e\u308c\u304c\u96e2\u308c\u3066\u3044\u304f\u50be\u5411\u3082\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u958b\u767a\u3092\u884c\u3063\u305f\u70b9\u3082\u3042\u3063\u3066\u3001\u305d\u308c\u3067\u3082\u3084\u3063\u3071\u308aOpenGL\u3092\u6271\u3044\u305f\u3044\u3002<\/p>\n<p>\u3068\u3044\u3046\u304b\u3001Ubuntu\u3067\u3082\u958b\u767a\u3057\u305f\u3044\u306e\u3067\u3001\u4eca\u56de\u306fUbuntu 18.04 LTS\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<h4>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h4>\n<p>\u4f55\u306f\u3068\u3082\u3042\u308c\u3001\u3044\u3064\u3082\u306eapt update\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo apt update\r\n$ sudo apt upgrade&#x5B;code]\r\n\r\nGLUT ( freeglut)\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002\r\n\r\n&#x5B;code]$ sudo apt-get install freeglut3 freeglut3-dev<\/pre>\n<p>\u7d9a\u3044\u3066Mesa 3D\u306e\u958b\u767a\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ sudo apt-get install libglu1-mesa-dev mesa-common-dev<\/pre>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3089\u3001\u7a7a\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8d77\u3061\u4e0a\u304c\u308b\u69d8\u306b\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u884c\u3044\u307e\u3059\u3002<\/p>\n<p><strong>main.cpp<\/strong><\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">#include &lt;GL\/glut.h&gt;\r\n\r\nvoid display(void) { }\r\n\r\nint main(int argc, char *argv&#x5B;])\r\n{\r\n  glutInit(&amp;argc, argv);\r\n  glutCreateWindow(argv&#x5B;0]);\r\n  glutDisplayFunc(display);\r\n  glutMainLoop();\r\n  return 0;\r\n}<\/pre>\n<p>\u4e0a\u8a18\u306e\u30bd\u30fc\u30b9\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3089\u3001\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u884c\u3044\u307e\u3057\u3087\u3046\u3002<\/p>\n<h4>\u30b3\u30f3\u30d1\u30a4\u30eb<\/h4>\n<p>\u4ee5\u4e0b\u306e g++\u30b3\u30de\u30f3\u30c9\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ g++ -Wall -Weffc++ -o glut_main main.cpp -lglut -lGLU -lGL<\/pre>\n<p>glut_main\u306e\u30d0\u30a4\u30ca\u30ea\u30d5\u30a1\u30a4\u30eb\u304c\u4f5c\u6210\u3067\u304d\u307e\u3059\u306e\u3067\u3001\u5b9f\u884c\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">$ .\/glut_main<\/pre>\n<p>\u3059\u308b\u3068\u3001\u7a7a\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u304c\u8d77\u3061\u4e0a\u304c\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-9645\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/05\/Screenshot-from-2019-05-20-00-35-54.png\" alt=\"\" width=\"247\" height=\"269\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/05\/Screenshot-from-2019-05-20-00-35-54.png 299w, https:\/\/www.webcyou.com\/wp-content\/uploads\/2019\/05\/Screenshot-from-2019-05-20-00-35-54-275x300.png 275w\" sizes=\"auto, (max-width: 247px) 100vw, 247px\" \/><\/p>\n<p>\u30ad\u30bf\u30fc\u3002<\/p>\n<p>freeglut \u306e\u5834\u5408\u306f, g++ \u30b3\u30de\u30f3\u30c9\u306b -lglut -lGLU -lGL \u3068\u3044\u3046\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8ffd\u52a0\u3059\u308b\u3060\u3051\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>Ubuntu\u3067\u3001OpenGL\u958b\u767a\u3067\u304d\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n<p>\u6b21\u56de\u306f\u3001\u30a6\u30a3\u30f3\u30c9\u30a6\u306b\u63cf\u753b\u3084\u3001libglfw3\u306a\u3069\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002 \u4eca\u56de\u3082OpenGl\u5468\u308a\u306a\u306e\u3067\u3059\u304c\u3001\u5e38\u65e5\u9803Mac\u30e1\u30a4\u30f3\u3067\u958b\u767a\u3057\u3066\u3044\u308b\u79c1\u3067\u3059\u304c\u3001\u53bb\u5e74\u306f\u7d50\u69cb\u885d\u6483\u7684\u306a\u30cb\u30e5\u30fc\u30b9\u304c\u767a\u8868\u3055\u308c\u307e\u3057\u305f\u306d\u3002 \u3068\u3044\u3046\u306e\u3082\u30012018\u5e746\u6708\u306bApple\u306f\u3001macOS 10.14 Mojave\u306b\u304a\u3051 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[248],"tags":[40,166,37,58,78,114,118],"class_list":["post-9639","post","type-post","status-publish","format-standard","hentry","category-ubuntu","tag-ios-sdk","tag-iphone","tag-iphone-","tag-sdk","tag-78","tag-114","tag-118"],"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9639"}],"version-history":[{"count":6,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9639\/revisions"}],"predecessor-version":[{"id":9646,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/9639\/revisions\/9646"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9639"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}