From 30fc995a2dd2a371806b0c2a88fdf308f5a08d56 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 3 Feb 2016 14:07:59 +0100 Subject: [PATCH] Fix OpenGL ES luminance formats (which aren't deprecated in GLES) --- panda/src/glstuff/glGraphicsStateGuardian_src.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx index b58d7bed4f..72115a9137 100644 --- a/panda/src/glstuff/glGraphicsStateGuardian_src.cxx +++ b/panda/src/glstuff/glGraphicsStateGuardian_src.cxx @@ -8341,7 +8341,7 @@ get_external_image_format(Texture *tex) const { #endif case Texture::F_alpha: -#ifdef SUPPORT_FIXED_FUNCTION +#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES) return GL_ALPHA; #else return GL_RED; @@ -8386,7 +8386,7 @@ get_external_image_format(Texture *tex) const { case Texture::F_luminance: case Texture::F_sluminance: -#ifdef SUPPORT_FIXED_FUNCTION +#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES) return GL_LUMINANCE; #else return GL_RED; @@ -8394,7 +8394,7 @@ get_external_image_format(Texture *tex) const { case Texture::F_luminance_alphamask: case Texture::F_luminance_alpha: case Texture::F_sluminance_alpha: -#ifdef SUPPORT_FIXED_FUNCTION +#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES) return GL_LUMINANCE_ALPHA; #else return GL_RG; @@ -8967,14 +8967,14 @@ get_internal_image_format(Texture *tex, bool force_sized) const { #endif case Texture::F_alpha: -#ifdef SUPPORT_FIXED_FUNCTION +#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES) return force_sized ? GL_ALPHA8 : GL_ALPHA; #else return force_sized ? GL_R8 : GL_RED; #endif case Texture::F_luminance: -#ifdef SUPPORT_FIXED_FUNCTION +#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES) #ifndef OPENGLES if (tex->get_component_type() == Texture::T_float) { return GL_LUMINANCE16F_ARB; @@ -8992,7 +8992,7 @@ get_internal_image_format(Texture *tex, bool force_sized) const { #endif case Texture::F_luminance_alpha: case Texture::F_luminance_alphamask: -#ifdef SUPPORT_FIXED_FUNCTION +#if defined(SUPPORT_FIXED_FUNCTION) || defined(OPENGLES) #ifndef OPENGLES if (tex->get_component_type() == Texture::T_float || tex->get_component_type() == Texture::T_unsigned_short) { return GL_LUMINANCE_ALPHA16F_ARB; @@ -11531,7 +11531,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force, bool uses_mipmaps) { } #endif -#if !defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES_2) +#if !defined(SUPPORT_FIXED_FUNCTION) && !defined(OPENGLES) // Do we need to apply a swizzle mask to emulate these deprecated // texture formats? switch (tex->get_format()) {