The reason I personally won't bother with doing an NXT hook:
NXT uses VAO for everything. You have to keep track of each and every VAO used and the buffers associated with it (by copying the buffers.. + every shader can be different).
NXT uses VAO's for texturing as well. This means that the texturing is done through the shader now instead of the old pipeline. You'd have to check how the shader maps the texture onto a section on the screen (every shader can be different).
Anyway, the difference between RS3 and NXT.. For example:
NXT:
C++ Code:
//Single model
glGenVertexArrays(1, &vao); //create VAO (Vertex Array Object)
glGenBuffers(1, &vbo); //create VBO (Vertex Buffer Object)
glGenBuffers(1, &nbo); //create NBO (Normal Buffer Object)
glGenBuffers(1, &ibo); //create IBO (Index Buffer Object)
glBindVertexArray(vao); //bind the VAO so that it starts recording actions/calls.
glEnableVertexAttribArray(0); //Enable some shader Index (requires you to know that shader index 0 is for vertices)
glBindBuffer(GL_ARRAY_BUFFER, vbo); //Bind the VBO and fill it with model vertices
glBufferData(GL_ARRAY_BUFFER, vertices.size() * sizeof(vertices[0]), &vertices[0], GL_STATIC_DRAW);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 0, static_cast<void *>(0)); //Bind the vertices to shader index 0. 4 floats per vertex (X, Y, Z, W).
glBindBuffer(GL_ARRAY_BUFFER, 0); //Unbind the VBO.
glEnableVertexAttribArray(1); //Enable shader index 1 for normals.
glBindBuffer(GL_ARRAY_BUFFER, nbo); //Bind the NBO and fill it with normals.
glBufferData(GL_ARRAY_BUFFER, normals.size() * sizeof(normals[0]), &normals[0], GL_STATIC_DRAW);
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 0, static_cast<void *>(0)); //Bind the normals to shader index 1.. 3 floats per normal (X, Y, Z).
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo); //Bind the Index Buffer and fill it.
glBufferData(GL_ELEMENT_ARRAY_BUFFER, indices.size() * sizeof(indices[0]), &indices[0], GL_STATIC_DRAW);
glBindVertexArray(0); //Finished recording all calls..
The above will only happen ONCE (the first time the model loads).. Then when RS is ready to draw the model above (every frame AFTER the first time).. it will just do:
C++ Code:
glBindVertexArray(vao);
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);
glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_SHORT, static_cast<void *>(0));
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
glBindVertexArray(0);
The problem? One VAO can contain a lot of different models OR textures. If you don't copy the buffer upon initialization, you'd end up with a HUGE overhead of reading the buffer every time that model renders. It is harder to keep track of all of it AND keep track of each shader's IO.. You have to dis-assemble the shaders too. The whole thing is doable.. just tedious as hell.. In other words, nothing from the old plugins will work so it's a completely re-write (few weeks of work).
So why did no one look at Direct-X? RS also uses that and it's much easier to hook..
Anyway, GL to you OP (no pun intended). Seems you made quite the progress. Nice!