Fix GL screensavers in non-direct mode.
DirectDraw is called only in direct drawing mode (BDirectWindow). Our GL kit also works fine (but slower) in indirect mode (standard BWindow, GL stuff rendered offscreen then blitted). However, for this to work we need the screensavers to actually do something. Use the BScreenSaver::Draw method, which is called in either case. This makes it possible to use indirect mode for the preview of GL screensavers. The performance isn't really a problem on the very small preview (160x200 pixels). Fixes GLife and Gravity. Flurry still crashes Mesa.
This commit is contained in:
@@ -360,7 +360,7 @@ Flurry::StopSaver()
|
||||
|
||||
|
||||
void
|
||||
Flurry::DirectDraw(int32 frame)
|
||||
Flurry::Draw(BView*, int32 frame)
|
||||
{
|
||||
fFlurryView->DrawFlurryScreenSaver();
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
virtual status_t StartSaver(BView* view, bool preview);
|
||||
virtual void StopSaver();
|
||||
|
||||
virtual void DirectDraw(int32 frame);
|
||||
virtual void Draw(BView*, int32 frame);
|
||||
virtual void DirectConnected(direct_buffer_info* info);
|
||||
|
||||
virtual void StartConfig(BView* configView);
|
||||
|
||||
@@ -111,7 +111,7 @@ GLifeSaver::DirectConnected(direct_buffer_info* pdbiInfo)
|
||||
// ------------------------------------------------------
|
||||
// GLifeSaver Class DirectDraw Definition
|
||||
void
|
||||
GLifeSaver::DirectDraw(int32 iFrame)
|
||||
GLifeSaver::Draw(BView*, int32 iFrame)
|
||||
{
|
||||
fGLifeViewport->Advance();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public:
|
||||
// Constructor
|
||||
GLifeSaver(BMessage*, image_id);
|
||||
|
||||
// State/Preferences Methods
|
||||
// State/Preferences Methods
|
||||
status_t SaveState(BMessage*) const;
|
||||
void RestoreState(BMessage*);
|
||||
void StartConfig(BView*);
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
// Graphics Methods
|
||||
void DirectConnected(direct_buffer_info*);
|
||||
void DirectDraw(int32);
|
||||
void Draw(BView*, int32);
|
||||
|
||||
private:
|
||||
GLifeState fGLifeState;
|
||||
|
||||
@@ -90,7 +90,7 @@ Gravity::DirectConnected(direct_buffer_info* info)
|
||||
|
||||
|
||||
void
|
||||
Gravity::DirectDraw(int32 frame)
|
||||
Gravity::Draw(BView*, int32 frame)
|
||||
{
|
||||
fGravityView->DirectDraw();
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
void StopSaver();
|
||||
|
||||
void DirectConnected(direct_buffer_info* info);
|
||||
void DirectDraw(int32 frame);
|
||||
void Draw(BView*, int32 frame);
|
||||
|
||||
private:
|
||||
GravityView* fGravityView;
|
||||
|
||||
Reference in New Issue
Block a user