summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/haiku-softpipe/SoftwareRenderer.h
blob: 8427ce171fee9b7502ba2920048e132289b18ac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Copyright 2006-2012, Haiku, Inc. All rights reserved.
 * Distributed under the terms of the MIT License.
 *
 * Authors:
 *		Jérôme Duval, korli@users.berlios.de
 * 		Philippe Houdoin, philippe.houdoin@free.fr
 * 		Artur Wyszynski, harakash@gmail.com
 *		Alexander von Gluck IV, kallisti5@unixzen.com
 */
#ifndef SOFTWARERENDERER_H
#define SOFTWARERENDERER_H


#include <kernel/image.h>

#include "GLRenderer.h"
#include "GalliumContext.h"


class SoftwareRenderer : public BGLRenderer {
public:
								SoftwareRenderer(BGLView *view,
									ulong bgl_options,
									BGLDispatcher *dispatcher);
	virtual						~SoftwareRenderer();

	virtual	void				LockGL();
	virtual	void				UnlockGL();

	virtual	void				SwapBuffers(bool vsync = false);
	virtual	void				Draw(BRect updateRect);
	virtual	status_t			CopyPixelsOut(BPoint source, BBitmap *dest);
	virtual	status_t			CopyPixelsIn(BBitmap *source, BPoint dest);
	virtual	void				FrameResized(float width, float height);

	virtual	void				EnableDirectMode(bool enabled);
	virtual	void				DirectConnected(direct_buffer_info *info);

private:

			void				_AllocateBitmap();

			GalliumContext*		fContextObj;
			BBitmap*			fBitmap;
			context_id			fContextID;

			bool				fDirectModeEnabled;
			direct_buffer_info*	fInfo;
			BLocker				fInfoLocker;
			ulong				fOptions;			
			GLuint				fWidth;
			GLuint				fHeight;
			GLuint				fNewWidth;
			GLuint				fNewHeight;
			color_space			fColorSpace;
};

#endif	// SOFTPIPERENDERER_H