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:
parent
3a709c2adb
commit
9a2240212a
@ -54,9 +54,9 @@ extern const char * color_space_name(color_space space);
|
||||
#endif
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,9 +18,10 @@
|
||||
|
||||
|
||||
|
||||
GLRendererRoster::GLRendererRoster(BGLView *view)
|
||||
GLRendererRoster::GLRendererRoster(BGLView *view, ulong options)
|
||||
: fNextID(0),
|
||||
fView(view)
|
||||
fView(view),
|
||||
fOptions(options)
|
||||
{
|
||||
AddDefaultPaths();
|
||||
}
|
||||
@ -127,12 +128,12 @@ GLRendererRoster::CreateRenderer(const entry_ref& ref)
|
||||
if (image < B_OK)
|
||||
return image;
|
||||
|
||||
BGLRenderer *(*instanc)(BGLView *view, BGLDispatcher *dispatcher);
|
||||
BGLRenderer *(*instanc)(BGLView *view, ulong options, BGLDispatcher *dispatcher);
|
||||
|
||||
status = get_image_symbol(image, "instanciate_gl_renderer",
|
||||
B_SYMBOL_TYPE_TEXT, (void**)&instanc);
|
||||
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) {
|
||||
renderer->Release();
|
||||
// this will delete the renderer
|
||||
|
@ -19,7 +19,7 @@ typedef std::map<renderer_id, renderer_item> RendererMap;
|
||||
|
||||
class GLRendererRoster {
|
||||
public:
|
||||
GLRendererRoster(BGLView *view);
|
||||
GLRendererRoster(BGLView *view, ulong options);
|
||||
virtual ~GLRendererRoster();
|
||||
|
||||
BGLRenderer *GetRenderer(int32 id = 0);
|
||||
@ -34,6 +34,7 @@ class GLRendererRoster {
|
||||
RendererMap fRenderers;
|
||||
int32 fNextID;
|
||||
BGLView *fView;
|
||||
ulong fOptions;
|
||||
};
|
||||
|
||||
#endif /* _GLRENDERER_ROSTER_H */
|
||||
|
@ -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)
|
||||
fRenderer(NULL)
|
||||
{
|
||||
fRoster = new GLRendererRoster(this);
|
||||
fRoster = new GLRendererRoster(this, options);
|
||||
fRenderer = fRoster->GetRenderer();
|
||||
if (!fRenderer) {
|
||||
fprintf(stderr, "no renderer found! \n");
|
||||
|
Loading…
Reference in New Issue
Block a user