From d1e511efcb073fe6d72759b4ac928d06b2bb1847 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Wed, 15 Jul 2015 15:52:12 -0700 Subject: [PATCH] more naked gl cleanup, deleting dead code, tweaking comments so they don't give false positives in searching for more naked gl --- interface/src/ui/overlays/Cube3DOverlay.cpp | 2 -- libraries/gpu/src/gpu/Batch.h | 4 ++-- libraries/gpu/src/gpu/Shader.h | 2 +- libraries/render-utils/src/TextRenderer.cpp | 3 --- libraries/render-utils/src/TextureCache.cpp | 10 ---------- libraries/shared/src/Transform.h | 8 ++++---- 6 files changed, 7 insertions(+), 22 deletions(-) diff --git a/interface/src/ui/overlays/Cube3DOverlay.cpp b/interface/src/ui/overlays/Cube3DOverlay.cpp index 3455ce2e51..7f6fd5f971 100644 --- a/interface/src/ui/overlays/Cube3DOverlay.cpp +++ b/interface/src/ui/overlays/Cube3DOverlay.cpp @@ -33,8 +33,6 @@ void Cube3DOverlay::render(RenderArgs* args) { const float MAX_COLOR = 255.0f; glm::vec4 cubeColor(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha); - //glDisable(GL_LIGHTING); - // TODO: handle registration point?? glm::vec3 position = getPosition(); glm::vec3 center = getCenter(); diff --git a/libraries/gpu/src/gpu/Batch.h b/libraries/gpu/src/gpu/Batch.h index bf6883e3a9..244ede7151 100644 --- a/libraries/gpu/src/gpu/Batch.h +++ b/libraries/gpu/src/gpu/Batch.h @@ -86,7 +86,7 @@ public: // Then by the inverse of the ViewTransform from world space to eye space // finaly projected into the clip space by the projection transform // WARNING: ViewTransform transform from eye space to world space, its inverse is composed - // with the ModelTransformu to create the equivalent of the glModelViewMatrix + // with the ModelTransform to create the equivalent of the gl ModelViewMatrix void setModelTransform(const Transform& model); void setViewTransform(const Transform& view); void setProjectionTransform(const Mat4& proj); @@ -114,7 +114,7 @@ public: // TODO: As long as we have gl calls explicitely issued from interface // code, we need to be able to record and batch these calls. THe long // term strategy is to get rid of any GL calls in favor of the HIFI GPU API - // For now, instead of calling the raw glCall, use the equivalent call on the batch so the call is beeing recorded + // For now, instead of calling the raw gl Call, use the equivalent call on the batch so the call is beeing recorded // THe implementation of these functions is in GLBackend.cpp void _glEnable(GLenum cap); diff --git a/libraries/gpu/src/gpu/Shader.h b/libraries/gpu/src/gpu/Shader.h index 9193ddb778..9c3953bff5 100755 --- a/libraries/gpu/src/gpu/Shader.h +++ b/libraries/gpu/src/gpu/Shader.h @@ -148,7 +148,7 @@ public: // // As of now (03/2015), the call to makeProgram is in fact calling gpu::Context::makeProgram and does rely // on the underneath gpu::Context::Backend available. Since we only support glsl, this means that it relies - // on a glContext and the driver to compile the glsl shader. + // on a gl Context and the driver to compile the glsl shader. // Hoppefully in a few years the shader compilation will be completely abstracted in a separate shader compiler library // independant of the graphics api in use underneath (looking at you opengl & vulkan). static bool makeProgram(Shader& shader, const Shader::BindingSet& bindings = Shader::BindingSet()); diff --git a/libraries/render-utils/src/TextRenderer.cpp b/libraries/render-utils/src/TextRenderer.cpp index fcd7bf2f2a..61a7ce78cf 100644 --- a/libraries/render-utils/src/TextRenderer.cpp +++ b/libraries/render-utils/src/TextRenderer.cpp @@ -504,9 +504,6 @@ glm::vec2 Font::drawString(float x, float y, const QString & str, _vao->release(); _texture->release(); // TODO: Brad & Sam, let's discuss this. Without this non-textured quads get their colors borked. _program->release(); - // FIXME, needed? - // glDisable(GL_TEXTURE_2D); - return advance; } diff --git a/libraries/render-utils/src/TextureCache.cpp b/libraries/render-utils/src/TextureCache.cpp index 4df9718e24..953cfda910 100644 --- a/libraries/render-utils/src/TextureCache.cpp +++ b/libraries/render-utils/src/TextureCache.cpp @@ -110,9 +110,6 @@ const gpu::TexturePointer& TextureCache::getPermutationNormalTexture() { _permutationNormalTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC3, gpu::UINT8, gpu::RGB), 256, 2)); _permutationNormalTexture->assignStoredMip(0, _blueTexture->getTexelFormat(), sizeof(data), data); - - // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - // glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); } return _permutationNormalTexture; } @@ -122,13 +119,6 @@ const unsigned char OPAQUE_GRAY[] = { 0x80, 0x80, 0x80, 0xFF }; const unsigned char OPAQUE_BLUE[] = { 0x80, 0x80, 0xFF, 0xFF }; const unsigned char OPAQUE_BLACK[] = { 0x00, 0x00, 0x00, 0xFF }; -/* -static void loadSingleColorTexture(const unsigned char* color) { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, color); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -} -*/ - const gpu::TexturePointer& TextureCache::getWhiteTexture() { if (!_whiteTexture) { _whiteTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::UINT8, gpu::RGBA), 1, 1)); diff --git a/libraries/shared/src/Transform.h b/libraries/shared/src/Transform.h index 6f841151c4..09cb3ba65b 100644 --- a/libraries/shared/src/Transform.h +++ b/libraries/shared/src/Transform.h @@ -87,20 +87,20 @@ public: const Vec3& getTranslation() const; void setTranslation(const Vec3& translation); // [new this] = [translation] * [this.rotation] * [this.scale] void preTranslate(const Vec3& translation); // [new this] = [translation] * [this] - void postTranslate(const Vec3& translation); // [new this] = [this] * [translation] equivalent to glTranslate + void postTranslate(const Vec3& translation); // [new this] = [this] * [translation] equivalent to gl Translate const Quat& getRotation() const; void setRotation(const Quat& rotation); // [new this] = [this.translation] * [rotation] * [this.scale] void preRotate(const Quat& rotation); // [new this] = [rotation] * [this] - void postRotate(const Quat& rotation); // [new this] = [this] * [rotation] equivalent to glRotate + void postRotate(const Quat& rotation); // [new this] = [this] * [rotation] equivalent to gl Rotate const Vec3& getScale() const; void setScale(float scale); void setScale(const Vec3& scale); // [new this] = [this.translation] * [this.rotation] * [scale] void preScale(float scale); void preScale(const Vec3& scale); - void postScale(float scale); // [new this] = [this] * [scale] equivalent to glScale - void postScale(const Vec3& scale); // [new this] = [this] * [scale] equivalent to glScale + void postScale(float scale); // [new this] = [this] * [scale] equivalent to gl Scale + void postScale(const Vec3& scale); // [new this] = [this] * [scale] equivalent to gl Scale bool isIdentity() const { return (_flags & ~Flags(FLAG_CACHE_INVALID_BITSET)).none(); } bool isTranslating() const { return _flags[FLAG_TRANSLATION]; }