source: trunk/VUT/work/TestCulling/TestCullingApplication.h @ 85

Revision 85, 2.9 KB checked in by mattausch, 19 years ago (diff)

corrected bug so chc is much faster than stop and wait

RevLine 
[61]1/**
2    \file
3        TestCullingApplication.h
4*/
5#include "CEGUIForwardRefs.h"
6#include "ExampleApplication.h"
[74]7#include "VisibilityEnvironment.h"
[85]8#include "SceneContentGenerator.h"
[61]9
10Real timeDelay = 0;
11#define KEY_PRESSED(_key,_timeDelay, _macro) \
12{ \
13    if (mInputDevice->isKeyDown(_key) && timeDelay <= 0) \
14{ \
15    timeDelay = _timeDelay; \
16    _macro ; \
17} \
18}
19
[74]20String mCurrentAlgorithmCaptions[GtpVisibility::VisibilityEnvironment::NUM_CULLING_MANAGERS] =
[61]21{
[74]22    "View Frustum Culling",
23        "Stop and Wait Culling",
24        "Coherent Hierarchical Culling"
[61]25};
26
27class MouseQueryListener : public ExampleFrameListener, public MouseListener, public MouseMotionListener
28{
29public:
30
31    MouseQueryListener(RenderWindow* win, Camera* cam, SceneManager *sceneManager,
[85]32                        CEGUI::Renderer *renderer, SceneContentGenerator *sceneContentGenerator);
[61]33
34
35    ~MouseQueryListener( );
36
37        bool frameStarted(const FrameEvent& evt);
38        bool frameEnded(const FrameEvent& evt);
39
40    /* MouseListener callbacks. */
41    virtual void mouseClicked(MouseEvent* e) { }
42    virtual void mouseEntered(MouseEvent* e) { }
43    virtual void mouseExited(MouseEvent* e)  { }
44
45    // This is when the mouse button goes DOWN.
46    virtual void mousePressed(MouseEvent* e);
47
48    // This is when the mouse button is let UP.
49    virtual void mouseReleased(MouseEvent* e);
50
51    /* MouseMotionListener callbacks */
52    virtual void mouseMoved (MouseEvent *e);
53   
54    // This is when the mouse is clicked, held and dragged.
55    virtual void mouseDragged (MouseEvent *e);
56
57    void keyPressed(KeyEvent* e);
58
59        void keyReleased(KeyEvent* e);
60        void keyClicked(KeyEvent* e);
61
[85]62        void nextAlgorithm();
63        void setAlgorithm(int algorithm);
[61]64        void changeThreshold(int incr);
65        void changeStats();
66
67protected:
68    bool mLMouseDown, mRMouseDown;     // True if the mouse buttons are down
69    SceneManager *mSceneMgr;           // A pointer to the scene manager
70   
71        CEGUI::Renderer *mGUIRenderer;     // cegui renderer
72       
73        bool mShutdownRequested;
74        int mCurrentAlgorithm;
[85]75        int mVisibilityThreshold;
[61]76
77        OverlayElement *mAlgorithmInfo;
78        OverlayElement *mThresholdInfo;
79        OverlayElement *mFrustumCulledNodesInfo;
80        OverlayElement *mQueryCulledNodesInfo;
81    OverlayElement *mTraversedNodesInfo;
82        OverlayElement *mHierarchyNodesInfo;
83        OverlayElement *mRenderedNodesInfo;
[84]84        OverlayElement *mNumObjectsInfo;
[85]85
86        SceneContentGenerator *mSceneContentGenerator;
[61]87};
88
89
90class TestCullingApplication : public ExampleApplication
91{
[85]92public:
93        ~TestCullingApplication();
[61]94
[85]95protected:
96        void createScene();
97        void createFrameListener();
98        void setupGui();
99       
[61]100        //virtual void createCamera(void);
101
102        CEGUI::OgreCEGUIRenderer *mGUIRenderer;
103        CEGUI::System *mGUISystem;
104
[79]105        Vector3 mMinTranslation;
106        Vector3 mMaxTranslation;
107
108        Vector3 mMinAngle;
[61]109        Vector3 mMaxAngle;
110
[85]111        SceneContentGenerator *mSceneContentGenerator;
112
[61]113private:
114        void chooseSceneManager(void);
115};
116
Note: See TracBrowser for help on using the repository browser.