xref: /haiku/src/tests/add-ons/opengl/fake_renderer/FakeRenderer.h (revision 1e60bdeab63fa7a57bc9a55b032052e95a18bd2c)
1 /*
2  * Copyright 2006-2008, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  * 		Philippe Houdoin, philippe.houdoin@free.fr
7  */
8 
9 #ifndef FAKE_RENDERER_H
10 #define FAKE_RENDERER_H
11 
12 #include "GLRenderer.h"
13 
14 class FakeRenderer : public BGLRenderer {
15 public:
16 							FakeRenderer(BGLView* view,
17 								ulong bgl_options,
18 								BGLDispatcher* dispatcher);
19 		virtual				~FakeRenderer();
20 
21 		virtual	void 		SwapBuffers(bool VSync = false);
22 		virtual	void		Draw(BRect updateRect);
23 
24 		virtual	void		EnableDirectMode(bool enabled);
25 		virtual	void		DirectConnected(direct_buffer_info* info);
26 
27 private:
28 		static int32 		_DirectDrawThread(void *data);
29 		int32 				_DirectDrawThread();
30 
31 		ulong				fOptions;
32 
33 		sem_id				fDrawSem;
34 		thread_id			fDrawThread;
35 		BLocker				fDrawLocker;
36 
37 		rgb_color			fDrawColor;
38 
39 		uint8 *				fFrameBuffer;
40 		int32				fBytesPerRow;
41 		color_space			fColorSpace;
42 		clipping_rect		fBounds;
43 		clipping_rect *		fRects;
44 		int					fRectsCount;
45 
46 		bool				fConnected;
47 		bool				fDisabled;
48 };
49 
50 #endif	// FAKE_RENDERER_H
51 
52