this post was submitted on 10 Oct 2023
9 points (100.0% liked)
C++
1783 readers
1 users here now
The center for all discussion and news regarding C++.
Rules
- Respect instance rules.
- Don't be a jerk.
- Please keep all posts related to C++.
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
You're incorrectly passing the shader type instead of the shader handle as the first argument to the glShaderSource calls. Also, you've put vbo instead of ebo for the
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ...)
call. If I change those, I get the orange rectangle again.This may come in handy if it works on your implementation: https://www.khronos.org/opengl/wiki/Debug_Output
Note the example code at the very bottom of the page.
That helped me catch the shader type/handle issue. The vbo/ebo one I noticed by reading the code line by line and saying "wait, elements but you're passing vbo?!"
i have never been so happy to see a fucking orange rectangle in a black background in all my life ajhadhgdjh
Welcome to graphics programming! I know that feeling well...
thank you
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
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
.yeah, i noticed that before, i already fixed it, thank you anyway