Re: [AD] OpenGL path for WebGL

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Please ask on the [AD] list (http://www.liballeg.org/maillist.html), not
here. Developers are not usually subscribed to this list here (it was
basically superceded by allegro.cc a decade or so ago :P). I'll be
forwarding this to the correct list, and hopefully someone who knows more
about OpenGL than me can answer in more detail.

I can't for the life of me understand how to reply to reposted message, so I'll start a new thread, I guess. I don't understand mailing lists :) Forums are so much nicer...

1) Why does Allegro uses Vertex Buffer Arrays? There is only one
Vertex Buffer Object, and every frame we bind it and enable its
attributes. I'm do not know much about OpenGL, but it seems to me that
we should either do all these things, OR use VBA, which saves state.
To test this, I disabled creation & usage of VBA, and everything
worked without any glitches.


How did you test?

By running 'skater' demo.

2) I disabled emulation of WebGL's absent OpenGL ES 2 features in
Emscripten, and now, while the test is running, there are some
rendering errors. It seems they are related to Primitives addon.
Particularly this code inside setup_state function in prim_opengl.c
spews errors into console ("vertexAttribPointer: must have valid
GL_ARRAY_BUFFER binding"):
Is this with or without removing the vertex buffer array code above? I can
see this before calling setup_state:
if (vertex_buffer) {
  glBindBuffer(GL_ARRAY_BUFFER, (GLuint)vertex_buffer->common.handle);
}
So the vertex array buffer should be bound at the time
glVertexAttribPointer is called.

This is after disabling VBA code (because while it is enabled I can't even compile anything, because there is no glGenVertexArrays function in WebGL)
This branch only gets called if there is vertex_buffer passed into draw_prim_raw, which only happens when somebody calls al_draw_vertex_buffer. But which buffer should be bound when al_draw_prim is called, which does not have user-specified VBO?





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/