Query.h 742 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef ANKI_GL_QUERY_H
  2. #define ANKI_GL_QUERY_H
  3. #include "anki/gl/Ogl.h"
  4. #include "anki/util/StdTypes.h"
  5. namespace anki {
  6. /// @addtogroup OpenGL
  7. ///
  8. /// Query object
  9. class Query
  10. {
  11. public:
  12. /// @name Constructors/Destructor
  13. /// @{
  14. /// @param q One of GL_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED,
  15. /// GL_TIME_ELAPSED
  16. Query(GLenum q);
  17. ~Query();
  18. /// @}
  19. /// Start
  20. void begin();
  21. /// End
  22. void end();
  23. /// Get results. Waits for operations to finish
  24. GLuint64 getResult();
  25. /// Get results. Doesn't Wait for operations to finish. If @a finished is
  26. /// false then the return value is irrelevant
  27. GLuint64 getResultNoWait(Bool& finished);
  28. private:
  29. GLuint glId;
  30. GLenum question;
  31. };
  32. /// @}
  33. } // end namespace anki
  34. #endif