ofxTransparentWindow (osx only)

Hi.

http://vimeo.com/15765520

This is transparent window addon for osx only.

Basic example:
[attachment=2:3prxck5w]Basic.png[/attachment:3prxck5w]

3D Model Loader example:
[attachment=1:3prxck5w]3Dmodelloader.png[/attachment:3prxck5w]

usage:

  
  
// testApp.h  
ofxTransparentWindow	transparent;  
  
  
// tesApp.cpp  
void testApp::setup(){  
        /*  
        your setup code  
        */  
	transparent.afterMainSetup();	  
}  
void testApp::update(){		  
	transparent.update();  
}  
  

We have to call afterMainSetup(); method after all initialization done.
If you call afterMainSetup(); before your setup, it will cause error…

You can set up 3 window types:

  
  
// normal usual window  
transparent.afterMainSetup(ofxTransparentWindow::NORMAL);	  
// as desktop background  
transparent.afterMainSetup(ofxTransparentWindow::DESKTOPBG);	  
// like screen saver   
transparent.afterMainSetup(ofxTransparentWindow::SCREENSAVER);	  
  

That’s all!

P.S.
This is my first Cocoa experience and I did many many guess works.
Please forgive me and let me know if you notice any fails.

ofxTransparentWindow.zip

Wow!

sweet addon! I can´t wait to use it

Great Job!

very nice. thanks for posting this.

do you know how the cpu usage /performance changes between a normal and transparent mode?

stephan.

great addon!
a while back i saw some code posted by zach which accesses the screen pixels… but i can’t find the link to the post!

having access to the screen pixels and combining it with your trasparent window, you could do some cool generative screen hijacking! :slight_smile:

EDIT >>> found it!
http://forum.openframeworks.cc/t/grabbing-from-the-screen-osx/2946/0

L.

I’m trying to modify this so you can also change the size and position of the window dynamically. It seems possible. Has anyone tried to do this?

OK I figured out a nice solution to toggle between transparent and a regular window. The expanded class is attached in case anyone needs to do the same thing. It allows you to move the application where you want it, hit the spacebar and it will toggle transparent.

http://web.media.mit.edu/~hunters/OF/TransparentToggle.zip

Hi, do you think that on OSX it would be possible to forward mouse events to a window “behind” the transparent one ?
If someone could at least point me in the right direction that would be terrific.

E

This super useful addon doesn’t seem to work any more for me. [Edit:] Everything compiles, but the background isn’t transparent.

Has anyone successfully used this with 0.8.0? I tried to “update” it here:

https://github.com/jefftimesten/ofxTransparentWindow

Suggestions very welcome. If it’s no longer possible, I should take down the repo.

It work fine for me with 0.8… (just to let people know)

hi people !

the included example works fine for me in OsX 10.9 with Xcode 5 and OF 0.8 …

but if i try to add it to an existing project i got this errors :

Undefined symbols for architecture i386:
  "updateView()", referenced from:
      ofxTransparentWindow::update() in ofxTransparentWindow.o
  "removeWindowBarAndTitle(int)", referenced from:
      ofxTransparentWindow::afterMainSetup(int) in ofxTransparentWindow.o
ld: symbol(s) not found for architecture i386

I’ve double checked that the ofxTransparentWindow is included in header search paths, both in project and target … but still i get this error.

What i did :

  • drag and drop the addon into my project.
  • deleted the example folder
  • added …/…/…/addons/ofxTransparentWindow/src on my “Header Search Paths” under Build Settings (both in the target and in the project)

I’m a newbie in .m file handling and maybe i need to tell somewhere to use them properly ?
Is there any special requirement when using .m files …

And … no luck … any ideas ?

Hello,

I fix the linker error and tested it on oF 081!
Seems the linker error was just because file suffix.
ofxTransparentWindowUtil.m => ofxTransparentWindowUtil.mm

I have sent pull request to Jeff.


@jefftimesten Thank you very much!

hello there,

is there any chance to update this wondeful and usefull addon for oF0.9+??

or has the transparency feature been addressed in some other way I am not aware of? (newbie here :slight_smile:)

Best
Byron

1 Like