From e90eb349c71419e874f34f1ab122f57bebeacda7 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 5 Oct 2015 21:04:29 +0200 Subject: [PATCH] Support GL_RGB565 targets. --- resource_pool.cpp | 7 +++++++ version.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/resource_pool.cpp b/resource_pool.cpp index f82996e..240c3b2 100644 --- a/resource_pool.cpp +++ b/resource_pool.cpp @@ -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); diff --git a/version.h b/version.h index cdc5210..39df003 100644 --- 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) -- 2.39.2