BsGLOcclusionQuery.h 1.2 KB

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