Avoiding temp variable reference to appease mac and fixing a warning

This commit is contained in:
Sam Cake 2017-04-15 00:45:50 -07:00
parent 96960a505d
commit 038d01ce04
3 changed files with 6 additions and 5 deletions

View file

@ -17,9 +17,9 @@
namespace gl { namespace gl {
#ifdef SEPARATE_PROGRAM #ifdef SEPARATE_PROGRAM
bool compileShader(GLenum shaderDomain, const std::string& shaderSource, const std::string& defines, GLuint &shaderObject, GLuint &programObject, std::string& error = std::string()); bool compileShader(GLenum shaderDomain, const std::string& shaderSource, const std::string& defines, GLuint &shaderObject, GLuint &programObject, std::string& error);
#else #else
bool compileShader(GLenum shaderDomain, const std::string& shaderSource, const std::string& defines, GLuint &shaderObject, std::string& error = std::string()); bool compileShader(GLenum shaderDomain, const std::string& shaderSource, const std::string& defines, GLuint &shaderObject, std::string& error);
#endif #endif
GLuint compileProgram(const std::vector<GLuint>& glshaders, std::string& error = std::string()); GLuint compileProgram(const std::vector<GLuint>& glshaders, std::string& error = std::string());

View file

@ -165,7 +165,7 @@ void DrawBounds::run(const SceneContextPointer& sceneContext, const RenderContex
const Inputs& items) { const Inputs& items) {
RenderArgs* args = renderContext->args; RenderArgs* args = renderContext->args;
auto numItems = items.size(); uint32_t numItems = (uint32_t) items.size();
if (numItems == 0) { if (numItems == 0) {
return; return;
} }

View file

@ -196,8 +196,9 @@ public:
std::string vsSource = HMD_REPROJECTION_VERT; std::string vsSource = HMD_REPROJECTION_VERT;
std::string fsSource = HMD_REPROJECTION_FRAG; std::string fsSource = HMD_REPROJECTION_FRAG;
GLuint vertexShader { 0 }, fragmentShader { 0 }; GLuint vertexShader { 0 }, fragmentShader { 0 };
::gl::compileShader(GL_VERTEX_SHADER, vsSource, "", vertexShader); std::string error;
::gl::compileShader(GL_FRAGMENT_SHADER, fsSource, "", fragmentShader); ::gl::compileShader(GL_VERTEX_SHADER, vsSource, "", vertexShader, error);
::gl::compileShader(GL_FRAGMENT_SHADER, fsSource, "", fragmentShader, error);
_program = ::gl::compileProgram({ { vertexShader, fragmentShader } }); _program = ::gl::compileProgram({ { vertexShader, fragmentShader } });
glDeleteShader(vertexShader); glDeleteShader(vertexShader);
glDeleteShader(fragmentShader); glDeleteShader(fragmentShader);