• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2006-2012, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Philippe Houdoin <philippe.houdoin@free.fr>
7  */
8 #ifndef _GLRENDERER_ROSTER_H
9 #define _GLRENDERER_ROSTER_H
10 
11 
12 #include <GLRenderer.h>
13 
14 #include <vector>
15 
16 
17 typedef BGLRenderer* (*InstantiateRenderer) (BGLView* view, ulong options);
18 
19 struct renderer_item {
20 	InstantiateRenderer entry;
21 	entry_ref	ref;
22 	ino_t		node;
23 	image_id	image;
24 };
25 
26 typedef std::vector<renderer_item> RendererMap;
27 
28 
29 class GLRendererRoster {
30 	public:
31 		static GLRendererRoster *Roster();
32 		BGLRenderer* GetRenderer(BGLView *view, ulong options);
33 
34 	private:
35 		GLRendererRoster();
36 		virtual ~GLRendererRoster();
37 
38 		void AddDefaultPaths();
39 		status_t AddPath(const char* path);
40 		status_t AddRenderer(InstantiateRenderer entry, image_id image,
41 			const entry_ref* ref, ino_t node);
42 		status_t CreateRenderer(const entry_ref& ref);
43 
44 		static GLRendererRoster* fInstance;
45 		bool		fSafeMode;
46 		const char*	fABISubDirectory;
47 
48 		RendererMap fRenderers;
49 };
50 
51 
52 #endif	/* _GLRENDERER_ROSTER_H */
53