OcclusionQueryImpl.h 790 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. // Copyright (C) 2009-2021, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #pragma once
  6. #include <AnKi/Gr/OcclusionQuery.h>
  7. #include <AnKi/Gr/gl/GlObject.h>
  8. namespace anki
  9. {
  10. /// @addtogroup opengl
  11. /// @{
  12. /// Occlusion query.
  13. class OcclusionQueryImpl final : public OcclusionQuery, public GlObject
  14. {
  15. public:
  16. OcclusionQueryImpl(GrManager* manager, CString name)
  17. : OcclusionQuery(manager, name)
  18. {
  19. }
  20. ~OcclusionQueryImpl()
  21. {
  22. destroyDeferred(getManager(), glDeleteQueries);
  23. }
  24. /// Create the query.
  25. void init();
  26. /// Begin query.
  27. void begin();
  28. /// End query.
  29. void end();
  30. /// Get query result.
  31. OcclusionQueryResult getResult() const;
  32. };
  33. /// @}
  34. } // end namespace anki