mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
OpenGL: Fixed an issue cloning OpenGLImageType images
This commit is contained in:
parent
45825fdbd8
commit
d8638fdd2a
1 changed files with 11 additions and 3 deletions
|
|
@ -40,7 +40,11 @@ public:
|
|||
|
||||
bool initialise()
|
||||
{
|
||||
return frameBuffer.initialise (context, width, height);
|
||||
if (! frameBuffer.initialise (context, width, height))
|
||||
return false;
|
||||
|
||||
frameBuffer.clear (Colours::transparentBlack);
|
||||
return true;
|
||||
}
|
||||
|
||||
std::unique_ptr<LowLevelGraphicsContext> createLowLevelContext() override
|
||||
|
|
@ -53,7 +57,12 @@ public:
|
|||
|
||||
ImagePixelData::Ptr clone() override
|
||||
{
|
||||
Image newImage (*new OpenGLFrameBufferImage (context, width, height));
|
||||
std::unique_ptr<OpenGLFrameBufferImage> im (new OpenGLFrameBufferImage (context, width, height));
|
||||
|
||||
if (! im->initialise())
|
||||
return ImagePixelData::Ptr();
|
||||
|
||||
Image newImage (im.release());
|
||||
Graphics g (newImage);
|
||||
g.drawImageAt (Image (*this), 0, 0, false);
|
||||
|
||||
|
|
@ -192,7 +201,6 @@ ImagePixelData::Ptr OpenGLImageType::create (Image::PixelFormat, int width, int
|
|||
if (! im->initialise())
|
||||
return ImagePixelData::Ptr();
|
||||
|
||||
im->frameBuffer.clear (Colours::transparentBlack);
|
||||
return *im.release();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue