Skip to content

Commit

Permalink
Tests|glsandbox: Trying out unloading data from ImageBank
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed May 2, 2013
1 parent c738cf4 commit 418898a
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions doomsday/tests/glsandbox/testwindow.cpp
Expand Up @@ -70,12 +70,13 @@ DENG2_OBSERVES(Bank, Load)

Instance(Public *i)
: Base(i),
mode(TestRenderToTexture),
mode (TestRenderToTexture),
//imageBank (Bank::DisableHotStorage),
uMvpMatrix("uMvpMatrix", GLUniform::Mat4),
uColor ("uColor", GLUniform::Vec4),
uTime ("uTime", GLUniform::Float),
uTex ("uTex", GLUniform::Sampler2D),
atlas(AtlasTexture::newWithRowAllocator(Atlas::AllowDefragment | Atlas::BackingStore))
atlas (AtlasTexture::newWithRowAllocator(Atlas::AllowDefragment | Atlas::BackingStore))
{
// Use this as the main window.
setMain(i);
Expand All @@ -88,9 +89,9 @@ DENG2_OBSERVES(Bank, Load)
atlas->setTotalSize(Vector2ui(256, 256));
atlas->setMagFilter(gl::Nearest);

imageBank.add("rtt/cube", "/data/graphics/testpic.png");
imageBank.loadAll();
//imageBank.audienceForLoad += this;
imageBank.add(Path("rtt.cube", '.'), "/data/graphics/testpic.png");
//imageBank.loadAll();
imageBank.audienceForLoad += this;
}

void canvasGLInit(Canvas &cv)
Expand Down Expand Up @@ -118,8 +119,8 @@ DENG2_OBSERVES(Bank, Load)

// Textures.
testpic.setAutoGenMips(true);
//imageBank.load("rtt/cube");
testpic.setImage(imageBank.image("rtt/cube"));
imageBank.load(Path("rtt.cube", '.'));
//testpic.setImage(imageBank.image("rtt/cube"));
//testpic.setImage(QImage(":/images/testpic.png"));
testpic.setWrapT(gl::RepeatMirrored);
testpic.setMinFilter(gl::Linear, gl::MipLinear);
Expand Down Expand Up @@ -230,6 +231,8 @@ DENG2_OBSERVES(Bank, Load)
if(path == "rtt/cube")
{
testpic.setImage(imageBank.image(path));

imageBank.unload(path);
}
}

Expand Down

0 comments on commit 418898a

Please sign in to comment.