diff --git a/PKGBUILD-nacl-newlib b/PKGBUILD-nacl-newlib index 4497ae870..32fe07066 100644 --- a/PKGBUILD-nacl-newlib +++ b/PKGBUILD-nacl-newlib @@ -20,6 +20,7 @@ build() { -DCMAKE_TOOLCHAIN_FILE="$startdir/toolchains/generic/NaCl-newlib-x86-32.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ + -DWITH_AUDIO=OFF \ -DWITH_MAGNUMINFO=ON \ -DWITH_NACLAPPLICATION=ON \ -DWITH_WINDOWLESSNACLAPPLICATION=ON \ @@ -35,6 +36,7 @@ build() { -DCMAKE_TOOLCHAIN_FILE="$startdir/toolchains/generic/NaCl-newlib-x86-64.cmake" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr/nacl \ + -DWITH_AUDIO=OFF \ -DWITH_MAGNUMINFO=ON \ -DWITH_NACLAPPLICATION=ON \ -DWITH_WINDOWLESSNACLAPPLICATION=ON diff --git a/src/Mesh.cpp b/src/Mesh.cpp index 176e30f97..5f1fb0109 100644 --- a/src/Mesh.cpp +++ b/src/Mesh.cpp @@ -136,7 +136,12 @@ Mesh& Mesh::setIndexBuffer(Buffer& buffer, GLintptr offset, IndexType type, Unsi return *this; } -void Mesh::drawInternal(Int firstVertex, Int vertexCount, GLintptr indexOffset, Int indexCount, Int indexStart, Int indexEnd) { +#ifndef MAGNUM_TARGET_GLES2 +void Mesh::drawInternal(Int firstVertex, Int vertexCount, GLintptr indexOffset, Int indexCount, Int indexStart, Int indexEnd) +#else +void Mesh::drawInternal(Int firstVertex, Int vertexCount, GLintptr indexOffset, Int indexCount) +#endif +{ /* Nothing to draw */ if(!vertexCount && !indexCount) return; diff --git a/src/Mesh.h b/src/Mesh.h index 16859d610..1a93db1d8 100644 --- a/src/Mesh.h +++ b/src/Mesh.h @@ -597,7 +597,11 @@ class MAGNUM_EXPORT Mesh { * is available), @fn_gl{DrawArrays} or @fn_gl{DrawElements}/@fn_gl{DrawRangeElements}. */ void draw() { + #ifndef MAGNUM_TARGET_GLES2 drawInternal(0, _vertexCount, _indexOffset, _indexCount, _indexStart, _indexEnd); + #else + drawInternal(0, _vertexCount, _indexOffset, _indexCount); + #endif } private: @@ -722,7 +726,11 @@ class MAGNUM_EXPORT Mesh { #endif #endif + #ifndef MAGNUM_TARGET_GLES2 void drawInternal(Int firstVertex, Int vertexCount, GLintptr indexOffset, Int indexCount, Int indexStart, Int indexEnd); + #else + void drawInternal(Int firstVertex, Int vertexCount, GLintptr indexOffset, Int indexCount); + #endif typedef void(Mesh::*CreateImplementation)(); void MAGNUM_LOCAL createImplementationDefault(); diff --git a/src/MeshView.cpp b/src/MeshView.cpp index 302f268e7..9eed8f255 100644 --- a/src/MeshView.cpp +++ b/src/MeshView.cpp @@ -28,16 +28,27 @@ namespace Magnum { -MeshView& MeshView::setIndexRange(Int first, Int count, UnsignedInt start, UnsignedInt end) { +#ifndef MAGNUM_TARGET_GLES2 +MeshView& MeshView::setIndexRange(Int first, Int count, UnsignedInt start, UnsignedInt end) +#else +MeshView& MeshView::setIndexRange(Int first, Int count, UnsignedInt, UnsignedInt) +#endif +{ _indexOffset = first*_original->indexSize(); _indexCount = count; + #ifndef MAGNUM_TARGET_GLES2 _indexStart = start; _indexEnd = end; + #endif return *this; } void MeshView::draw() { + #ifndef MAGNUM_TARGET_GLES2 _original->drawInternal(_firstVertex, _vertexCount, _indexOffset, _indexCount, _indexStart, _indexEnd); + #else + _original->drawInternal(_firstVertex, _vertexCount, _indexOffset, _indexCount); + #endif } } diff --git a/src/MeshView.h b/src/MeshView.h index 3fdb0aa0f..cc7c38b4e 100644 --- a/src/MeshView.h +++ b/src/MeshView.h @@ -29,12 +29,9 @@ */ #include "Magnum.h" +#include "OpenGL.h" #include "magnumVisibility.h" -#ifndef DOXYGEN_GENERATING_OUTPUT -typedef std::ptrdiff_t GLintptr; -#endif - namespace Magnum { /** @@ -100,7 +97,9 @@ class MAGNUM_EXPORT MeshView { * @return Reference to self (for method chaining) * * Specifying `0` for both @p start and @p end behaves the same as - * @ref setIndexRange(Int, Int). + * @ref setIndexRange(Int, Int). On OpenGL ES 2.0 this function behaves + * always as @ref setIndexRange(Int, Int), as this functionality is + * not available there. */ MeshView& setIndexRange(Int first, Int count, UnsignedInt start, UnsignedInt end); @@ -129,10 +128,16 @@ class MAGNUM_EXPORT MeshView { Int _firstVertex, _vertexCount, _indexCount; GLintptr _indexOffset; + #ifndef MAGNUM_TARGET_GLES2 UnsignedInt _indexStart, _indexEnd; + #endif }; -inline MeshView::MeshView(Mesh& original): _original(&original), _firstVertex(0), _vertexCount(0), _indexCount(0), _indexOffset(0), _indexStart(0), _indexEnd(0) {} +inline MeshView::MeshView(Mesh& original): _original(&original), _firstVertex(0), _vertexCount(0), _indexCount(0), _indexOffset(0) + #ifndef MAGNUM_TARGET_GLES2 + , _indexStart(0), _indexEnd(0) + #endif + {} }