I was doing this part of this opengl tutorial and when trying to replicate the rectangle example it ends in a segfault, it starts up when i dont create the VAO (the VAObject variable) but when i do that it doesnt draw anything at all, i recently recompiled glfw to use glx. rectangle source: https://pastebin.com/LD8QPa47 canned_glfw_window.hpp: https://pastebin.com/0pkxSrBK canned_glfw_window.cpp: https://pastebin.com/an3GQcy1 (i put most of the logic in the last 2 files in order to be able to reuse it later)

  • prettydarknwild@lemmy.worldOP
    link
    fedilink
    arrow-up
    1
    ·
    9 months ago

    one more thing, i was debugging the triangle example (this one uses all the abstractions that i created) and using the logging functions it says me that the shader program is not linking, i added a debug function in the GLShaderProgram class and it says that the fragment shader does not have a main function, when i compile it without it it renders a white triangle, when i compile it with it it displays a blank window, can you tell me where is the problem?: https://pastebin.com/8VbyUNFR

    • e0qdk@kbin.social
      link
      fedilink
      arrow-up
      1
      ·
      9 months ago

      Looks like you wrote std::shared_ptr fragment_shader(new GLShader(&vertex_shader_src, 1, GL_FRAGMENT_SHADER, NULL)); instead of passing &fragment_shader_src.