Browse Source

Removed long-deprecated parameterless Query constructors and related.

Use constructors taking Target as a parameter and a parameterless
begin() instead.
pull/231/head
Vladimír Vondruš 8 years ago
parent
commit
c4e0920494
  1. 23
      src/Magnum/AbstractQuery.cpp
  2. 5
      src/Magnum/AbstractQuery.h
  3. 17
      src/Magnum/PrimitiveQuery.cpp
  4. 20
      src/Magnum/PrimitiveQuery.h
  5. 24
      src/Magnum/SampleQuery.h
  6. 24
      src/Magnum/TimeQuery.h

23
src/Magnum/AbstractQuery.cpp

@ -40,12 +40,6 @@ AbstractQuery::AbstractQuery(GLenum target): _target{target}, _flags{ObjectFlag:
(this->*Context::current().state().query->createImplementation)();
}
#ifdef MAGNUM_BUILD_DEPRECATED
AbstractQuery::AbstractQuery(): _target{}, _flags{ObjectFlag::DeleteOnDestruction} {
createImplementationDefault();
}
#endif
AbstractQuery::~AbstractQuery() {
/* Moved out or not deleting on destruction, nothing to do */
if(!_id || !(_flags & ObjectFlag::DeleteOnDestruction)) return;
@ -152,10 +146,6 @@ template<> Long AbstractQuery::result<Long>() {
#endif
void AbstractQuery::begin() {
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_INTERNAL_ASSERT(_target);
#endif
#ifndef MAGNUM_TARGET_GLES2
glBeginQuery(_target, _id);
#else
@ -163,20 +153,7 @@ void AbstractQuery::begin() {
#endif
}
#ifdef MAGNUM_BUILD_DEPRECATED
void AbstractQuery::begin(const GLenum target) {
CORRADE_INTERNAL_ASSERT(!_target || _target == target);
_target = target;
begin();
}
#endif
void AbstractQuery::end() {
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_INTERNAL_ASSERT(_target);
#endif
#ifndef MAGNUM_TARGET_GLES2
glEndQuery(_target);
#else

5
src/Magnum/AbstractQuery.h

@ -179,11 +179,6 @@ class MAGNUM_EXPORT AbstractQuery: public AbstractObject {
explicit AbstractQuery(NoCreateT, GLenum target) noexcept: _id{0}, _target{target}, _flags{ObjectFlag::DeleteOnDestruction} {}
explicit AbstractQuery(GLuint id, GLenum target, ObjectFlags flags) noexcept: _id{id}, _target{target}, _flags{flags} {}
#ifdef MAGNUM_BUILD_DEPRECATED
explicit AbstractQuery();
void begin(GLenum target);
#endif
GLuint _id;
GLenum _target;

17
src/Magnum/PrimitiveQuery.cpp

@ -34,30 +34,13 @@ void PrimitiveQuery::begin() {
AbstractQuery::begin();
}
#ifdef MAGNUM_BUILD_DEPRECATED
void PrimitiveQuery::begin(const Target target) {
#ifndef MAGNUM_TARGET_GLES
_index = 0;
#endif
AbstractQuery::begin(GLenum(target));
}
#endif
#ifndef MAGNUM_TARGET_GLES
void PrimitiveQuery::begin(const UnsignedInt index) {
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_INTERNAL_ASSERT(_target);
#endif
glBeginQueryIndexed(_target, _index = index, _id);
}
#endif
void PrimitiveQuery::end() {
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_INTERNAL_ASSERT(_target);
#endif
#ifndef MAGNUM_TARGET_GLES
if(!_index) glEndQuery(_target);
else glEndQueryIndexed(_target, _index);

20
src/Magnum/PrimitiveQuery.h

@ -33,10 +33,6 @@
#include "Magnum/AbstractQuery.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
#ifndef MAGNUM_TARGET_GLES2
namespace Magnum {
@ -143,14 +139,6 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
return PrimitiveQuery{id, target, flags};
}
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief PrimitiveQuery(Target)
* @deprecated Use @ref PrimitiveQuery(Target) instead.
*/
CORRADE_DEPRECATED("use PrimitiveQuery(Target) instead") explicit PrimitiveQuery() {}
#endif
/**
* @brief Constructor
*
@ -185,14 +173,6 @@ class MAGNUM_EXPORT PrimitiveQuery: public AbstractQuery {
*/
void begin();
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief begin()
* @deprecated Use @ref begin() instead.
*/
CORRADE_DEPRECATED("use begin() instead") void begin(Target target);
#endif
#ifndef MAGNUM_TARGET_GLES
/**
* @brief Begin indexed query

24
src/Magnum/SampleQuery.h

@ -33,10 +33,6 @@
#include "Magnum/AbstractQuery.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
#if !(defined(MAGNUM_TARGET_WEBGL) && defined(MAGNUM_TARGET_GLES2))
namespace Magnum {
@ -209,14 +205,6 @@ class SampleQuery: public AbstractQuery {
return SampleQuery{id, target, flags};
}
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief SampleQuery(Target)
* @deprecated Use @ref SampleQuery(Target) instead.
*/
CORRADE_DEPRECATED("use SampleQuery(Target) instead") explicit SampleQuery() {}
#endif
/**
* @brief Constructor
*
@ -241,18 +229,6 @@ class SampleQuery: public AbstractQuery {
*/
explicit SampleQuery(NoCreateT) noexcept: AbstractQuery{NoCreate, GLenum(Target::AnySamplesPassed)} {}
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief AbstractQuery::begin()
* @deprecated Use @ref begin() instead.
*/
CORRADE_DEPRECATED("use begin() instead") void begin(Target target) {
AbstractQuery::begin(GLenum(target));
}
using AbstractQuery::begin;
#endif
#ifndef MAGNUM_TARGET_GLES
/**
* @brief Begin conditional rendering based on result value

24
src/Magnum/TimeQuery.h

@ -33,10 +33,6 @@
#include "Magnum/AbstractQuery.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
#ifndef MAGNUM_TARGET_WEBGL
namespace Magnum {
@ -128,14 +124,6 @@ class TimeQuery: public AbstractQuery {
return TimeQuery{id, target, flags};
}
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief TimeQuery(Target)
* @deprecated Use @ref TimeQuery(Target) instead.
*/
CORRADE_DEPRECATED("use TimeQuery(Target) instead") explicit TimeQuery() {}
#endif
/**
* @brief Constructor
*
@ -189,18 +177,6 @@ class TimeQuery: public AbstractQuery {
#endif
}
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief AbstractQuery::begin()
* @deprecated Use @ref AbstractQuery::begin() instead.
*/
CORRADE_DEPRECATED("use begin() instead") void begin(Target target) {
AbstractQuery::begin(GLenum(target));
}
using AbstractQuery::begin;
#endif
private:
explicit TimeQuery(GLuint id, Target target, ObjectFlags flags) noexcept: AbstractQuery{id, GLenum(target), flags} {}
};

Loading…
Cancel
Save