Support GL_RGB565 targets.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 5 Oct 2015 19:04:29 +0000 (21:04 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 5 Oct 2015 19:04:29 +0000 (21:04 +0200)
resource_pool.cpp
version.h

index f82996e..240c3b2 100644 (file)
@@ -224,6 +224,7 @@ GLuint ResourcePool::create_2d_texture(GLint internal_format, GLsizei width, GLs
        case GL_RGB16F:
        case GL_RGB8:
        case GL_SRGB8:
+       case GL_RGB565:
                format = GL_RGB;
                break;
        case GL_RG32F:
@@ -262,6 +263,9 @@ GLuint ResourcePool::create_2d_texture(GLint internal_format, GLsizei width, GLs
        case GL_R8:
                type = GL_UNSIGNED_BYTE;
                break;
+       case GL_RGB565:
+               type = GL_UNSIGNED_SHORT_5_6_5;
+               break;
        default:
                // TODO: Add more here as needed.
                assert(false);
@@ -510,6 +514,9 @@ size_t ResourcePool::estimate_texture_size(const Texture2D &texture_format)
        case GL_R8:
                bytes_per_pixel = 1;
                break;
+       case GL_RGB565:
+               bytes_per_pixel = 2;
+               break;
        default:
                // TODO: Add more here as needed.
                assert(false);
index cdc5210..39df003 100644 (file)
--- a/version.h
+++ b/version.h
@@ -5,6 +5,6 @@
 // changes, even within git versions. There is no specific version
 // documentation outside the regular changelogs, though.
 
-#define MOVIT_VERSION 9
+#define MOVIT_VERSION 10
 
 #endif // !defined(_MOVIT_VERSION_H)