瀏覽代碼

Rename namespace

Sam Jaffe 6 年之前
父節點
當前提交
fed6fbd6bc
共有 3 個文件被更改,包括 9 次插入10 次删除
  1. 2 3
      graphics/src/helper.hpp
  2. 2 2
      graphics/src/opengl_helper.cxx
  3. 5 5
      graphics/src/texture.cpp

+ 2 - 3
graphics/src/helper.hpp

@@ -13,8 +13,7 @@
 
 #include "game/math/math_fwd.hpp"
 
-namespace graphics { namespace detail { namespace texture {
+namespace graphics { namespace textures {
   enum class format { RGB, RGBA };
-
   unsigned int init(format, math::vec2i, unsigned char *);
-}}}
+}}

+ 2 - 2
graphics/src/opengl_helper.cxx

@@ -14,7 +14,7 @@
 
 #include "vector/vector.hpp"
 
-namespace graphics { namespace detail { namespace texture {
+namespace graphics { namespace textures {
   static int glfmt(format color_fmt) {
     switch (color_fmt) {
     case format::RGB:
@@ -89,4 +89,4 @@ namespace graphics { namespace detail { namespace texture {
 
     return id;
   }
-}}}
+}}

+ 5 - 5
graphics/src/texture.cpp

@@ -25,12 +25,12 @@ namespace {
 }
 
 namespace graphics {
-  static detail::texture::format format(int comps) {
+  static textures::format format(int comps) {
     switch (comps) {
     case 3:
-      return detail::texture::format::RGB;
+      return textures::format::RGB;
     case 4:
-      return detail::texture::format::RGBA;
+      return textures::format::RGBA;
     default:
       throw;
     }
@@ -44,12 +44,12 @@ namespace graphics {
     unsigned char * data =
         stbi_load(imagefile.c_str(), &size.x(), &size.y(), &components, 0);
     scope(exit) { stbi_image_free(data); };
-    texture tex{detail::texture::init(format(components), size, data), size};
+    texture tex{textures::init(format(components), size, data), size};
     return g_textures.emplace(imagefile, std::move(tex)).first->second;
   }
 
   texture texture::create(unsigned char * data, math::vec2i size) {
-    return {detail::texture::init(format(4), size, data), size};
+    return {textures::init(format(4), size, data), size};
   }
 
   texture::texture(unsigned int id, math::vec2i sz)