BsGLOcclusionQuery.h 898 B

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