passed options to the renderer

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@18774 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jérôme Duval 2006-09-07 14:36:43 +00:00
parent 3a709c2adb
commit 9a2240212a
4 changed files with 10 additions and 8 deletions

View File

@ -54,9 +54,9 @@ extern const char * color_space_name(color_space space);
#endif #endif
extern "C" _EXPORT BGLRenderer * extern "C" _EXPORT BGLRenderer *
instanciate_gl_renderer(BGLView *view, BGLDispatcher *dispatcher) instanciate_gl_renderer(BGLView *view, ulong options, BGLDispatcher *dispatcher)
{ {
return new MesaSoftRenderer(view, 0, dispatcher); return new MesaSoftRenderer(view, options, dispatcher);
} }

View File

@ -18,9 +18,10 @@
GLRendererRoster::GLRendererRoster(BGLView *view) GLRendererRoster::GLRendererRoster(BGLView *view, ulong options)
: fNextID(0), : fNextID(0),
fView(view) fView(view),
fOptions(options)
{ {
AddDefaultPaths(); AddDefaultPaths();
} }
@ -127,12 +128,12 @@ GLRendererRoster::CreateRenderer(const entry_ref& ref)
if (image < B_OK) if (image < B_OK)
return image; return image;
BGLRenderer *(*instanc)(BGLView *view, BGLDispatcher *dispatcher); BGLRenderer *(*instanc)(BGLView *view, ulong options, BGLDispatcher *dispatcher);
status = get_image_symbol(image, "instanciate_gl_renderer", status = get_image_symbol(image, "instanciate_gl_renderer",
B_SYMBOL_TYPE_TEXT, (void**)&instanc); B_SYMBOL_TYPE_TEXT, (void**)&instanc);
if (status == B_OK) { if (status == B_OK) {
BGLRenderer *renderer = instanc(fView, new BGLDispatcher()); BGLRenderer *renderer = instanc(fView, fOptions, new BGLDispatcher());
if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) { if (AddRenderer(renderer, image, &ref, nodeRef.node) != B_OK) {
renderer->Release(); renderer->Release();
// this will delete the renderer // this will delete the renderer

View File

@ -19,7 +19,7 @@ typedef std::map<renderer_id, renderer_item> RendererMap;
class GLRendererRoster { class GLRendererRoster {
public: public:
GLRendererRoster(BGLView *view); GLRendererRoster(BGLView *view, ulong options);
virtual ~GLRendererRoster(); virtual ~GLRendererRoster();
BGLRenderer *GetRenderer(int32 id = 0); BGLRenderer *GetRenderer(int32 id = 0);
@ -34,6 +34,7 @@ class GLRendererRoster {
RendererMap fRenderers; RendererMap fRenderers;
int32 fNextID; int32 fNextID;
BGLView *fView; BGLView *fView;
ulong fOptions;
}; };
#endif /* _GLRENDERER_ROSTER_H */ #endif /* _GLRENDERER_ROSTER_H */

View File

@ -34,7 +34,7 @@ BGLView::BGLView(BRect rect, char *name, ulong resizingMode, ulong mode, ulong o
: BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), // | B_FULL_UPDATE_ON_RESIZE) : BView(rect, name, B_FOLLOW_ALL_SIDES, mode | B_WILL_DRAW | B_FRAME_EVENTS), // | B_FULL_UPDATE_ON_RESIZE)
fRenderer(NULL) fRenderer(NULL)
{ {
fRoster = new GLRendererRoster(this); fRoster = new GLRendererRoster(this, options);
fRenderer = fRoster->GetRenderer(); fRenderer = fRoster->GetRenderer();
if (!fRenderer) { if (!fRenderer) {
fprintf(stderr, "no renderer found! \n"); fprintf(stderr, "no renderer found! \n");