Last change
on this file since 10777 was
7163,
checked in by dafrick, 14 years ago
|
Merged presentation3 branch into trunk.
|
-
Property svn:eol-style set to
native
|
File size:
906 bytes
|
Rev | Line | |
---|
[6819] | 1 | #ifndef __GPUCOMMANDBUFFERFLUSH_H__ |
---|
| 2 | #define __GPUCOMMANDBUFFERFLUSH_H__ |
---|
| 3 | |
---|
| 4 | #include "OgrePrerequisites.h" |
---|
| 5 | #include "OgreFrameListener.h" |
---|
| 6 | |
---|
| 7 | namespace Ogre |
---|
| 8 | { |
---|
| 9 | |
---|
| 10 | /** Helper class which can assist you in making sure the GPU command |
---|
| 11 | buffer is regularly flushed, so in cases where the CPU is outpacing the |
---|
| 12 | GPU we do not hit a situation where the CPU suddenly has to stall to |
---|
| 13 | wait for more space in the buffer. |
---|
| 14 | */ |
---|
| 15 | class GpuCommandBufferFlush : public FrameListener |
---|
| 16 | { |
---|
| 17 | protected: |
---|
| 18 | bool mUseOcclusionQuery; |
---|
| 19 | typedef std::vector<HardwareOcclusionQuery*> HOQList; |
---|
| 20 | HOQList mHOQList; |
---|
| 21 | size_t mMaxQueuedFrames; |
---|
| 22 | size_t mCurrentFrame; |
---|
| 23 | bool mStartPull; |
---|
| 24 | bool mStarted; |
---|
| 25 | |
---|
| 26 | public: |
---|
| 27 | GpuCommandBufferFlush(); |
---|
| 28 | virtual ~GpuCommandBufferFlush(); |
---|
| 29 | |
---|
| 30 | void start(size_t maxQueuedFrames = 2); |
---|
| 31 | void stop(); |
---|
| 32 | bool frameStarted(const FrameEvent& evt); |
---|
| 33 | bool frameEnded(const FrameEvent& evt); |
---|
| 34 | |
---|
| 35 | }; |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | #endif |
---|
| 42 | |
---|
| 43 | |
---|
Note: See
TracBrowser
for help on using the repository browser.