summaryrefslogtreecommitdiff
path: root/gui/src/threadedChainImageLoader.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@getdrop.com>2017-09-18 22:32:45 +0100
committerTim Redfern <tim@getdrop.com>2017-09-18 22:32:45 +0100
commitb28a850a8ab4532ee425439446f5b4e01f9471a9 (patch)
tree21609dc7bf5a96336fbb4e071e0c15146d57caa5 /gui/src/threadedChainImageLoader.cpp
parentb4972d6ba659cec3759fd87d6f0489a040e0fbf6 (diff)
threading working
Diffstat (limited to 'gui/src/threadedChainImageLoader.cpp')
-rw-r--r--gui/src/threadedChainImageLoader.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/gui/src/threadedChainImageLoader.cpp b/gui/src/threadedChainImageLoader.cpp
index ba3dd26..2927fb2 100644
--- a/gui/src/threadedChainImageLoader.cpp
+++ b/gui/src/threadedChainImageLoader.cpp
@@ -28,6 +28,7 @@ void threadedChainImageLoader::loadFromDisk(chainImage& image, string filename)
entry.name = filename;
images_to_load_from_disk.send(entry);
+
}
@@ -50,7 +51,9 @@ void threadedChainImageLoader::threadedFunction() {
setThreadName("threadedChainImageLoader " + ofToString(thread.get_id()));
chainImageLoaderEntry entry;
while( images_to_load_from_disk.receive(entry) ) {
- if(entry.image->load(entry.filename) ) {
+ if(entry.image->tload(entry.filename) ) {
+ ofLogNotice() << "Loaded " << entry.image->filename;
+
images_to_update.send(entry);
}else{
ofLogError("threadedChainImageLoader") << "couldn't load file: \"" << entry.filename << "\"";
@@ -92,8 +95,7 @@ void threadedChainImageLoader::update(ofEventArgs & a){
// Load 1 image per update so we don't block the gl thread for too long
chainImageLoaderEntry entry;
if (images_to_update.tryReceive(entry)) {
- entry.image->setUseTexture(true);
- entry.image->update();
+ entry.image->setupTextures();
}
}