summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/libgl-haiku/GLRendererRoster.h
blob: 5c8da27119846d84965abc7e2b06b626583eaebd (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
/*
 * Copyright 2006-2012, Haiku, Inc. All Rights Reserved.
 * Distributed under the terms of the MIT License.
 *
 * Authors:
 *		Philippe Houdoin <philippe.houdoin@free.fr>
 */
#ifndef _GLRENDERER_ROSTER_H
#define _GLRENDERER_ROSTER_H


#include <GLRenderer.h>

#include <map>


struct renderer_item {
	BGLRenderer* renderer;
	entry_ref	ref;
	ino_t		node;
	image_id	image;
};

typedef std::map<renderer_id, renderer_item> RendererMap;


class GLRendererRoster {
	public:
		GLRendererRoster(BGLView* view, ulong options);
		virtual ~GLRendererRoster();

		BGLRenderer* GetRenderer(int32 id = 0);

	private:
		void AddDefaultPaths();
		status_t AddPath(const char* path);
		status_t AddRenderer(BGLRenderer* renderer,
			image_id image, const entry_ref* ref, ino_t node);
		status_t CreateRenderer(const entry_ref& ref);

		RendererMap	fRenderers;
		int32		fNextID;
		BGLView*	fView;
		ulong		fOptions;
		bool		fSafeMode;
		const char*	fABISubDirectory;

};


#endif	/* _GLRENDERER_ROSTER_H */