diff --git a/OpenGLEngine/SpriteBatch.h b/OpenGLEngine/SpriteBatch.h index bbf835f..03213a6 100644 --- a/OpenGLEngine/SpriteBatch.h +++ b/OpenGLEngine/SpriteBatch.h @@ -43,7 +43,6 @@ namespace charcoal glBindBuffer(GL_ARRAY_BUFFER, charcoal::Batch >::m_vertex_vbo); glEnableVertexAttribArray(0); glEnableVertexAttribArray(1); - // TODO: Figure out how to do this without offsetof :( glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(VertexType), (void*)position_offset); glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(VertexType), (void*)uv_offset); glBindBuffer(GL_ARRAY_BUFFER, charcoal::Batch >::m_element_buffers[0]); diff --git a/OpenGLEngine/TextureFactory.cpp b/OpenGLEngine/TextureFactory.cpp index 6c16aac..15aa4c1 100644 --- a/OpenGLEngine/TextureFactory.cpp +++ b/OpenGLEngine/TextureFactory.cpp @@ -2,6 +2,6 @@ namespace charcoal { - std::vector TextureFactory::m_textures; - std::vector TextureFactory::m_samplers; + std::list TextureFactory::m_textures; + std::list TextureFactory::m_samplers; } \ No newline at end of file diff --git a/OpenGLEngine/TextureFactory.h b/OpenGLEngine/TextureFactory.h index 2327e68..28e889c 100644 --- a/OpenGLEngine/TextureFactory.h +++ b/OpenGLEngine/TextureFactory.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include "ImageLoader.h" @@ -49,7 +49,7 @@ namespace charcoal } private: - static std::vector m_textures; - static std::vector m_samplers; + static std::list m_textures; + static std::list m_samplers; }; } diff --git a/OpenGLEngine/TexturedBatch.cpp b/OpenGLEngine/TexturedBatch.cpp index 1a8d479..41987ba 100644 --- a/OpenGLEngine/TexturedBatch.cpp +++ b/OpenGLEngine/TexturedBatch.cpp @@ -1,5 +1,7 @@ #include "TexturedBatch.h" +#include "Util.h" // CHECK_GL_ERR + namespace charcoal { namespace builtin @@ -10,7 +12,9 @@ namespace charcoal { glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, m_p_renderable->get_texture()->get_texture()); + CHECK_GL_ERR(); glBindSampler(0, m_p_renderable->get_sampler()->get_sampler()); + CHECK_GL_ERR(); } void Batch::setup_vao()