From: Mikko Rasa Date: Thu, 1 Sep 2016 13:41:15 +0000 (+0300) Subject: Access clipping through the extension mechanism X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=4d27357dfe703c56ed4d6346690eeb64c2c703b7;p=libs%2Fgl.git Access clipping through the extension mechanism It's not supported on OpenGL ES. --- diff --git a/extensions/msp_clipping.glext b/extensions/msp_clipping.glext new file mode 100644 index 00000000..b94288cf --- /dev/null +++ b/extensions/msp_clipping.glext @@ -0,0 +1 @@ +extension MSP_clipping diff --git a/gl.fixes.xml b/gl.fixes.xml index f3e2e60e..8edc3731 100644 --- a/gl.fixes.xml +++ b/gl.fixes.xml @@ -153,6 +153,8 @@ + + @@ -164,6 +166,19 @@ + + + + + + + + + + + + + diff --git a/source/clipping.cpp b/source/clipping.cpp index 430a7b6f..6508ecf7 100644 --- a/source/clipping.cpp +++ b/source/clipping.cpp @@ -1,3 +1,4 @@ +#include #include #include "clipping.h" #include "clipplane.h" @@ -55,8 +56,9 @@ void Clipping::update_shader_data(ProgramData &shdata, const Matrix &view_matrix void Clipping::bind(bool legacy) const { + static Require _req(MSP_clipping); if(legacy) - static Require _req(MSP_legacy_features); + static Require _req2(MSP_legacy_features); if(legacy!=bound_with_legacy) unbind(); diff --git a/source/clipplane.cpp b/source/clipplane.cpp index e0b425a4..21df0d17 100644 --- a/source/clipplane.cpp +++ b/source/clipplane.cpp @@ -1,3 +1,4 @@ +#include #include #include #include "clipplane.h" @@ -50,7 +51,8 @@ void ClipPlane::update_shader_data(ProgramData &shdata, const Matrix &view_inver void ClipPlane::bind_to(unsigned i) const { - Require _req(MSP_legacy_features); + Require _req(MSP_clipping); + Require _req2(MSP_legacy_features); ClipUnit &unit = ClipUnit::get_unit(i); if(unit.set_plane(this)) diff --git a/source/clipunit.cpp b/source/clipunit.cpp index 83080bd7..2db721cf 100644 --- a/source/clipunit.cpp +++ b/source/clipunit.cpp @@ -1,3 +1,4 @@ +#include #include #include "clipunit.h" #include "gl.h" @@ -24,6 +25,7 @@ bool ClipUnit::set_plane(const ClipPlane *p) unsigned ClipUnit::get_n_units() { + static Require _req(MSP_clipping); static int count = get_i(GL_MAX_CLIP_PLANES); return count; }