OpenGL graphics in C++ from scratch [CMake + GLFW + GLEW]

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024
  • I try to stream the things I learned in the past few days for my hobby project while being super tired after a long day at work -- Watch live at / woafthewolf
    Code: github.com/Woa...
    Stream chat:
    CatO-----: woohoo \o/
    Bund-----: shouldn't you negate the fail check?
    Bund-----: use docs.gl/ for reference :)
    Bund-----: array of strings: use &cShader
    Bund-----: you could automatically concatenate multiple strings into one shader, that's why it needs an array of strings
    Bund-----: yes nullptr is fine there (it will assume null terminated strings this way)
    Bund-----: i = int, v = value
    Bund-----: hm, or 'v' might be vector (as in getting potentially getting multiple values)
    Bund-----: that's just an offset pointer 😅
    Bund-----: to be clearer you could unbind the vao and unuse the program
    Bund-----: (won't matter now, but still)

ความคิดเห็น • 20

  • @conkerconk3
    @conkerconk3 10 หลายเดือนก่อน +2

    I nearly had an aneurism trying to figure out how to use OpenGL and CMAKE... this video helped a ton :D

  • @stefancomandant8683
    @stefancomandant8683 3 หลายเดือนก่อน

    Thank you very much! I've been struggling to set up all of them together for days, but was running from an error to another error. Very helpful video!

  • @lucaion3628
    @lucaion3628 ปีที่แล้ว +1

    Thank you so much for this tutorial. I was stuck for such a long time trying to link glew to my project. Thank you!

  • @Prosony1
    @Prosony1 2 ปีที่แล้ว +1

    i love you bro! Thanks for cmake explane

  • @fanpeter-z3c
    @fanpeter-z3c 3 ปีที่แล้ว +1

    thanks bro ,u save my life!

  • @barrenhook6900
    @barrenhook6900 3 ปีที่แล้ว +2

    you're an opensource god

    • @amos660
      @amos660 2 ปีที่แล้ว +1

      on windows.

  • @codebitcookie8053
    @codebitcookie8053 3 ปีที่แล้ว +1

    Amazing work! good job :)

  • @mobileiotapps967
    @mobileiotapps967 3 ปีที่แล้ว

    Amazing bro thanks.

  • @Albert-lr7ky
    @Albert-lr7ky 2 ปีที่แล้ว

    Great!

  • @abdelhaksaouli8802
    @abdelhaksaouli8802 3 ปีที่แล้ว +2

    you don't need glewExperimental in glew 3

  • @CyberRazeR
    @CyberRazeR 3 ปีที่แล้ว +2

    Hey man iam getting all white in the middle of the triangle any ideas what causing it

    • @elyxthelynx
      @elyxthelynx  3 ปีที่แล้ว +2

      The program probably cannot find the shader, which is supposed to fill out the triangle. Check the name of the file, its path, and the console window to see any error messages.

  • @juliancasali4973
    @juliancasali4973 2 ปีที่แล้ว

    thanks bro, could not configure mlfw and glew.

  • @Areshk
    @Areshk ปีที่แล้ว

    Which compiler are you using?

    • @elyxthelynx
      @elyxthelynx  ปีที่แล้ว

      I was using Visual Studio 2019 with MSVC19 for this tutorial.

  • @imperialgames323
    @imperialgames323 3 ปีที่แล้ว +1

    can u share source code pls because i cant import glfw&glew

    • @elyxthelynx
      @elyxthelynx  3 ปีที่แล้ว +1

      Sure, I created a new GitHub repository for it, which I also put down in the video description:
      github.com/Woaf/OpenGL_Tutorial

  • @RandomPerson-gy3ql
    @RandomPerson-gy3ql 3 ปีที่แล้ว

    How to disable console?))

    • @elyxthelynx
      @elyxthelynx  3 ปีที่แล้ว +1

      There are several ways of doing this. You can use some platform specific codes inside the source files, or try to find an option regarding the console display in Visual Studio or Qt, or any other IDE. However, I'd suggest embedding this option inside the cmake file of the opengl module (project), as such:
      IF(WIN32)
      SET(GUI_TYPE WIN32)
      ENDIF(WIN32)
      IF (APPLE)
      SET(GUI_TYPE MACOSX_BUNDLE)
      ENDIF (APPLE)
      add_executable (Opengl2 ${GUI_TYPE} "main.cpp")
      Now for this to work, you need to rename the "main" function to "WinMain" on Windows. I am not sure how Apple handles this. I'd also suggest delegating the WinMain and main functions based on system symbols, so something like:
      #ifdef WIN
      WinMain ()....
      #else
      main ().....
      #endif