BsGLTimerQuery.h 842 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #pragma once
  2. #include "BsGLPrerequisites.h"
  3. #include "BsTimerQuery.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief OpenGL implementation of a timer query.
  8. */
  9. class BS_RSGL_EXPORT GLTimerQuery : public TimerQuery
  10. {
  11. public:
  12. GLTimerQuery();
  13. ~GLTimerQuery();
  14. /**
  15. * @copydoc TimerQuery::begin
  16. */
  17. virtual void begin();
  18. /**
  19. * @copydoc TimerQuery::end
  20. */
  21. virtual void end();
  22. /**
  23. * @copydoc TimerQuery::isReady
  24. */
  25. virtual bool isReady() const;
  26. /**
  27. * @copydoc TimerQuery::getTimeMs
  28. */
  29. virtual float getTimeMs();
  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 mQueryStartObj;
  39. GLuint mQueryEndObj;
  40. bool mFinalized;
  41. float mTimeDelta;
  42. };
  43. }