BsGLTimerQuery.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 "BsTimerQuery.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief OpenGL implementation of a timer query.
  10. */
  11. class BS_RSGL_EXPORT GLTimerQuery : public TimerQuery
  12. {
  13. public:
  14. GLTimerQuery();
  15. ~GLTimerQuery();
  16. /**
  17. * @copydoc TimerQuery::begin
  18. */
  19. virtual void begin();
  20. /**
  21. * @copydoc TimerQuery::end
  22. */
  23. virtual void end();
  24. /**
  25. * @copydoc TimerQuery::isReady
  26. */
  27. virtual bool isReady() const;
  28. /**
  29. * @copydoc TimerQuery::getTimeMs
  30. */
  31. virtual float getTimeMs();
  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 mQueryStartObj;
  41. GLuint mQueryEndObj;
  42. bool mFinalized;
  43. bool mEndIssued;
  44. float mTimeDelta;
  45. };
  46. }