Browse Source

GL: removed deprecated Mesh::IndexType and indexSize().

Deprecated as part of the 2018.04 GL split, use GL::meshIndexType() and
GL::meshIndexSize() instead.
pull/331/head
Vladimír Vondruš 7 years ago
parent
commit
86a21282d6
  1. 5
      doc/changelog.dox
  2. 6
      src/Magnum/GL/Mesh.cpp
  3. 23
      src/Magnum/GL/Mesh.h
  4. 18
      src/Magnum/GL/Test/MeshTest.cpp

5
doc/changelog.dox

@ -307,7 +307,10 @@ See also:
@subsection changelog-latest-compatibility Potential compatibility breakages, removed APIs @subsection changelog-latest-compatibility Potential compatibility breakages, removed APIs
- Removed all aliases to @ref GL library functionality in the root namespace - Removed all aliases to @ref GL library functionality in the root namespace
(and root include path) which were deprecated in 2018.04 (and root include path) which were deprecated in 2018.04 and everything
related to this change:
- @cpp GL::Mesh::IndexType @ce and @cpp GL::Mesh::indexSize() @ce,
use @ref GL::MeshIndexType and @ref GL::Mesh::indexTypeSize() instead
- Removed templated overloads of @ref GL::Buffer::data(), - Removed templated overloads of @ref GL::Buffer::data(),
@ref GL::Buffer::subData() and @ref GL::Buffer::map() deprecated since @ref GL::Buffer::subData() and @ref GL::Buffer::map() deprecated since
2017. Use the non-templated versions together with 2017. Use the non-templated versions together with

6
src/Magnum/GL/Mesh.cpp

@ -190,12 +190,6 @@ Int Mesh::maxElementsVertices() {
} }
#endif #endif
#ifdef MAGNUM_BUILD_DEPRECATED
std::size_t Mesh::indexSize(Magnum::MeshIndexType type) {
return meshIndexTypeSize(type);
}
#endif
Mesh::Mesh(const MeshPrimitive primitive): _primitive{primitive}, _flags{ObjectFlag::DeleteOnDestruction} { Mesh::Mesh(const MeshPrimitive primitive): _primitive{primitive}, _flags{ObjectFlag::DeleteOnDestruction} {
(this->*Context::current().state().mesh->createImplementation)(true); (this->*Context::current().state().mesh->createImplementation)(true);
} }

23
src/Magnum/GL/Mesh.h

@ -294,14 +294,6 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
friend Implementation::MeshState; friend Implementation::MeshState;
public: public:
#ifdef MAGNUM_BUILD_DEPRECATED
/** @brief @copybrief MeshIndexType
* @deprecated Use @ref Magnum::MeshIndexType or @ref GL::MeshIndexType
* instead.
*/
typedef CORRADE_DEPRECATED("use MeshIndexType instead") Magnum::MeshIndexType IndexType;
#endif
#ifndef MAGNUM_TARGET_GLES2 #ifndef MAGNUM_TARGET_GLES2
/** /**
* @brief Max supported index value * @brief Max supported index value
@ -350,13 +342,6 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
static Int maxElementsVertices(); static Int maxElementsVertices();
#endif #endif
#ifdef MAGNUM_BUILD_DEPRECATED
/** @brief @copybrief meshIndexTypeSize()
* @deprecated Use @ref meshIndexTypeSize() instead.
*/
static CORRADE_DEPRECATED("use meshIndexTypeSize() instead") std::size_t indexSize(Magnum::MeshIndexType type);
#endif
/** /**
* @brief Wrap existing OpenGL vertex array object * @brief Wrap existing OpenGL vertex array object
* @param id OpenGL vertex array ID * @param id OpenGL vertex array ID
@ -526,14 +511,6 @@ class MAGNUM_GL_EXPORT Mesh: public AbstractObject {
*/ */
UnsignedInt indexTypeSize() const; UnsignedInt indexTypeSize() const;
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief Index size
* @deprecated Use @ref indexTypeSize() instead.
*/
CORRADE_DEPRECATED("use indexTypeSize() instead") std::size_t indexSize() const { return indexTypeSize(); }
#endif
/** @brief Primitive type */ /** @brief Primitive type */
MeshPrimitive primitive() const { return _primitive; } MeshPrimitive primitive() const { return _primitive; }

18
src/Magnum/GL/Test/MeshTest.cpp

@ -48,10 +48,6 @@ struct MeshTest: TestSuite::Tester {
void drawCountNotSet(); void drawCountNotSet();
void drawViewCountNotSet(); void drawViewCountNotSet();
#ifdef MAGNUM_BUILD_DEPRECATED
void indexSizeDeprecated();
#endif
void mapPrimitive(); void mapPrimitive();
void mapPrimitiveInvalid(); void mapPrimitiveInvalid();
void mapIndexType(); void mapIndexType();
@ -71,10 +67,6 @@ MeshTest::MeshTest() {
&MeshTest::drawCountNotSet, &MeshTest::drawCountNotSet,
&MeshTest::drawViewCountNotSet, &MeshTest::drawViewCountNotSet,
#ifdef MAGNUM_BUILD_DEPRECATED
&MeshTest::indexSizeDeprecated,
#endif
&MeshTest::mapPrimitive, &MeshTest::mapPrimitive,
&MeshTest::mapPrimitiveInvalid, &MeshTest::mapPrimitiveInvalid,
&MeshTest::mapIndexType, &MeshTest::mapIndexType,
@ -152,16 +144,6 @@ void MeshTest::drawViewCountNotSet() {
"GL::MeshView::draw(): setCount() was never called, probably a mistake?\n"); "GL::MeshView::draw(): setCount() was never called, probably a mistake?\n");
} }
#ifdef MAGNUM_BUILD_DEPRECATED
void MeshTest::indexSizeDeprecated() {
CORRADE_IGNORE_DEPRECATED_PUSH
CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedByte), 1);
CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedShort), 2);
CORRADE_COMPARE(Mesh::indexSize(Mesh::IndexType::UnsignedInt), 4);
CORRADE_IGNORE_DEPRECATED_POP
}
#endif
void MeshTest::mapPrimitive() { void MeshTest::mapPrimitive() {
CORRADE_COMPARE(meshPrimitive(Magnum::MeshPrimitive::Points), MeshPrimitive::Points); CORRADE_COMPARE(meshPrimitive(Magnum::MeshPrimitive::Points), MeshPrimitive::Points);
CORRADE_COMPARE(meshPrimitive(Magnum::MeshPrimitive::Lines), MeshPrimitive::Lines); CORRADE_COMPARE(meshPrimitive(Magnum::MeshPrimitive::Lines), MeshPrimitive::Lines);

Loading…
Cancel
Save