Simplify #ifdef's a bit
This commit is contained in:
parent
742fb309df
commit
c07472cf38
@ -195,7 +195,7 @@ LOCAL_SRC_FILES := $(wildcard jni/src/*.cpp) $(wildcard jni/src/*/*.cpp) $(wildc
|
||||
LOCAL_PATH:=.
|
||||
LOCAL_MODULE := stk
|
||||
LOCAL_LDLIBS := -llog -landroid -lEGL -lGLESv1_CM -lGLESv2 -lGLESv3
|
||||
LOCAL_CFLAGS := -Ijni/irrlicht/source/Irrlicht/ -Ijni/irrlicht/include/ -Ijni/jpeglib/ -Ijni/libpng/ -Ijni/ -Iinclude/ -I$(call my-dir)/../../sources/android/native_app_glue/ -DBUILD_OGLES2 -DNO_IRR_COMPILE_WITH_SOFTWARE_ -DNO_IRR_COMPILE_WITH_BURNINGSVIDEO_ -DSUPERTUXKART_DATADIR=\"/sdcard/stk/\" -DANDROID_DEVICE -DANDROID -Ijni/src/ -Ijni/bullet/src -DNO_CURL -std=c++11 -Iobj/freetype/freetype/include/freetype2/ -Ijni/enet/include/ -Ijni/angelscript/include/ -DDEBUG -DNO_SOUND -DGLEW_NO_GLU -Ijni/ifaddrs
|
||||
LOCAL_CFLAGS := -Ijni/irrlicht/source/Irrlicht/ -Ijni/irrlicht/include/ -Ijni/jpeglib/ -Ijni/libpng/ -Ijni/ -Iinclude/ -I$(call my-dir)/../../sources/android/native_app_glue/ -DBUILD_OGLES2 -DNO_IRR_COMPILE_WITH_SOFTWARE_ -DNO_IRR_COMPILE_WITH_BURNINGSVIDEO_ -DSUPERTUXKART_DATADIR=\"/sdcard/stk/\" -DUSE_GLES2 -DANDROID -Ijni/src/ -Ijni/bullet/src -DNO_CURL -std=c++11 -Iobj/freetype/freetype/include/freetype2/ -Ijni/enet/include/ -Ijni/angelscript/include/ -DDEBUG -DNO_SOUND -DGLEW_NO_GLU -Ijni/ifaddrs
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := irrlicht
|
||||
LOCAL_STATIC_LIBRARIES := bullet enet freetype ifaddrs angelscript
|
||||
|
@ -447,11 +447,7 @@ namespace UserConfigParams
|
||||
PARAM_DEFAULT( IntUserConfigParam(120, "max_fps",
|
||||
&m_video_group, "Maximum fps, should be at least 60") );
|
||||
PARAM_PREFIX BoolUserConfigParam m_force_legacy_device
|
||||
#ifndef ANDROID
|
||||
PARAM_DEFAULT(BoolUserConfigParam(false, "force_legacy_device",
|
||||
#else
|
||||
PARAM_DEFAULT(BoolUserConfigParam(true, "force_legacy_device",
|
||||
#endif
|
||||
&m_video_group, "Force OpenGL 2 context, even if OpenGL 3 is available."));
|
||||
|
||||
PARAM_PREFIX BoolUserConfigParam m_texture_compression
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "glwrap.hpp"
|
||||
#include "utils/cpp2011.hpp"
|
||||
|
||||
#if defined(ANDROID) || defined(USE_GLES2)
|
||||
#if defined(USE_GLES2)
|
||||
# define _IRR_COMPILE_WITH_OGLES2_
|
||||
# include "../../lib/irrlicht/source/Irrlicht/COGLES2Texture.h"
|
||||
#else
|
||||
@ -184,7 +184,7 @@ static void drawTexColoredQuad(const video::ITexture *texture,
|
||||
ColoredTextureRectShader::getInstance()->use();
|
||||
glBindVertexArray(ColoredTextureRectShader::getInstance()->m_vao);
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
const irr::video::COpenGLTexture *t =
|
||||
static_cast<const irr::video::COpenGLTexture*>(texture);
|
||||
#else
|
||||
@ -322,7 +322,7 @@ void draw2DImage(const video::ITexture* texture,
|
||||
UniformColoredTextureRectShader::getInstance()->use();
|
||||
glBindVertexArray(SharedGPUObjects::getUI_VAO());
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
const video::COpenGLTexture *c_texture =
|
||||
static_cast<const video::COpenGLTexture*>(texture);
|
||||
#else
|
||||
@ -439,7 +439,7 @@ void draw2DImage(const video::ITexture* texture,
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
const video::COpenGLTexture *c_texture =
|
||||
static_cast<const video::COpenGLTexture*>(texture);
|
||||
#else
|
||||
|
@ -68,10 +68,10 @@ void CentralVideoSettings::init()
|
||||
Log::info("IrrDriver", "OpenGL renderer: %s", glGetString(GL_RENDERER));
|
||||
Log::info("IrrDriver", "OpenGL version string: %s", glGetString(GL_VERSION));
|
||||
}
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
m_glsl = (m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version >= 1))
|
||||
&& !UserConfigParams::m_force_legacy_device;
|
||||
#elif !defined(ANDROID)
|
||||
#else
|
||||
m_glsl = m_gl_major_version >= 3 && !UserConfigParams::m_force_legacy_device;
|
||||
#endif
|
||||
if (!ProfileWorld::isNoGraphics())
|
||||
@ -83,7 +83,7 @@ void CentralVideoSettings::init()
|
||||
std::string card((char*)(glGetString(GL_RENDERER)));
|
||||
GraphicsRestrictions::init(driver, card);
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (hasGLExtension("GL_AMD_vertex_shader_layer")) {
|
||||
hasVSLayer = true;
|
||||
Log::info("GLDriver", "AMD Vertex Shader Layer Present");
|
||||
|
@ -21,7 +21,7 @@
|
||||
#define GLEW_STATIC
|
||||
|
||||
extern "C" {
|
||||
#if !defined(ANDROID_DEVICE) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
# include <GL/glew.h>
|
||||
#endif
|
||||
}
|
||||
@ -40,7 +40,7 @@ extern "C" {
|
||||
# ifndef GL_TEXTURE_SWIZZLE_RGBA
|
||||
# define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
|
||||
# endif
|
||||
#elif defined(ANDROID_DEVICE) || defined(USE_GLES2)
|
||||
#elif defined(USE_GLES2)
|
||||
# include <GLES3/gl3.h>
|
||||
# include <GLES3/gl3ext.h>
|
||||
# include <GLES2/gl2ext.h>
|
||||
@ -55,12 +55,10 @@ extern "C" {
|
||||
# include <GL/glext.h>
|
||||
#endif
|
||||
|
||||
#if defined(ANDROID) || defined(USE_GLES2)
|
||||
#if defined(USE_GLES2)
|
||||
#define GL_BGRA 0x80E1
|
||||
#define GL_BGR 0x80E0
|
||||
#endif
|
||||
|
||||
#if defined(USE_GLES2)
|
||||
#define GL_FRAMEBUFFER_COMPLETE_EXT GL_FRAMEBUFFER_COMPLETE
|
||||
#define GL_TEXTURE_BUFFER GL_TEXTURE_BUFFER_EXT
|
||||
#define GL_FRAMEBUFFER_SRGB GL_FRAMEBUFFER_SRGB_EXT
|
||||
|
@ -94,7 +94,7 @@ bool GLContextDebugBit = false;
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
#if !defined(__APPLE__) && !defined(ANDROID)
|
||||
#if !defined(__APPLE__)
|
||||
#define ARB_DEBUG_OUTPUT
|
||||
#endif
|
||||
#endif
|
||||
@ -188,7 +188,7 @@ void initGL()
|
||||
return;
|
||||
is_gl_init = true;
|
||||
// For Mesa extension reporting
|
||||
#if !defined(ANDROID_DEVICE) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
#ifndef WIN32
|
||||
glewExperimental = GL_TRUE;
|
||||
#endif
|
||||
@ -267,7 +267,7 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h,
|
||||
{
|
||||
glGenFramebuffers(1, &fbo);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (layered)
|
||||
{
|
||||
for (unsigned i = 0; i < RTTs.size(); i++)
|
||||
@ -279,10 +279,8 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h,
|
||||
for (unsigned i = 0; i < RTTs.size(); i++)
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, RTTs[i], 0);
|
||||
}
|
||||
#ifndef ANDROID
|
||||
//~ GLenum result = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
//~ assert(result == GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||
#endif
|
||||
}
|
||||
|
||||
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w,
|
||||
@ -292,7 +290,7 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w,
|
||||
{
|
||||
glGenFramebuffers(1, &fbo);
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (layered)
|
||||
{
|
||||
for (unsigned i = 0; i < RTTs.size(); i++)
|
||||
@ -306,12 +304,10 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w,
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, RTTs[i], 0);
|
||||
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, DS, 0);
|
||||
}
|
||||
#ifndef ANDROID
|
||||
//~ GLenum result = glCheckFramebufferStatus(GL_FRAMEBUFFER);
|
||||
//~ assert(result == GL_FRAMEBUFFER_COMPLETE_EXT);
|
||||
if (layered)
|
||||
glGenFramebuffers(1, &fbolayer);
|
||||
#endif
|
||||
}
|
||||
|
||||
FrameBuffer::~FrameBuffer()
|
||||
|
@ -182,7 +182,6 @@ void ParticleSystemProxy::setFlip()
|
||||
void ParticleSystemProxy::setHeightmap(const std::vector<std::vector<float> > &hm,
|
||||
float f1, float f2, float f3, float f4)
|
||||
{
|
||||
#ifndef ANDROID
|
||||
track_x = f1, track_z = f2, track_x_len = f3, track_z_len = f4;
|
||||
|
||||
unsigned width = (unsigned)hm.size();
|
||||
@ -205,7 +204,6 @@ void ParticleSystemProxy::setHeightmap(const std::vector<std::vector<float> > &h
|
||||
glBindBuffer(GL_TEXTURE_BUFFER, 0);
|
||||
|
||||
delete[] hm_array;
|
||||
#endif
|
||||
}
|
||||
|
||||
static
|
||||
@ -412,7 +410,6 @@ void ParticleSystemProxy::cleanGL()
|
||||
|
||||
void ParticleSystemProxy::CommonRenderingVAO(GLuint PositionBuffer)
|
||||
{
|
||||
#ifndef ANDROID
|
||||
glBindBuffer(GL_ARRAY_BUFFER, SharedGPUObjects::getParticleQuadVBO());
|
||||
glEnableVertexAttribArray(4);
|
||||
glVertexAttribPointer(4, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
|
||||
@ -429,12 +426,10 @@ void ParticleSystemProxy::CommonRenderingVAO(GLuint PositionBuffer)
|
||||
glEnableVertexAttribArray(2);
|
||||
glVertexAttribPointer(2, 1, GL_FLOAT, GL_FALSE, sizeof(ParticleData), (GLvoid *)(7 * sizeof(float)));
|
||||
glVertexAttribDivisorARB(2, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ParticleSystemProxy::AppendQuaternionRenderingVAO(GLuint QuaternionBuffer)
|
||||
{
|
||||
#ifndef ANDROID
|
||||
glBindBuffer(GL_ARRAY_BUFFER, QuaternionBuffer);
|
||||
glEnableVertexAttribArray(5);
|
||||
|
||||
@ -444,12 +439,10 @@ void ParticleSystemProxy::AppendQuaternionRenderingVAO(GLuint QuaternionBuffer)
|
||||
glEnableVertexAttribArray(6);
|
||||
glVertexAttribPointer(6, 1, GL_FLOAT, GL_FALSE, 4 * sizeof(float), (GLvoid *)(3 * sizeof(float)));
|
||||
glVertexAttribDivisorARB(6, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ParticleSystemProxy::CommonSimulationVAO(GLuint position_vbo, GLuint initialValues_vbo)
|
||||
{
|
||||
#ifndef ANDROID
|
||||
glBindBuffer(GL_ARRAY_BUFFER, position_vbo);
|
||||
glEnableVertexAttribArray(0);
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(ParticleSystemProxy::ParticleData), (GLvoid*)0);
|
||||
@ -469,12 +462,10 @@ void ParticleSystemProxy::CommonSimulationVAO(GLuint position_vbo, GLuint initia
|
||||
glVertexAttribPointer(6, 3, GL_FLOAT, GL_FALSE, sizeof(ParticleSystemProxy::ParticleData), (GLvoid*)(4 * sizeof(float)));
|
||||
glEnableVertexAttribArray(7);
|
||||
glVertexAttribPointer(7, 1, GL_FLOAT, GL_FALSE, sizeof(ParticleSystemProxy::ParticleData), (GLvoid*)(7 * sizeof(float)));
|
||||
#endif
|
||||
}
|
||||
|
||||
void ParticleSystemProxy::simulate()
|
||||
{
|
||||
#ifndef ANDROID
|
||||
int timediff = int(GUIEngine::getLatestDt() * 1000.f);
|
||||
int active_count = getEmitter()->getMaxLifeTime() * getEmitter()->getMaxParticlesPerSecond() / 1000;
|
||||
core::matrix4 matrix = getAbsoluteTransformation();
|
||||
@ -524,7 +515,6 @@ void ParticleSystemProxy::simulate()
|
||||
std::swap(tfb_buffers[0], tfb_buffers[1]);
|
||||
std::swap(current_rendering_vao, non_current_rendering_vao);
|
||||
std::swap(current_simulation_vao, non_current_simulation_vao);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ParticleSystemProxy::drawFlip()
|
||||
|
@ -75,7 +75,7 @@
|
||||
|
||||
#if (IRRLICHT_VERSION_MAJOR < 1 || IRRLICHT_VERSION_MINOR < 7 || \
|
||||
_IRR_MATERIAL_MAX_TEXTURES_ < 8 || !defined(_IRR_COMPILE_WITH_OPENGL_) || \
|
||||
!defined(_IRR_COMPILE_WITH_B3D_LOADER_)) && !defined(ANDROID) && !defined(USE_GLES2)
|
||||
!defined(_IRR_COMPILE_WITH_B3D_LOADER_))
|
||||
#error "Building against an incompatible Irrlicht. Distros, \
|
||||
please use the included version."
|
||||
#endif
|
||||
@ -456,12 +456,12 @@ void IrrDriver::initDevice()
|
||||
|
||||
if(m_device)
|
||||
break;
|
||||
#if !defined(ANDROID_DEVICE) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
params.DriverType = video::EDT_OPENGL;
|
||||
#else
|
||||
params.DriverType = video::EDT_OGLES2;
|
||||
#endif
|
||||
#if defined(ANDROID_DEVICE)
|
||||
#if defined(ANDROID)
|
||||
params.PrivateData = global_android_app;
|
||||
#endif
|
||||
params.Stencilbuffer = false;
|
||||
@ -509,7 +509,6 @@ void IrrDriver::initDevice()
|
||||
{
|
||||
UserConfigParams::m_width = MIN_SUPPORTED_WIDTH;
|
||||
UserConfigParams::m_height = MIN_SUPPORTED_HEIGHT;
|
||||
#if !defined(ANDROID_DEVICE)
|
||||
#if defined(USE_GLES2)
|
||||
m_device = createDevice(video::EDT_OGLES2,
|
||||
#else
|
||||
@ -524,15 +523,6 @@ void IrrDriver::initDevice()
|
||||
this, // event receiver
|
||||
file_manager->getFileSystem()
|
||||
);
|
||||
#else
|
||||
struct irr::SIrrlichtCreationParameters p;
|
||||
p.DriverType = video::EDT_OGLES2;
|
||||
// The android app object is needed by the irrlicht device.
|
||||
p.PrivateData = global_android_app;
|
||||
p.WindowSize = core::dimension2d<u32>(1280,800);
|
||||
|
||||
m_device = createDeviceEx(p);
|
||||
#endif
|
||||
if (m_device)
|
||||
{
|
||||
Log::verbose("irr_driver", "An invalid resolution was set in "
|
||||
|
@ -76,7 +76,7 @@ public:
|
||||
GLuint m_dest_tu;
|
||||
ComputeShadowBlurVShader()
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "blurshadowV.comp");
|
||||
m_dest_tu = 1;
|
||||
assignUniforms("pixel", "weights");
|
||||
@ -139,7 +139,7 @@ public:
|
||||
GLuint m_dest_tu;
|
||||
ComputeGaussian6VBlurShader()
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "gaussian6v.comp");
|
||||
m_dest_tu = 1;
|
||||
assignUniforms("pixel", "weights");
|
||||
@ -158,7 +158,7 @@ public:
|
||||
GLuint m_dest_tu;
|
||||
ComputeGaussian6HBlurShader()
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "gaussian6h.comp");
|
||||
m_dest_tu = 1;
|
||||
assignUniforms("pixel", "weights");
|
||||
@ -177,7 +177,7 @@ public:
|
||||
GLuint m_dest_tu;
|
||||
ComputeShadowBlurHShader()
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "blurshadowH.comp");
|
||||
m_dest_tu = 1;
|
||||
assignUniforms("pixel", "weights");
|
||||
@ -242,7 +242,7 @@ public:
|
||||
GLuint m_dest_tu;
|
||||
ComputeGaussian17TapHShader()
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "bilateralH.comp");
|
||||
m_dest_tu = 2;
|
||||
assignUniforms("pixel");
|
||||
@ -255,7 +255,7 @@ public:
|
||||
void render(const FrameBuffer &fb, const FrameBuffer &auxiliary,
|
||||
int width, int height)
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
use();
|
||||
glBindSampler(m_dest_tu, 0);
|
||||
setTextureUnits(fb.getRTT()[0],
|
||||
@ -302,7 +302,7 @@ public:
|
||||
|
||||
ComputeGaussian17TapVShader()
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "bilateralV.comp");
|
||||
m_dest_tu = 2;
|
||||
assignUniforms("pixel");
|
||||
@ -315,7 +315,7 @@ public:
|
||||
void render(const FrameBuffer &auxiliary, const FrameBuffer &fb,
|
||||
int width, int height)
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
use();
|
||||
glBindSampler(m_dest_tu, 0);
|
||||
setTextureUnits(auxiliary.getRTT()[0],
|
||||
@ -1049,7 +1049,7 @@ void PostProcessing::renderRHDebug(unsigned SHR, unsigned SHG, unsigned SHB,
|
||||
const core::matrix4 &rh_matrix,
|
||||
const core::vector3df &rh_extend)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
RHDebug::getInstance()->use();
|
||||
glActiveTexture(GL_TEXTURE0 + RHDebug::getInstance()->m_tu_shr);
|
||||
@ -1146,7 +1146,7 @@ void PostProcessing::renderGaussian6BlurLayer(FrameBuffer &in_fbo,
|
||||
UserConfigParams::m_shadows_resolution,
|
||||
UserConfigParams::m_shadows_resolution, sigma_h);
|
||||
}
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
else
|
||||
{
|
||||
const std::vector<float> &weightsV = getGaussianWeight(sigma_v, 7);
|
||||
@ -1207,7 +1207,7 @@ void PostProcessing::renderGaussian6Blur(const FrameBuffer &in_fbo,
|
||||
Gaussian6HBlurShader::getInstance()->render(auxiliary, in_fbo.getWidth(),
|
||||
in_fbo.getHeight(), sigma_h);
|
||||
}
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
else
|
||||
{
|
||||
const std::vector<float> &weightsV = getGaussianWeight(sigma_v, 7);
|
||||
@ -1267,7 +1267,7 @@ void PostProcessing::renderGaussian17TapBlur(const FrameBuffer &in_fbo,
|
||||
assert(in_fbo.getWidth() == auxiliary.getWidth() &&
|
||||
in_fbo.getHeight() == auxiliary.getHeight());
|
||||
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsComputeShadersFiltering())
|
||||
glMemoryBarrier(GL_FRAMEBUFFER_BARRIER_BIT);
|
||||
#endif
|
||||
@ -1289,7 +1289,7 @@ void PostProcessing::renderGaussian17TapBlur(const FrameBuffer &in_fbo,
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsComputeShadersFiltering())
|
||||
glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT);
|
||||
#endif
|
||||
@ -1311,7 +1311,7 @@ void PostProcessing::renderGaussian17TapBlur(const FrameBuffer &in_fbo,
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsComputeShadersFiltering())
|
||||
glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT);
|
||||
#endif
|
||||
@ -1668,9 +1668,7 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode,
|
||||
if (!CVS->isARBUniformBufferObjectUsable())
|
||||
return in_fbo;
|
||||
|
||||
#if !defined(ANDROID)
|
||||
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
irr_driver->getFBO(FBO_MLAA_COLORS).bind();
|
||||
renderPassThrough(in_fbo->getRTT()[0],
|
||||
irr_driver->getFBO(FBO_MLAA_COLORS).getWidth(),
|
||||
@ -1684,9 +1682,7 @@ FrameBuffer *PostProcessing::render(scene::ICameraSceneNode * const camnode,
|
||||
applyMLAA();
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
}
|
||||
#if !defined(ANDROID)
|
||||
glDisable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
|
||||
return out_fbo;
|
||||
} // render
|
||||
|
@ -188,10 +188,8 @@ void IrrDriver::renderGLSL(float dt)
|
||||
if (World::getWorld() && World::getWorld()->getTrack()->hasShadows() && m_spherical_harmonics->has6Textures())
|
||||
irr_driver->getSceneManager()->setAmbientLight(SColor(0, 0, 0, 0));
|
||||
|
||||
#if !defined(ANDROID)
|
||||
if (!CVS->isDefferedEnabled())
|
||||
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
|
||||
PROFILER_PUSH_CPU_MARKER("Update Light Info", 0xFF, 0x0, 0x0);
|
||||
unsigned plc = updateLightsInfo(camnode, dt);
|
||||
@ -283,16 +281,12 @@ void IrrDriver::renderGLSL(float dt)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if !defined(ANDROID)
|
||||
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
if (CVS->isDefferedEnabled())
|
||||
camera->activate();
|
||||
m_post_processing->renderPassThrough(fbo->getRTT()[0], viewport.LowerRightCorner.X - viewport.UpperLeftCorner.X, viewport.LowerRightCorner.Y - viewport.UpperLeftCorner.Y);
|
||||
#if !defined(ANDROID)
|
||||
glDisable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// Save projection-view matrix for the next frame
|
||||
@ -405,10 +399,8 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po
|
||||
else
|
||||
{
|
||||
// We need a cleared depth buffer for some effect (eg particles depth blending)
|
||||
#if !defined(ANDROID)
|
||||
if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_FRAMEBUFFER_SRGB_WORKING))
|
||||
glDisable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
m_rtts->getFBO(FBO_NORMAL_AND_DEPTHS).bind();
|
||||
// Bind() modifies the viewport. In order not to affect anything else,
|
||||
// the viewport is just reset here and not removed in Bind().
|
||||
@ -418,10 +410,8 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po
|
||||
vp.LowerRightCorner.X - vp.UpperLeftCorner.X,
|
||||
vp.LowerRightCorner.Y - vp.UpperLeftCorner.Y);
|
||||
glClear(GL_DEPTH_BUFFER_BIT);
|
||||
#if !defined(ANDROID)
|
||||
if (GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_FRAMEBUFFER_SRGB_WORKING))
|
||||
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
}
|
||||
PROFILER_POP_CPU_MARKER();
|
||||
@ -544,9 +534,7 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po
|
||||
}
|
||||
if (!CVS->isDefferedEnabled() && !forceRTT)
|
||||
{
|
||||
#if !defined(ANDROID)
|
||||
glDisable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDepthMask(GL_FALSE);
|
||||
return;
|
||||
@ -687,7 +675,7 @@ void IrrDriver::renderGlow(std::vector<GlowData>& glows)
|
||||
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, GlowPassCmd::getInstance()->drawindirectcmd);
|
||||
InstancedColorizeShader::getInstance()->use();
|
||||
|
||||
|
@ -165,7 +165,7 @@ class ShadowShader : public TextureShader<ShadowShader, 0, int, core::matrix4>
|
||||
public:
|
||||
ShadowShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
// Geometry shader needed
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
@ -191,7 +191,7 @@ class InstancedShadowShader : public TextureShader<InstancedShadowShader, 0, int
|
||||
public:
|
||||
InstancedShadowShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
// Geometry shader needed
|
||||
// Geometry shader needed
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
@ -404,7 +404,7 @@ class RefShadowShader : public TextureShader<RefShadowShader, 1,
|
||||
public:
|
||||
RefShadowShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
// Geometry shader needed
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
@ -432,7 +432,7 @@ class InstancedRefShadowShader : public TextureShader<InstancedRefShadowShader,
|
||||
public:
|
||||
InstancedRefShadowShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
// Geometry shader needed
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
@ -489,7 +489,7 @@ class NormalVisualizer : public Shader<NormalVisualizer, video::SColor>
|
||||
public:
|
||||
NormalVisualizer()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2) //?????
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_VERTEX_SHADER, "instanced_object_pass.vert",
|
||||
GL_GEOMETRY_SHADER, "normal_visualizer.geom",
|
||||
GL_FRAGMENT_SHADER, "coloredquad.frag");
|
||||
@ -655,7 +655,7 @@ class GrassShadowShader : public TextureShader<GrassShadowShader, 1, int, core::
|
||||
public:
|
||||
GrassShadowShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
// Geometry shader needed
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
@ -683,7 +683,7 @@ class InstancedGrassShadowShader : public TextureShader<InstancedGrassShadowShad
|
||||
public:
|
||||
InstancedGrassShadowShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
// Geometry shader needed
|
||||
if (CVS->getGLSLVersion() < 150)
|
||||
return;
|
||||
@ -1111,7 +1111,7 @@ void renderMeshes1stPass()
|
||||
template<typename T, typename...Args>
|
||||
void renderInstancedMeshes1stPass(Args...args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
std::vector<GLMesh *> &meshes = T::InstancedList::getInstance()->SolidPass;
|
||||
T::InstancedFirstPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
@ -1139,7 +1139,7 @@ void renderInstancedMeshes1stPass(Args...args)
|
||||
template<typename T, typename...Args>
|
||||
void multidraw1stPass(Args...args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
T::InstancedFirstPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
if (SolidPassCmd::getInstance()->Size[T::MaterialType])
|
||||
@ -1160,7 +1160,7 @@ void IrrDriver::renderSolidFirstPass()
|
||||
{
|
||||
windDir = getWindDir();
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, SolidPassCmd::getInstance()->drawindirectcmd);
|
||||
#endif
|
||||
@ -1181,7 +1181,7 @@ void IrrDriver::renderSolidFirstPass()
|
||||
renderMeshes1stPass<SphereMap, 2, 1>();
|
||||
renderMeshes1stPass<DetailMat, 2, 1>();
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
multidraw1stPass<DefaultMaterial>();
|
||||
@ -1250,7 +1250,7 @@ void renderMeshes2ndPass( const std::vector<uint64_t> &Prefilled_Handle,
|
||||
template<typename T, typename...Args>
|
||||
void renderInstancedMeshes2ndPass(const std::vector<GLuint> &Prefilled_tex, Args...args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
std::vector<GLMesh *> &meshes = T::InstancedList::getInstance()->SolidPass;
|
||||
T::InstancedSecondPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
||||
@ -1273,7 +1273,7 @@ void renderInstancedMeshes2ndPass(const std::vector<GLuint> &Prefilled_tex, Args
|
||||
template<typename T, typename...Args>
|
||||
void multidraw2ndPass(const std::vector<uint64_t> &Handles, Args... args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
T::InstancedSecondPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
||||
T::Instance));
|
||||
@ -1302,7 +1302,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
|
||||
uint64_t DiffuseHandle = 0, SpecularHandle = 0, SSAOHandle = 0, DepthHandle = 0;
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
DiffuseHandle = glGetTextureSamplerHandleARB(m_rtts->getRenderTarget(RTT_DIFFUSE),
|
||||
@ -1327,7 +1327,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER,
|
||||
SolidPassCmd::getInstance()->drawindirectcmd);
|
||||
@ -1355,7 +1355,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
renderMeshes2ndPass<GrassMat, 3, 1>(createVector<uint64_t>(DiffuseHandle, SpecularHandle, SSAOHandle), DiffSpecSSAOTex);
|
||||
renderMeshes2ndPass<NormalMat, 3, 1>(createVector<uint64_t>(DiffuseHandle, SpecularHandle, SSAOHandle), DiffSpecSSAOTex);
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
multidraw2ndPass<DefaultMaterial>(createVector<uint64_t>(DiffuseHandle, SpecularHandle, SSAOHandle, 0, 0));
|
||||
@ -1424,7 +1424,7 @@ void IrrDriver::renderSolidSecondPass()
|
||||
template<typename T>
|
||||
static void renderInstancedMeshNormals()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
std::vector<GLMesh *> &meshes = T::InstancedList::getInstance()->SolidPass;
|
||||
NormalVisualizer::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
@ -1442,7 +1442,7 @@ static void renderInstancedMeshNormals()
|
||||
template<typename T>
|
||||
static void renderMultiMeshNormals()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
NormalVisualizer::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, T::Instance));
|
||||
if (SolidPassCmd::getInstance()->Size[T::MaterialType])
|
||||
@ -1459,7 +1459,7 @@ static void renderMultiMeshNormals()
|
||||
// ----------------------------------------------------------------------------
|
||||
void IrrDriver::renderNormalsVisualisation()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled()) {
|
||||
renderMultiMeshNormals<DefaultMaterial>();
|
||||
renderMultiMeshNormals<AlphaRef>();
|
||||
@ -1716,7 +1716,7 @@ void renderShadow(unsigned cascade)
|
||||
template<typename T, typename...Args>
|
||||
void renderInstancedShadow(unsigned cascade, Args ...args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
T::InstancedShadowPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
||||
InstanceTypeShadow));
|
||||
@ -1740,7 +1740,7 @@ void renderInstancedShadow(unsigned cascade, Args ...args)
|
||||
template<typename T, typename...Args>
|
||||
static void multidrawShadow(unsigned i, Args ...args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
T::InstancedShadowPassShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
||||
InstanceTypeShadow));
|
||||
@ -1759,7 +1759,7 @@ static void multidrawShadow(unsigned i, Args ...args)
|
||||
// ----------------------------------------------------------------------------
|
||||
void IrrDriver::renderShadows()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glDepthMask(GL_TRUE);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
@ -1894,7 +1894,7 @@ void drawRSM(const core::matrix4 & rsm_matrix)
|
||||
template<typename T, typename...Args>
|
||||
void renderRSMShadow(Args ...args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
T::InstancedRSMShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType, InstanceTypeRSM));
|
||||
auto t = T::InstancedList::getInstance()->RSM;
|
||||
@ -1916,7 +1916,7 @@ void renderRSMShadow(Args ...args)
|
||||
template<typename T, typename... Args>
|
||||
void multidrawRSM(Args...args)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
T::InstancedRSMShader::getInstance()->use();
|
||||
glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(T::VertexType,
|
||||
InstanceTypeRSM));
|
||||
@ -1949,7 +1949,7 @@ void IrrDriver::renderRSM()
|
||||
drawRSM<DetailMat, 3, 1>(rsm_matrix);
|
||||
drawRSM<SplattingMat, 1>(rsm_matrix);
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER,
|
||||
RSMPassCmd::getInstance()->drawindirectcmd);
|
||||
|
@ -101,12 +101,10 @@ public:
|
||||
sizeof(LightBaseClass::PointLightInfo),
|
||||
(GLvoid*)(7 * sizeof(float)));
|
||||
|
||||
#ifndef ANDROID
|
||||
glVertexAttribDivisorARB(attrib_Position, 1);
|
||||
glVertexAttribDivisorARB(attrib_Energy, 1);
|
||||
glVertexAttribDivisorARB(attrib_Color, 1);
|
||||
glVertexAttribDivisorARB(attrib_Radius, 1);
|
||||
#endif
|
||||
} // PointLightShader
|
||||
}; // PointLightShader
|
||||
|
||||
@ -152,12 +150,10 @@ public:
|
||||
sizeof(LightBaseClass::PointLightInfo),
|
||||
(GLvoid*)(7 * sizeof(float)));
|
||||
|
||||
#ifndef ANDROID
|
||||
glVertexAttribDivisorARB(attrib_Position, 1);
|
||||
glVertexAttribDivisorARB(attrib_Energy, 1);
|
||||
glVertexAttribDivisorARB(attrib_Color, 1);
|
||||
glVertexAttribDivisorARB(attrib_Radius, 1);
|
||||
#endif
|
||||
} // PointLightScatterShader
|
||||
};
|
||||
|
||||
@ -232,7 +228,7 @@ class RadianceHintsConstructionShader
|
||||
public:
|
||||
RadianceHintsConstructionShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
{
|
||||
loadProgram(OBJECT, GL_VERTEX_SHADER, "slicedscreenquad.vert",
|
||||
@ -263,7 +259,7 @@ class NVWorkaroundRadianceHintsConstructionShader
|
||||
public:
|
||||
NVWorkaroundRadianceHintsConstructionShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT,GL_VERTEX_SHADER,"slicedscreenquad_nvworkaround.vert",
|
||||
GL_GEOMETRY_SHADER, "rhpassthrough.geom",
|
||||
GL_FRAGMENT_SHADER, "rh.frag");
|
||||
|
@ -64,15 +64,14 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
|
||||
GLuint id = glCreateShader(type);
|
||||
|
||||
std::ostringstream code;
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
code << "#version " << CVS->getGLSLVersion()<<"\n";
|
||||
#endif
|
||||
#if defined(USE_GLES2)
|
||||
#else
|
||||
if (CVS->isGLSL())
|
||||
code << "#version 300 es\n";
|
||||
#endif
|
||||
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
// Some drivers report that the compute shaders extension is available,
|
||||
// but they report only OpenGL 3.x version, and thus these extensions
|
||||
// must be enabled manually. Otherwise the shaders compilation will fail
|
||||
|
@ -178,10 +178,9 @@ GLuint loadShader(const char * file, unsigned type)
|
||||
{
|
||||
GLuint Id = glCreateShader(type);
|
||||
char versionString[20];
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
sprintf(versionString, "#version %d\n", CVS->getGLSLVersion());
|
||||
#endif
|
||||
#if defined(USE_GLES2)
|
||||
#else
|
||||
if (CVS->isGLSL())
|
||||
sprintf(versionString, "#version 300 es\n");
|
||||
#endif
|
||||
@ -252,7 +251,7 @@ void Shaders::loadShaders()
|
||||
int saved_shaders[ES_COUNT];
|
||||
memcpy(saved_shaders, m_shaders, sizeof(m_shaders));
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
std::string name = "pass";
|
||||
#else
|
||||
std::string name = "pass_gles";
|
||||
|
@ -47,7 +47,7 @@ class LightspaceBoundingBoxShader
|
||||
public:
|
||||
LightspaceBoundingBoxShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "Lightspaceboundingbox.comp");
|
||||
assignSamplerNames(0, "depth", ST_NEAREST_FILTERED);
|
||||
assignUniforms("SunCamMatrix", "split0", "split1", "split2", "splitmax");
|
||||
@ -66,7 +66,7 @@ class ShadowMatricesGenerationShader
|
||||
public:
|
||||
ShadowMatricesGenerationShader()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
loadProgram(OBJECT, GL_COMPUTE_SHADER, "shadowmatrixgeneration.comp");
|
||||
assignUniforms("SunCamMatrix");
|
||||
GLuint block_idx =
|
||||
@ -222,7 +222,7 @@ core::matrix4 ShadowMatrices::getTighestFitOrthoProj(const core::matrix4 &transf
|
||||
void ShadowMatrices::updateSplitAndLightcoordRangeFromComputeShaders(unsigned int width,
|
||||
unsigned int height)
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
struct CascadeBoundingBox
|
||||
{
|
||||
int xmin;
|
||||
|
@ -185,7 +185,7 @@ void Skybox::generateCubeMapFromTextures()
|
||||
}
|
||||
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_cube_map);
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
GLint internal_format = CVS->isTextureCompressionEnabled() ?
|
||||
GL_COMPRESSED_SRGB_ALPHA : GL_SRGB_ALPHA;
|
||||
#else
|
||||
@ -208,7 +208,6 @@ void Skybox::generateCubeMapFromTextures()
|
||||
// ----------------------------------------------------------------------------
|
||||
void Skybox::generateSpecularCubemap()
|
||||
{
|
||||
#ifndef ANDROID
|
||||
glGenTextures(1, &m_specular_probe);
|
||||
glBindTexture(GL_TEXTURE_CUBE_MAP, m_specular_probe);
|
||||
size_t cubemap_size = 256;
|
||||
@ -304,7 +303,6 @@ void Skybox::generateSpecularCubemap()
|
||||
}
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glDeleteFramebuffers(1, &fbo);
|
||||
#endif
|
||||
} // generateSpecularCubemap
|
||||
|
||||
|
||||
@ -323,7 +321,7 @@ Skybox::Skybox(const std::vector<video::ITexture *> &skybox_textures)
|
||||
{
|
||||
m_skybox_textures = skybox_textures;
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
|
||||
#endif
|
||||
|
||||
|
@ -344,7 +344,7 @@ static void setTexture(GLMesh &mesh, unsigned i, bool is_srgb,
|
||||
getUnicolorTexture(video::SColor(255, 127, 127, 127));
|
||||
}
|
||||
compressTexture(mesh.textures[i], is_srgb);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[i])
|
||||
@ -425,7 +425,7 @@ void initTexturesTransparent(GLMesh &mesh)
|
||||
return;
|
||||
}
|
||||
compressTexture(mesh.textures[0], true);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
|
@ -127,9 +127,7 @@ void STKMeshSceneNode::drawGlow(const GLMesh &mesh)
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
ColorizeShader::getInstance()->setUniforms(AbsoluteTransformation, video::SColorf(glowcolor.getRed() / 255.f, glowcolor.getGreen() / 255.f, glowcolor.getBlue() / 255.f));
|
||||
#ifndef ANDROID
|
||||
glDrawElementsBaseVertex(ptype, count, itype, (GLvoid *)mesh.vaoOffset, mesh.vaoBaseVertex);
|
||||
#endif
|
||||
}
|
||||
|
||||
void STKMeshSceneNode::updatevbo()
|
||||
@ -305,7 +303,7 @@ void STKMeshSceneNode::render()
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
compressTexture(mesh.textures[0], true);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
@ -350,7 +348,7 @@ void STKMeshSceneNode::render()
|
||||
GLenum itype = mesh.IndexType;
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
GLuint64 DiffuseHandle =
|
||||
@ -462,7 +460,7 @@ void STKMeshSceneNode::render()
|
||||
tmpcol.getBlue() / 255.0f);
|
||||
|
||||
compressTexture(mesh.textures[0], true);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
@ -502,7 +500,7 @@ void STKMeshSceneNode::render()
|
||||
size_t count = mesh.IndexCount;
|
||||
|
||||
compressTexture(mesh.textures[0], true);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
if (!mesh.TextureHandles[0])
|
||||
|
@ -692,7 +692,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
size_t offset = 0, current_cmd = 0;
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeDualTex));
|
||||
InstanceBufferDualTex = (InstanceDataDualTex*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, SolidPassCmd::getInstance()->drawindirectcmd);
|
||||
@ -742,7 +742,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
#endif
|
||||
@ -754,7 +754,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeGlow));
|
||||
GlowInstanceBuffer = (GlowInstanceData*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, GlowPassCmd::getInstance()->drawindirectcmd);
|
||||
@ -780,7 +780,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
#endif
|
||||
@ -793,7 +793,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
size_t offset = 0, current_cmd = 0;
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeShadow));
|
||||
ShadowInstanceBuffer = (InstanceDataSingleTex*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, ShadowPassCmd::getInstance()->drawindirectcmd);
|
||||
@ -820,7 +820,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
}
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
#endif
|
||||
@ -832,7 +832,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
size_t offset = 0, current_cmd = 0;
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glBindBuffer(GL_ARRAY_BUFFER, VAOManager::getInstance()->getInstanceBuffer(InstanceTypeRSM));
|
||||
RSMInstanceBuffer = (InstanceDataSingleTex*)glMapBufferRange(GL_ARRAY_BUFFER, 0, 10000 * sizeof(InstanceDataDualTex), GL_MAP_WRITE_BIT | GL_MAP_UNSYNCHRONIZED_BIT | GL_MAP_INVALIDATE_BUFFER_BIT);
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, RSMPassCmd::getInstance()->drawindirectcmd);
|
||||
@ -863,7 +863,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
|
||||
if (!CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
#if !defined(USE_GLES2) && !defined(ANDROID)
|
||||
#if !defined(USE_GLES2)
|
||||
glUnmapBuffer(GL_ARRAY_BUFFER);
|
||||
glUnmapBuffer(GL_DRAW_INDIRECT_BUFFER);
|
||||
#endif
|
||||
@ -874,7 +874,7 @@ PROFILER_POP_CPU_MARKER();
|
||||
poly_count[SOLID_NORMAL_AND_DEPTH_PASS] += SolidPoly;
|
||||
poly_count[SHADOW_PASS] += ShadowPoly;
|
||||
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsAsyncInstanceUpload())
|
||||
glMemoryBarrier(GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT);
|
||||
#endif
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
DrawElementsIndirectCommand *Ptr;
|
||||
CommandBuffer()
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
glGenBuffers(1, &drawindirectcmd);
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, drawindirectcmd);
|
||||
if (CVS->supportsAsyncInstanceUpload())
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "graphics/central_settings.hpp"
|
||||
#include "graphics/irr_driver.hpp"
|
||||
|
||||
#if defined(ANDROID) || defined(USE_GLES2)
|
||||
#if defined(USE_GLES2)
|
||||
#define _IRR_COMPILE_WITH_OGLES2_
|
||||
#include "../../lib/irrlicht/source/Irrlicht/COGLES2Texture.h"
|
||||
#else
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
GLuint getTextureGLuint(irr::video::ITexture *tex)
|
||||
{
|
||||
#if defined(ANDROID) || defined(USE_GLES2)
|
||||
#if defined(USE_GLES2)
|
||||
return static_cast<irr::video::COGLES2Texture*>(tex)->getOpenGLTextureName();
|
||||
#else
|
||||
return static_cast<irr::video::COpenGLTexture*>(tex)->getOpenGLTextureName();
|
||||
@ -44,7 +44,7 @@ GLuint getTextureGLuint(irr::video::ITexture *tex)
|
||||
GLuint getDepthTexture(irr::video::ITexture *tex)
|
||||
{
|
||||
assert(tex->isRenderTarget());
|
||||
#if defined(ANDROID) || defined(USE_GLES2)
|
||||
#if defined(USE_GLES2)
|
||||
return 1; //static_cast<irr::video::COGLES2FBODepthTexture*>(tex)->DepthRenderBuffer;
|
||||
#else
|
||||
return static_cast<irr::video::COpenGLFBOTexture*>(tex)->DepthBufferTexture;
|
||||
@ -107,14 +107,14 @@ void compressTexture(irr::video::ITexture *tex, bool srgb, bool premul_alpha)
|
||||
|
||||
if (!CVS->isTextureCompressionEnabled())
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (srgb)
|
||||
internalFormat = (tex->hasAlpha()) ? GL_SRGB_ALPHA : GL_SRGB;
|
||||
else
|
||||
#endif
|
||||
internalFormat = (tex->hasAlpha()) ? GL_RGBA : GL_RGB;
|
||||
}
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
else
|
||||
{
|
||||
if (srgb)
|
||||
@ -185,7 +185,7 @@ bool loadCompressedTexture(const std::string& compressed_tex)
|
||||
*/
|
||||
void saveCompressedTexture(const std::string& compressed_tex)
|
||||
{
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
int internal_format, width, height, size, compressionSuccessful;
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, (GLint *)&internal_format);
|
||||
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, (GLint *)&width);
|
||||
|
@ -55,9 +55,7 @@ void TextureShaderBase::bindTextureNearest(GLuint texture_unit, GLuint tex)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
|
||||
} // bindTextureNearest
|
||||
|
||||
@ -73,9 +71,7 @@ void TextureShaderBase::bindTextureTrilinearAnisotropic(GLuint tex_unit, GLuint
|
||||
|
||||
int aniso = UserConfigParams::m_anisotropic;
|
||||
if (aniso == 0) aniso = 1;
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)aniso);
|
||||
#endif
|
||||
} // bindTextureTrilinearAnisotropic
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -90,10 +86,8 @@ void TextureShaderBase::bindCubemapTrilinear(unsigned tex_unit, unsigned tex)
|
||||
|
||||
int aniso = UserConfigParams::m_anisotropic;
|
||||
if (aniso == 0) aniso = 1;
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_ANISOTROPY_EXT,
|
||||
(float)aniso);
|
||||
#endif
|
||||
} // bindCubemapTrilinear
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -106,9 +100,7 @@ void TextureShaderBase::bindTextureNearestClamped(GLuint texture_unit,
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
} // bindTextureNearestClamped
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -122,9 +114,7 @@ void TextureShaderBase::bindTextureBilinear(GLuint texture_unit, GLuint tex)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
} // bindTextureBilinear
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -136,9 +126,7 @@ void TextureShaderBase::bindTextureBilinearClamped(GLuint tex_unit, GLuint tex)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
} // bindTextureBilinearClamped
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -150,9 +138,7 @@ void TextureShaderBase::bindTextureSemiTrilinear(GLuint tex_unit, GLuint tex_id)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
} // bindTextureSemiTrilinear
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -181,9 +167,7 @@ void TextureShaderBase::bindTrilinearClampedArrayTexture(unsigned tex_unit,
|
||||
|
||||
int aniso = UserConfigParams::m_anisotropic;
|
||||
if (aniso == 0) aniso = 1;
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)aniso);
|
||||
#endif
|
||||
} // bindTrilinearClampedArrayTexture
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -195,9 +179,7 @@ void TextureShaderBase::bindTextureVolume(unsigned tex_unit, unsigned tex_id)
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
#ifndef ANDROID
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
} // bindTextureVolume
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -229,9 +211,7 @@ GLuint TextureShaderBase::createSamplers(SamplerTypeNew sampler_type)
|
||||
glSamplerParameteri(id, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glSamplerParameteri(id, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
|
||||
glSamplerParameteri(id, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
|
||||
#ifndef ANDROID
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
return createNearestSampler();
|
||||
}
|
||||
case ST_BILINEAR_CLAMPED_FILTERED:
|
||||
@ -254,9 +234,7 @@ GLuint TextureShaderBase::createNearestSampler()
|
||||
glSamplerParameteri(id, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glSamplerParameteri(id, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glSamplerParameteri(id, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
#ifndef ANDROID
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.);
|
||||
#endif
|
||||
return id;
|
||||
#endif
|
||||
} // createNearestSampler
|
||||
@ -274,9 +252,7 @@ GLuint TextureShaderBase::createTrilinearSampler()
|
||||
|
||||
int aniso = UserConfigParams::m_anisotropic;
|
||||
if (aniso == 0) aniso = 1;
|
||||
#ifndef ANDROID
|
||||
glSamplerParameterf(id, GL_TEXTURE_MAX_ANISOTROPY_EXT, (float)aniso);
|
||||
#endif
|
||||
return id;
|
||||
#endif
|
||||
} // createTrilinearSampler
|
||||
|
@ -215,11 +215,9 @@ public:
|
||||
template<int N, typename... HandlesId>
|
||||
void setTextureHandlesImpl(uint64_t handle, HandlesId... args)
|
||||
{
|
||||
#ifndef ANDROID
|
||||
if (handle)
|
||||
glUniformHandleui64ARB(m_texture_location[N], handle);
|
||||
setTextureHandlesImpl<N + 1>(args...);
|
||||
#endif
|
||||
} // setTextureHandlesImpl
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
@ -39,7 +39,7 @@ VAOManager::VAOManager()
|
||||
{
|
||||
glGenBuffers(1, &instance_vbo[i]);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, instance_vbo[i]);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
glBufferStorage(GL_ARRAY_BUFFER, 10000 * sizeof(InstanceDataDualTex), 0, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
@ -90,7 +90,7 @@ resizeBufferIfNecessary(size_t &lastIndex, size_t newLastIndex, size_t bufferSiz
|
||||
GLuint newVBO;
|
||||
glGenBuffers(1, &newVBO);
|
||||
glBindBuffer(type, newVBO);
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
glBufferStorage(type, bufferSize *stride, 0, GL_MAP_WRITE_BIT | GL_MAP_PERSISTENT_BIT);
|
||||
@ -293,7 +293,7 @@ void VAOManager::append(scene::IMeshBuffer *mb, VTXTYPE tp)
|
||||
size_t old_idx_cnt = last_index[tp];
|
||||
|
||||
regenerateBuffer(tp, old_vtx_cnt + mb->getVertexCount(), old_idx_cnt + mb->getIndexCount());
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
void *tmp = (char*)VBOPtr[tp] + old_vtx_cnt * getVertexPitch(tp);
|
||||
@ -305,7 +305,7 @@ void VAOManager::append(scene::IMeshBuffer *mb, VTXTYPE tp)
|
||||
glBindBuffer(GL_ARRAY_BUFFER, vbo[tp]);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, old_vtx_cnt * getVertexPitch(tp), mb->getVertexCount() * getVertexPitch(tp), mb->getVertices());
|
||||
}
|
||||
#if !defined(ANDROID) && !defined(USE_GLES2)
|
||||
#if !defined(USE_GLES2)
|
||||
if (CVS->supportsAsyncInstanceUpload())
|
||||
{
|
||||
void *tmp = (char*)IBOPtr[tp] + old_idx_cnt * sizeof(u16);
|
||||
|
@ -1961,14 +1961,10 @@ void Skin::process3DPane(IGUIElement *element, const core::recti &rect,
|
||||
FrameBuffer* fb = mvw->getFrameBuffer();
|
||||
if (fb != NULL && fb->getRTT().size() > 0)
|
||||
{
|
||||
#if !defined(ANDROID)
|
||||
glEnable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
draw2DImageFromRTT(fb->getRTT()[0], 512, 512,
|
||||
rect, core::rect<s32>(0, 0, 512, 512), NULL, SColor(255, 255, 255, 255), true);
|
||||
#if !defined(ANDROID)
|
||||
glDisable(GL_FRAMEBUFFER_SRGB);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (type == WTYPE_ICON_BUTTON || type == WTYPE_MODEL_VIEW)
|
||||
|
17
src/main.cpp
17
src/main.cpp
@ -1117,10 +1117,6 @@ void initUserConfig()
|
||||
//=============================================================================
|
||||
void initRest()
|
||||
{
|
||||
#ifdef ANDROID
|
||||
UserConfigParams::m_no_start_screen = true;
|
||||
#endif
|
||||
|
||||
stk_config->load(file_manager->getAsset("stk_config.xml"));
|
||||
|
||||
irr_driver = new IrrDriver();
|
||||
@ -1271,19 +1267,10 @@ void askForInternetPermission()
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
#ifdef ANDROID
|
||||
void stk_run() {
|
||||
main_loop->run();
|
||||
}
|
||||
int stk_main()
|
||||
{
|
||||
CommandLine::init(0, {});
|
||||
#else
|
||||
int main(int argc, char *argv[] )
|
||||
{
|
||||
CommandLine::init(argc, argv);
|
||||
|
||||
#endif
|
||||
CrashReporting::installHandlers();
|
||||
|
||||
srand(( unsigned ) time( 0 ));
|
||||
@ -1519,11 +1506,7 @@ int main(int argc, char *argv[] )
|
||||
race_manager->setupPlayerKartInfo();
|
||||
race_manager->startNew(false);
|
||||
}
|
||||
#ifdef ANDROID
|
||||
return 0;
|
||||
#else
|
||||
main_loop->run();
|
||||
#endif
|
||||
|
||||
} // try
|
||||
catch (std::exception &e)
|
||||
|
@ -171,7 +171,7 @@ void MainLoop::run()
|
||||
|
||||
m_curr_time = device->getTimer()->getRealTime();
|
||||
|
||||
#if defined(ANDROID_DEVICE)
|
||||
#if defined(ANDROID)
|
||||
auto sensorManager = ASensorManager_getInstance();
|
||||
auto accelerometerSensor = ASensorManager_getDefaultSensor(sensorManager,
|
||||
ASENSOR_TYPE_ACCELEROMETER);
|
||||
@ -186,7 +186,7 @@ void MainLoop::run()
|
||||
|
||||
while(!m_abort)
|
||||
{
|
||||
#if defined(ANDROID_DEVICE)
|
||||
#if defined(ANDROID)
|
||||
int ident;
|
||||
int events;
|
||||
struct android_poll_source* source;
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include <cstdio>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef ANDROID_DEVICE
|
||||
#ifdef ANDROID
|
||||
# include <android/log.h>
|
||||
#endif
|
||||
|
||||
@ -136,7 +136,7 @@ void Log::printMessage(int level, const char *component, const char *format,
|
||||
|
||||
if(level<m_min_log_level) return;
|
||||
|
||||
#ifdef ANDROID_DEVICE
|
||||
#ifdef ANDROID
|
||||
android_LogPriority alp;
|
||||
switch (level)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user