From 250e30d73f09e9da2b5a81d0fbae63744ae12a73 Mon Sep 17 00:00:00 2001 From: chai Date: Tue, 2 Apr 2019 08:47:15 +0800 Subject: *misc --- source/modules/asura-core/graphics/texture.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'source/modules/asura-core/graphics/texture.cpp') diff --git a/source/modules/asura-core/graphics/texture.cpp b/source/modules/asura-core/graphics/texture.cpp index c260ce9..4db6ad3 100644 --- a/source/modules/asura-core/graphics/texture.cpp +++ b/source/modules/asura-core/graphics/texture.cpp @@ -22,5 +22,24 @@ namespace AsuraEngine return mTex; } + TextureFormat Texture::ConvertColorFormat(const ColorFormat& colorformat) + { + TextureFormat t; + switch (colorformat) + { + case COLOR_FORMAT_RGBA8: + t.internalformat = GL_RGBA8; + t.externalformat = GL_RGBA; + t.type = GL_UNSIGNED_BYTE; + break; + case COLOR_FORMAT_RGBA32F: + t.internalformat = GL_RGBA32F; + t.externalformat = GL_RGBA; + t.type = GL_FLOAT; + break; + } + return t; + } + } } \ No newline at end of file -- cgit v1.1-26-g67d0