Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OpenGLを試すなら

 OpenGLを試すなら

Nobuyuki Nishiyama

July 24, 2019
Tweet

More Decks by Nobuyuki Nishiyama

Other Decks in Programming

Transcript

  1. QPUBUPUJQT
    0QFO(-Λࢼ͢ͳΒ
    ΅ͬͪήʔϜσϕϩού
    ੢ࢁ৴ߦɹ

    View full-size slide


  2. ੿࡞ΞϓϦʮύζϧˍϞφʔΫʯ
    ສμ΢ϯϩʔυಥഁ

    View full-size slide

  3. ૬ख͕ڻ͘͜ͱ

    View full-size slide

  4. w6OJUZ΍6&ͳͲ͸࢖͍ͬͯ·ͤΜ
    w$JOEFSͱ͍͏ϑϨʔϜϫʔΫΛར༻ $

    w0QFO(-Λ௚઀৮͍ͬͯΔ

    View full-size slide

  5. wάϥϑΟοΫεϋʔυ΢ΣΞ޲͚ͷϥΠϒϥϦ
    w8JOEPXTɺNBD04ɺJ04ɺ"OESPJEͰ࢖͑Δ
    w$ɺ$ɺ+BWBʜ
    w 8FC(-͸0QFO(-ͷ೿ੜ
    0QFO(-

    View full-size slide

  6. Ͱɺ͜ͷ0QFO(-Λ৮ͬͯΈ͍ͨ
    ͱ͍͏ཁ๬͕૿͖͑ͯͨʂ

    View full-size slide

  7. ͱ͜Ζ͕ɺ৭ʑλΠϛϯά͕ѱ͘
    ͯखࠒͳ਽ܗ͕ݟ౰ͨΒͳ͍

    View full-size slide

  8. ͷͰɺ࡞Γ·ͨ͠ʂ

    View full-size slide

  9. IUUQTHJUIVCDPNUFLOJTIJ0QFO(-5FNQBMUF

    View full-size slide

  10. w(-'8࠷৽൛ͱ਽ܗΛಉࠝͨ͠ϓϩδΣΫτ
    w 8JOEPXTͱNBD04྆ରԠ
    w (-'8͸0QFO(-ͷॳظԽ΍ͦͷଞͷॲཧΛݞ୅ΘΓ͢Δ
    0QFO(-5FNQMBUFQSPHSBNCZ(-'8

    View full-size slide

  11. ਽ܗൈਮ
    #include
    int main(void) {
    GLFWwindow* window;
    if (!glfwInit()) return -1;
    window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
    if (!window) {
    glfwTerminate();
    return -1;
    }
    glfwMakeContextCurrent(window);
    glfwSwapInterval(1);
    // メインループ
    while (!glfwWindowShouldClose(window)) {
    glClear(GL_COLOR_BUFFER_BIT);
    // ここに描画処理を書く
    glfwSwapBuffers(window);
    glfwPollEvents();
    }
    glfwTerminate();
    return 0;
    }

    View full-size slide

  12. 0QFO(-Λֶ΅͏ͱ͍ͯ͠Δਓʹ
    ͜ͷ਽ܗͷଘࡏΛڭ͑ͯཉ͍͠Ͱ
    ͢ʂ

    View full-size slide

  13. "QQMF͕ຊ֨తʹ0QFO(-Λ࡟আ
    ͯ͠͠·͏લʹʂʂʂ

    View full-size slide

  14. 0QFO(-ຊͳΒ

    View full-size slide

  15. ͓·͚
    IUUQTHJUIVCDPNUFLOJTIJ(BNF5FNQMBUF

    View full-size slide

  16. ͜Μͳͷ࡞Γ·ͨ͠

    View full-size slide

  17. w5XJUUFS!NJOHBNF
    w'BDFCPPLNJOHBNF
    w(JU)VCUFLOJTIJ
    Ҏ্ʂ
    ΞϓϦ޷ධ഑৴தʂ

    View full-size slide