[core] Autogenerate Shader name

This commit is contained in:
Bruno de Oliveira Abinader
2016-06-18 15:32:49 +03:00
parent 760a692378
commit 76fc07c606
17 changed files with 42 additions and 60 deletions

View File

@@ -31,7 +31,7 @@ void VertexArrayObject::bindVertexArrayObject(gl::ObjectStore& store) {
MBGL_CHECK_ERROR(gl::BindVertexArray(*vao));
}
void VertexArrayObject::verifyBinding(Shader &shader, GLuint vertexBuffer, GLuint elementsBuffer,
void VertexArrayObject::verifyBinding(Shader& shader, GLuint vertexBuffer, GLuint elementsBuffer,
GLbyte *offset) {
if (bound_shader != shader.getID()) {
throw std::runtime_error(std::string("trying to rebind VAO to another shader from " +

View File

@@ -10,8 +10,6 @@
namespace mbgl {
class Shader;
class VertexArrayObject : public util::noncopyable {
public:
static void Unbind();
@@ -19,8 +17,8 @@ public:
VertexArrayObject();
~VertexArrayObject();
template <typename Shader, typename VertexBuffer>
void bind(Shader& shader, VertexBuffer &vertexBuffer, GLbyte *offset, gl::ObjectStore& store) {
template <typename VertexBuffer>
void bind(Shader& shader, VertexBuffer& vertexBuffer, GLbyte* offset, gl::ObjectStore& store) {
bindVertexArrayObject(store);
if (bound_shader == 0) {
vertexBuffer.bind(store);
@@ -33,8 +31,8 @@ public:
}
}
template <typename Shader, typename VertexBuffer, typename ElementsBuffer>
void bind(Shader& shader, VertexBuffer &vertexBuffer, ElementsBuffer &elementsBuffer, GLbyte *offset, gl::ObjectStore& store) {
template <typename VertexBuffer, typename ElementsBuffer>
void bind(Shader& shader, VertexBuffer& vertexBuffer, ElementsBuffer& elementsBuffer, GLbyte* offset, gl::ObjectStore& store) {
bindVertexArrayObject(store);
if (bound_shader == 0) {
vertexBuffer.bind(store);
@@ -62,7 +60,7 @@ private:
// For debug reasons, we're storing the bind information so that we can
// detect errors and report
GLuint bound_shader = 0;
const char *bound_shader_name = "";
const char* bound_shader_name = "";
GLuint bound_vertex_buffer = 0;
GLuint bound_elements_buffer = 0;
GLbyte *bound_offset = nullptr;