[of-dev] ofxShader addon

Pierre Proske pierre at digitalstar.net
Sun Jul 11 12:24:29 PDT 2010


The original idea I got from the code samples on this guy's page:
http://www.naixela.com/alex/

I've attached the files of his I re-worked....that's where the windows 
code comes from. Perhaps I pruned some stuff out accidentally, have a 
look at his code and see if there's anything missing.

p.


On 11/07/10 21:14, Kyle McDonald wrote:
> Awesommmmmee, thanks for the addon.
>
> It didn't initially compile on Windows in Code::Blocks for me:
>
> ofxShaderManagerUtils.h||In function `std::string getEventWin32()':|
> ofxShaderManagerUtils.h|170|error: `fnbuffer' was not declared in this 
> scope|
> ofxShaderManagerUtils.h|172|error: `hDir' was not declared in this scope|
> ofxShaderManager.cpp||In member function `virtual void 
> ofxShaderManager::threadedFunction()':|
> ofxShaderManager.cpp|233|error: `CreateFile' was not declared in this 
> scope|
> ofxShaderManager.cpp|236|error: return-statement with a value, in 
> function returning 'void'|
> ||=== Build finished: 4 errors, 0 warnings ===|
>
> I got rid of the hDir and fnbuffer by moving them to Utils and making 
> them global. CreateFile was substituted for CreateFileA because it 
> wasn't happy with Unicode pathnames.
>
> It runs now (I'm running against the ofxShader in my Google Code). But 
> the directory updating doesn't seem to work. The best I can tell is 
> that ReadDirectoryChangesW never returns.
>
> Should we move this to the forum and debug more there?
>
> Kyle
>
> Pierre Proske wrote:
>> Well it's Linux and Windows...just haven't tested the windows code.
>>
>> You could use a single toggle to re-load files....but automatically 
>> reloading is much more fun....you should try it, it's like magic ;)
>>
>> If the manager keeps track of absolute path names, perhaps the same 
>> name issue won't matter.
>>
>> Anyway, I'm willing to have a go at the OSX equivalent later 
>> on....it's not so much work actually I don't think.
>>
>> On 11/07/10 20:26, Kyle McDonald wrote:
>>> Ah, so it's Linux-only right now... maybe we could make it 
>>> cross-platform by just doing naive pull-based checks rather than 
>>> relying on the OS to push changes via Inotify/kqueue/etc.?
>>>
>>> It would definitely be non-ideal for installation, but during 
>>> development a single toggle that re-reads all the currently loaded 
>>> files and compares the strings to the last time they were read... 
>>> should only be a couple milliseconds, right? Plus, if you are using 
>>> the actual paths rather than the full directories, you don't have 
>>> the "same name" issue you mention.
>>>
>>> I think the slight slowdown from doing pull-based monitoring would 
>>> be preferable over the complexity of getting ofxShaderManager cross 
>>> platform.
>>>
>>> Kyle 
>>
>> _______________________________________________
>> of-dev mailing list
>> of-dev at dev.openframeworks.cc
>> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>
>
> _______________________________________________
> of-dev mailing list
> of-dev at dev.openframeworks.cc
> http://dev.openframeworks.cc/listinfo.cgi/of-dev-openframeworks.cc
>    


-- 
http://www.digitalstar.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: shader.cpp
Type: text/x-c++src
Size: 12405 bytes
Desc: not available
URL: <http://dev.openframeworks.cc/pipermail/of-dev-openframeworks.cc/attachments/20100711/12a2e245/attachment-0003.cpp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shader.h
Type: text/x-chdr
Size: 1185 bytes
Desc: not available
URL: <http://dev.openframeworks.cc/pipermail/of-dev-openframeworks.cc/attachments/20100711/12a2e245/attachment-0003.h>


More information about the of-dev mailing list