Add Canvas::Image.dirtyPixels()
This commit is contained in:
parent
57b0f70a55
commit
ad3621e23b
@ -947,10 +947,18 @@ SGRect<int> intersectRect(const SGRect<int>& a, const SGRect<int>& b)
|
|||||||
}
|
}
|
||||||
|
|
||||||
image->setColor(color, x, y);
|
image->setColor(color, x, y);
|
||||||
auto c = getCanvas().lock();
|
|
||||||
c->enableRendering(true); // force a repaint
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Image::dirtyPixels()
|
||||||
|
{
|
||||||
|
osg::ref_ptr<osg::Image> image = _texture->getImage();
|
||||||
|
if (!image)
|
||||||
|
return;
|
||||||
|
image->dirty();
|
||||||
|
auto c = getCanvas().lock();
|
||||||
|
c->enableRendering(true); // force a repaint
|
||||||
|
}
|
||||||
|
|
||||||
void Image::allocateImage()
|
void Image::allocateImage()
|
||||||
{
|
{
|
||||||
osg::Image* image = new osg::Image;
|
osg::Image* image = new osg::Image;
|
||||||
|
@ -115,6 +115,11 @@ namespace canvas
|
|||||||
|
|
||||||
void setPixel(int x, int y, const osg::Vec4& color);
|
void setPixel(int x, int y, const osg::Vec4& color);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* mark the image pixels as modified, so the canvas is re-painted
|
||||||
|
*/
|
||||||
|
void dirtyPixels();
|
||||||
|
|
||||||
osg::ref_ptr<osg::Image> getImage() const;
|
osg::ref_ptr<osg::Image> getImage() const;
|
||||||
|
|
||||||
// void setRow(int row, int offset, )
|
// void setRow(int row, int offset, )
|
||||||
|
Loading…
Reference in New Issue
Block a user