diff --git a/libraries/gpu/src/gpu/Batch.h b/libraries/gpu/src/gpu/Batch.h index b91dea6b05..405ea9459d 100644 --- a/libraries/gpu/src/gpu/Batch.h +++ b/libraries/gpu/src/gpu/Batch.h @@ -157,6 +157,7 @@ public: void _glDisableVertexAttribArray(GLint location); void _glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); + void _glLineWidth(GLfloat width); enum Command { COMMAND_draw = 0, @@ -216,6 +217,7 @@ public: COMMAND_glDisableVertexAttribArray, COMMAND_glColor4f, + COMMAND_glLineWidth, NUM_COMMANDS, }; diff --git a/libraries/gpu/src/gpu/GLBackend.cpp b/libraries/gpu/src/gpu/GLBackend.cpp index c26564a338..da6979fb27 100644 --- a/libraries/gpu/src/gpu/GLBackend.cpp +++ b/libraries/gpu/src/gpu/GLBackend.cpp @@ -66,8 +66,9 @@ GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] = (&::gpu::GLBackend::do_glEnableVertexAttribArray), (&::gpu::GLBackend::do_glDisableVertexAttribArray), - + (&::gpu::GLBackend::do_glColor4f), + (&::gpu::GLBackend::do_glLineWidth), }; GLBackend::GLBackend() : @@ -566,6 +567,18 @@ void GLBackend::do_glColor4f(Batch& batch, uint32 paramOffset) { (void) CHECK_GL_ERROR(); } +void Batch::_glLineWidth(GLfloat width) { + ADD_COMMAND_GL(glLineWidth); + + _params.push_back(width); + + DO_IT_NOW(_glLineWidth, 1); +} +void GLBackend::do_glLineWidth(Batch& batch, uint32 paramOffset) { + glLineWidth(batch._params[paramOffset]._float); + (void) CHECK_GL_ERROR(); +} + void GLBackend::loadMatrix(GLenum target, const glm::mat4 & m) { glMatrixMode(target); glLoadMatrixf(glm::value_ptr(m)); diff --git a/libraries/gpu/src/gpu/GLBackend.h b/libraries/gpu/src/gpu/GLBackend.h index d1ba7714e9..5e3177c6ea 100644 --- a/libraries/gpu/src/gpu/GLBackend.h +++ b/libraries/gpu/src/gpu/GLBackend.h @@ -370,8 +370,9 @@ protected: void do_glEnableVertexAttribArray(Batch& batch, uint32 paramOffset); void do_glDisableVertexAttribArray(Batch& batch, uint32 paramOffset); - + void do_glColor4f(Batch& batch, uint32 paramOffset); + void do_glLineWidth(Batch& batch, uint32 paramOffset); typedef void (GLBackend::*CommandCall)(Batch&, uint32); static CommandCall _commandCalls[Batch::NUM_COMMANDS];