]> git.sesse.net Git - movit/commitdiff
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 f82996e4d24d13081f4f3dfbd981cea6e891fb49..240c3b2c58b332d3b2a02b7fbff8cde5bfe206b2 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 cdc5210b336e662eb409d8586584541c9903d9c0..39df0035a8594219aab5c6fa1ec5143ab0a44ef8 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)