repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / haiku3d / RenderView.h
blob65e23e2617b4e2311ad9266ffc16eadbec656aab
1 /*
2 * Copyright 2009, Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Alexandre Deckner <alex@zappotek.com>
7 */
8 #ifndef _RENDERVIEW_H
9 #define _RENDERVIEW_H
11 #include <GLView.h>
13 #include <vector>
16 class Camera;
17 class MeshInstance;
20 class RenderView : public BGLView {
21 public:
22 RenderView(BRect frame);
23 ~RenderView();
25 virtual void AttachedToWindow();
26 virtual void FrameResized(float width, float height);
27 virtual void ErrorCallback(unsigned long error);
29 protected:
30 void _InitGL();
31 void _CreateScene();
32 void _DeleteScene();
33 void _UpdateViewport();
34 void _UpdateCamera();
35 bool _Render();
36 uint32 _CreateRenderThread();
37 void _StopRenderThread();
38 static int32 _RenderThreadEntry(void* pointer);
39 int32 _RenderLoop();
41 Camera* fMainCamera;
43 typedef std::vector<MeshInstance*> MeshInstanceList;
44 MeshInstanceList fMeshInstances;
46 thread_id fRenderThread;
47 bool fStopRendering;
49 BPoint fRes, fNextRes;
50 bigtime_t fLastFrameTime;
53 #endif /* _RENDERVIEW_H */