فهرست منبع

Cleanup dead code.

Sam Jaffe 6 سال پیش
والد
کامیت
6ed7e30bc9
2فایلهای تغییر یافته به همراه0 افزوده شده و 61 حذف شده
  1. 0 10
      graphics/src/helper.hpp
  2. 0 51
      graphics/src/openGL/opengl_manager.cxx

+ 0 - 10
graphics/src/helper.hpp

@@ -16,7 +16,6 @@
 #include "vector/vector.hpp"
 
 namespace graphics {
-  struct uniform;
   namespace textures {
     enum class format : unsigned int { RGB, RGBA };
     struct external_data {
@@ -26,21 +25,12 @@ namespace graphics {
       math::vec2i size;
       void * buffer;
     };
-    unsigned int init(format, math::vec2i, void const *);
   }
   namespace shaders {
     enum class type : unsigned int { FRAGMENT, VERTEX };
-    unsigned int init(type, std::string const &);
-    unsigned int init(identity<shader> const & fragmentShader,
-                      identity<shader> const & vertexShader);
-    void activate(identity<shader_program> id);
-    int uniform_location(identity<shader_program> id,
-                         std::string const & uniform);
   }
   namespace materials {
     enum class uniform : unsigned int { NORMAL, DIFFUSE, SPECULAR };
-    void activate(identity<shader_program> program,
-                  std::vector<graphics::uniform> const & uniforms);
   }
 }
 

+ 0 - 51
graphics/src/openGL/opengl_manager.cxx

@@ -214,54 +214,3 @@ opengl_uniform_data & opengl_manager::data(identity<shader_program> program) {
   }
   return data;
 }
-
-namespace graphics { namespace shaders {
-  void activate(identity<shader_program> program) {
-    // 100. Use the shader program ID to "turn it on" for all subsequent drawing
-    glUseProgram(program.id);
-
-    /*
-     // 101. Enable texturing and Bind texture(s) to GPU texture units
-     glActiveTexture(GL_TEXTURE3);
-     glEnable(GL_TEXTURE_2D);
-     glBindTexture(GL_TEXTURE_2D, emissiveTextureID);
-
-     glActiveTexture(GL_TEXTURE2);
-     glEnable(GL_TEXTURE_2D);
-     glBindTexture(GL_TEXTURE_2D, specularTextureID);
-
-     glActiveTexture(GL_TEXTURE1);
-     glEnable(GL_TEXTURE_2D);
-     glBindTexture(GL_TEXTURE_2D, normalTextureID);
-
-     glActiveTexture(GL_TEXTURE0);
-     glEnable(GL_TEXTURE_2D);
-     glBindTexture(GL_TEXTURE_2D, diffuseTextureID);
-     */
-
-    // 102. Get the location # of each named uniform you wish to pass in to the
-    // shader
-    int timeUniformLocation = glGetUniformLocation(program.id, "u_time");
-    int scale = glGetUniformLocation(program.id, "Scale");
-    int diffuseMap = glGetUniformLocation(program.id, "u_diffuseMap");
-    int normalMap = glGetUniformLocation(program.id, "u_normalMap");
-    int specularMap = glGetUniformLocation(program.id, "u_specularMap");
-    int emissiveMap = glGetUniformLocation(program.id, "u_emissiveMap");
-    int debugWave = glGetUniformLocation(program.id, "g_debugWave");
-
-    // 103. Set the uniform values, including the texture unit numbers for
-    // texture (sampler) uniforms
-    // Env::GetCurrentTimeSeconds()
-    glUniform1f(timeUniformLocation, env::clock::current_time<float>());
-    glUniform1f(scale, 2.f);
-    glUniform1i(debugWave, 1); // TODO: m_waveEffectOn in ShaderProgram??
-    // for GL_TEXTURE0, texture unit 0
-    glUniform1i(diffuseMap, 0);
-    // for GL_TEXTURE1, texture unit 1
-    glUniform1i(normalMap, 1);
-    // for GL_TEXTURE2, texture unit 2
-    glUniform1i(specularMap, 2);
-    // for GL_TEXTURE3, texture unit 3
-    glUniform1i(emissiveMap, 3);
-  }
-}}