BsGLOcclusionQuery.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsGLPrerequisites.h"
  5. #include "BsOcclusionQuery.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief OpenGL implementation of an occlusion query.
  10. */
  11. class BS_RSGL_EXPORT GLOcclusionQuery : public OcclusionQuery
  12. {
  13. public:
  14. GLOcclusionQuery(bool binary);
  15. ~GLOcclusionQuery();
  16. /**
  17. * @copydoc OcclusionQuery::begin
  18. */
  19. virtual void begin();
  20. /**
  21. * @copydoc OcclusionQuery::end
  22. */
  23. virtual void end();
  24. /**
  25. * @copydoc OcclusionQuery::isReady
  26. */
  27. virtual bool isReady() const;
  28. /**
  29. * @copydoc OcclusionQuery::getNumFragments
  30. */
  31. virtual UINT32 getNumSamples();
  32. private:
  33. friend class QueryManager;
  34. /**
  35. * @brief Processes query results and saves them for later use. To be called
  36. * when query has completed.
  37. */
  38. void finalize();
  39. private:
  40. GLuint mQueryObj;
  41. bool mFinalized;
  42. bool mEndIssued;
  43. UINT32 mNumSamples;
  44. };
  45. }