-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potentially add even more basic examples? #336
Comments
You're right, the current entry level of knowledge includes actual OpenGL knowledge of all object types and their relations. We should focus on easing usage, e.g., by providing more examples that show more aspects from OpenGL and how they are used with globjects. As a long-term goal we want to provide a large amount of cool OpenGL demos and examples based on globjects but our programming capacity is currently low and we must focus on other projects right now.
In addition, you can provide a link or open another issue where you provide some code so I can have a look at it. |
Well one example where a question arises is here where you bind a VAO using globjects but then draw the triangles using a standard openGL call, |
also, here's some code I have questions about: auto g_vao = make_ref<VertexArray>();
auto g_vertexBuffer = make_ref<Buffer>();
g_vertexBuffer->setData(g_vertices, GL_STATIC_DRAW);
auto g_colorBuffer = make_ref<Buffer>();
g_colorBuffer->setData(g_colors, GL_STATIC_DRAW);
auto binding = g_vao->binding(0);
binding->setAttribute(0);
binding->setBuffer(g_vertexBuffer, 0, sizeof(glm::vec3));
binding->setFormat(3, GL_FLOAT);
binding->setAttribute(1);
binding->setBuffer(g_colorBuffer, 0, sizeof(glm::vec3));
binding->setFormat(3, GL_FLOAT);
g_vao->enable(0); and the relevant vertex shader is: #version 330 core
layout(location = 0) in vec3 vertPos;
layout(location = 1) in vec3 color;
uniform mat4 P;
uniform mat4 MV;
out vec3 Color;
void main()
{
Color = color;
gl_Position = P * MV * vec4(vertPos, 1.0);
} Using this code to initialize buffers given that EDIT: I just needed to enable that attribute in the Vertex Array. So all is well now in at least my small project. But I still would look forward to more comparisons to "plain old" OpenGL calls. Especially to clarify what's happening when I call, say, |
I've been trying to use this library for a day or two now, and while I'm new to openGL, I'm struggling to use this library to even draw a simple triangle, starting with my vertex data and color data in 2 separate
std::vector<glm::vec3>
's. I can accomplish this with the normal openGL calls, but despite going through example after example, I can't seem to figure out how to translate the simple task of drawing one triangle to globjects code. Having even just one slightly more fleshed out case of regular openGL vs globjects would be super helpful. It's really hard to find documentation on this library elsewhere on the web.The text was updated successfully, but these errors were encountered: