TimestampQuery.cpp 794 B

123456789101112131415161718192021222324252627282930
  1. // Copyright (C) 2009-2020, Panagiotis Christopoulos Charitos and contributors.
  2. // All rights reserved.
  3. // Code licensed under the BSD License.
  4. // http://www.anki3d.org/LICENSE
  5. #include <anki/gr/TimestampQuery.h>
  6. #include <anki/gr/vulkan/TimestampQueryImpl.h>
  7. #include <anki/gr/GrManager.h>
  8. namespace anki
  9. {
  10. TimestampQuery* TimestampQuery::newInstance(GrManager* manager)
  11. {
  12. TimestampQueryImpl* impl = manager->getAllocator().newInstance<TimestampQueryImpl>(manager, "N/A");
  13. const Error err = impl->init();
  14. if(err)
  15. {
  16. manager->getAllocator().deleteInstance(impl);
  17. impl = nullptr;
  18. }
  19. return impl;
  20. }
  21. TimestampQueryResult TimestampQuery::getResult(Second& timestamp) const
  22. {
  23. return static_cast<const TimestampQueryImpl*>(this)->getResultInternal(timestamp);
  24. }
  25. } // end namespace anki