mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Added some GL error handling and tweaks to support older PC builds.
This commit is contained in:
parent
074a8c05dd
commit
04c2d6cfc1
8 changed files with 88 additions and 57 deletions
|
|
@ -101,17 +101,21 @@ public:
|
|||
}
|
||||
|
||||
//==============================================================================
|
||||
void ensureFrameBufferSize (int width, int height)
|
||||
bool ensureFrameBufferSize (int width, int height)
|
||||
{
|
||||
const int fbW = cachedImageFrameBuffer.getWidth();
|
||||
const int fbH = cachedImageFrameBuffer.getHeight();
|
||||
|
||||
if (fbW != width || fbH != height || ! cachedImageFrameBuffer.isValid())
|
||||
{
|
||||
cachedImageFrameBuffer.initialise (context, width, height);
|
||||
if (! cachedImageFrameBuffer.initialise (context, width, height))
|
||||
return false;
|
||||
|
||||
validArea.clear();
|
||||
JUCE_CHECK_OPENGL_ERROR
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void clearRegionInFrameBuffer (const RectangleList& list)
|
||||
|
|
@ -169,7 +173,8 @@ public:
|
|||
jassert (get (component) == this);
|
||||
|
||||
const Rectangle<int> bounds (component.getLocalBounds());
|
||||
ensureFrameBufferSize (bounds.getWidth(), bounds.getHeight());
|
||||
if (! ensureFrameBufferSize (bounds.getWidth(), bounds.getHeight()))
|
||||
return;
|
||||
|
||||
RectangleList invalid (bounds);
|
||||
invalid.subtract (validArea);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue