1 | //************************************ bs::framework - Copyright 2018 Marko Pintera **************************************// |
---|---|
2 | //*********** Licensed under the MIT license. See LICENSE.md for full terms. This notice is not to be removed. ***********// |
3 | #include "BsGLQueryManager.h" |
4 | #include "BsGLEventQuery.h" |
5 | #include "BsGLTimerQuery.h" |
6 | #include "BsGLOcclusionQuery.h" |
7 | |
8 | namespace bs { namespace ct |
9 | { |
10 | SPtr<EventQuery> GLQueryManager::createEventQuery(UINT32 deviceIdx) const |
11 | { |
12 | SPtr<EventQuery> query = SPtr<GLEventQuery>(bs_new<GLEventQuery>(deviceIdx), |
13 | &QueryManager::deleteEventQuery, StdAlloc<GLEventQuery>()); |
14 | mEventQueries.push_back(query.get()); |
15 | |
16 | return query; |
17 | } |
18 | |
19 | SPtr<TimerQuery> GLQueryManager::createTimerQuery(UINT32 deviceIdx) const |
20 | { |
21 | SPtr<TimerQuery> query = SPtr<GLTimerQuery>(bs_new<GLTimerQuery>(deviceIdx), |
22 | &QueryManager::deleteTimerQuery, StdAlloc<GLTimerQuery>()); |
23 | mTimerQueries.push_back(query.get()); |
24 | |
25 | return query; |
26 | } |
27 | |
28 | SPtr<OcclusionQuery> GLQueryManager::createOcclusionQuery(bool binary, UINT32 deviceIdx) const |
29 | { |
30 | SPtr<OcclusionQuery> query = SPtr<GLOcclusionQuery>(bs_new<GLOcclusionQuery>(binary, deviceIdx), |
31 | &QueryManager::deleteOcclusionQuery, StdAlloc<GLOcclusionQuery>()); |
32 | mOcclusionQueries.push_back(query.get()); |
33 | |
34 | return query; |
35 | } |
36 | }} |