Skip to content

Commit

Permalink
Fixed|libappfw: De- and re-initializing procedural images
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Feb 2, 2014
1 parent 32599f0 commit 43549b1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions doomsday/libappfw/include/de/framework/atlasproceduralimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ class LIBAPPFW_PUBLIC AtlasProceduralImage : public ProceduralImage
}
}

void glInit()
{
alloc();
}

void glDeinit()
{
release();
Expand Down
1 change: 1 addition & 0 deletions doomsday/libappfw/include/de/framework/proceduralimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class LIBAPPFW_PUBLIC ProceduralImage
void setColor(Color const &color);

virtual void update();
virtual void glInit();
virtual void glDeinit();
virtual void glMakeGeometry(DefaultVertexBuf::Builder &verts, Rectanglef const &rect) = 0;

Expand Down
5 changes: 5 additions & 0 deletions doomsday/libappfw/src/proceduralimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ void ProceduralImage::update()
// optional for derived classes
}

void ProceduralImage::glInit()
{
// optional for derived classes
}

void ProceduralImage::glDeinit()
{
// optional for derived classes
Expand Down
5 changes: 5 additions & 0 deletions doomsday/libappfw/src/widgets/labelwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ public Font::RichFormat::IStyle
<< uMvpMatrix << uColor << uAtlas();

glText.init(atlas(), self.font(), this);

if(!image.isNull())
{
image->glInit();
}
}

void glDeinit()
Expand Down

0 comments on commit 43549b1

Please sign in to comment.