1
0
Fork 0
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:
jules 2012-04-03 14:51:22 +01:00
parent 074a8c05dd
commit 04c2d6cfc1
8 changed files with 88 additions and 57 deletions

View file

@ -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);