Add support for ECF_A16B16G16R16F and ECF_A32B32G32R32F color formats for es2.

Use emscripten headers now for es2 when compiling with emscripten (instead of our own extension headers).
Try enabling es2 extensions for emscripten (compiles, but not yet tested)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5527 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-08-23 14:56:35 +00:00
parent e4b8e7210f
commit c20dc5cc6f
3 changed files with 25 additions and 3 deletions

View File

@ -267,7 +267,7 @@ define out. */
//! Define required options for OpenGL ES 2.0 drivers.
#if defined(_IRR_COMPILE_WITH_OGLES2_)
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
#if defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) || defined(_IRR_COMPILE_WITH_X11_DEVICE_) || defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_) || defined(__EMSCRIPTEN__)
#define _IRR_OGLES2_USE_EXTPOINTER_
#ifndef _IRR_COMPILE_WITH_EGL_MANAGER_
#define _IRR_COMPILE_WITH_EGL_MANAGER_

View File

@ -16,6 +16,10 @@
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <EGL/eglplatform.h>
#elif defined(_IRR_EMSCRIPTEN_PLATFORM_)
#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <EGL/eglplatform.h>
#else
#if defined(_IRR_OGLES2_USE_EXTPOINTER_)
#define GL_GLEXT_PROTOTYPES 1

View File

@ -2867,7 +2867,16 @@ COGLES2Driver::~COGLES2Driver()
os::Printer::log("ECF_G16R16F color format is not supported", ELL_ERROR);
break;
case ECF_A16B16G16R16F:
os::Printer::log("ECF_A16B16G16R16F color format is not supported", ELL_ERROR);
#if defined(GL_OES_texture_half_float)
if (queryOpenGLFeature(COGLESCoreExtensionHandler::IRR_GL_OES_texture_half_float))
{
supported = true;
pixelFormat = GL_RGBA;
pixelType = GL_HALF_FLOAT_OES ;
}
else
#endif
os::Printer::log("ECF_A16B16G16R16F color format is not supported", ELL_ERROR);
break;
case ECF_R32F:
#if defined(GL_OES_texture_float) && defined(GL_EXT_texture_rg)
@ -2898,7 +2907,16 @@ COGLES2Driver::~COGLES2Driver()
os::Printer::log("ECF_G32R32F color format is not supported", ELL_ERROR);
break;
case ECF_A32B32G32R32F:
os::Printer::log("ECF_A32B32G32R32F color format is not supported", ELL_ERROR);
#if defined(GL_OES_texture_float)
if (queryOpenGLFeature(COGLESCoreExtensionHandler::IRR_GL_OES_texture_half_float))
{
supported = true;
pixelFormat = GL_RGBA;
pixelType = GL_FLOAT ;
}
else
#endif
os::Printer::log("ECF_A32B32G32R32F color format is not supported", ELL_ERROR);
break;
default:
os::Printer::log("Unsupported texture format", ELL_ERROR);