ofxFenster addon to handle multiple windows (rewrite)

I tried to get a working lib by replacing the original ghost files with yours. After an hour of fixing reference errors, I surrender. Still get an “cannot instantiate abstract class” with GHOST_WindowWin32.
Seems like a have to wait for help. :frowning:

Last attempt: tried the other way round. Set up new vs solution in your ghost project. Same result :frowning:

Hmm too bad. I don’t know to much about errors in VS. But when you get “cannot instantiate abstract class” that means some function is not implemented and it should tell you which one as a warning. That should help locate the problem.

Finally managed to compile the lib with your ghost files.
By changing

virtual	GHOST_TSuccess setWindowOnTop(bool alwaysOnTop) {};  


virtual	GHOST_TSuccess setWindowOnTop(bool alwaysOnTop) {return(GHOST_kSuccess);};  

in GHOST_IWindow.h.

Unfortunately I get the almost the same errors:
like that one:
error LNK2005: “public: __thiscall std::_Container_base12::~_Container_base12(void)” (??1_Container_base12@std@@QAE@XZ) is already defined in libghost.lib(GHOST_EventManager.obj). D:\projects\openframeworks_007\apps\addonsExamples\ofxFensterExample\msvcprt.lib(MSVCP100.dll)

But then other errors, too:
error LNK2001: unresolved external symbol ““public: __thiscall STR_String::STR_String(char const *)” (??0STR_String@@QAE@PBD@Z)”. D:\projects\openframeworks_007\apps\addonsExamples\ofxFensterExample\libghost.lib(GHOST_System.obj)

Any hints?

@gekko,i did compiled the ghost lib under the vs2010 several weeks ago,but also gave me the linking errors at the end.

hmm… the definition of STR_String::STR_String should be in this file https://github.com/underdoeg/ghost/blob/master/libs/string/STR-String.cpp

the other errors are strange. To compile for Code::Blocks, I had to define some constant (-D FREE_WINDOWS) so it would include or compile things not present in minGW. Maybe something like that is needed for VS as well.

Would any of you mind sharing your project? I don’t really have the time right now to look at it, but it is a good starting point.

@underdoeg,sorry,i didn’t keep the vs solution after failed,i’ll try to re-make it if i got time this week,will upload it here,cheers!

Sorry, underdoeg, I was busy last days. But here is your ghost project, added a vs solution in “build/win_vs”.

Thanks, I’ll add it to github as is. That way it can serve as a starting point…


I’ve added the libs for visual studio (libghost.lib and libghost_debug.lib).
Also I’ve added an example project file for visual studio. so the example should compile the debug and release targets.

just clone or download it again from here: https://github.com/underdoeg/ofxFenster

test it and please report back here or on github!

tested with: windows7 and visual studio express 2010

PS: also updated the ghost repo with a working vs project file

Example VS-Project works on my system (Win7, VS 2010).
Drops to 15 fps, though.

when does it drop to 15fps? directly after start?

I ran both debug/release builds for serveral minutes and had a ~30 or ~60 fps. the strange thing was, it changed randomly between the two values.

what graphic card do you have? I testet it with an onboard G45 chip (GMA4500HD).

@underdoeg: how reliable is the fps counter?!

Hey Ben thanks for the libs!

The fps should be reliable. I copied the code directly from openframeworks and I think it should behave the exact same way.

Maybe there is something going on in the processEvent function

Maybe too many GHOST_kEventWindowUpdate events or something. Those would force the system to switch between windows all the time. Or another event stacks up and creates a holdup. Is it still as slow, if you return right in the beginning of processEvent so nothing comes thru and gets processed?

bool ofxFensterManager::processEvent(GHOST_IEvent* event)  
	return true;  

@ben thank you so much for this,just did testing on my laptop, the framerate is 40fps with nvidia gt240m

The framerate drops right after the start from 30 down to 15. But it doesn’t feel like 15 fps. Feels quite fluid, apart from a quick “halt” every 10 seconds or so.

I’m using a nVidia GT540M btw.

But it doesn’t feel like 15 fps.

Ok, then maybe it is the fps counter. I’ll look into it.

i was just talking with someone who needed to disable borders on osx, and remembered this. i finally checked it out, and this it’s totally awesome! great work on the addon!

hey kyle

thanks a lot! I’m glad the addon is being passed around. That will make it even better

hi, I’ve been experiencing a problem compiling ofxFenster on Ubuntu Lucid:
I get this error message

In file included from ../../../addons/ofxFenster/src/ofxFensterCanvas.cpp:1:  
../../../addons/ofxFenster/src/ofxFensterCanvas.h:15: error: conflicting declaration ‘typedef struct Screen Screen’  
/usr/include/X11/Xlib.h:286: error: ‘Screen’ has a previous declaration as ‘typedef struct Screen Screen’  

renaming Screen to something like fensterScreen fixed the issue on my system.

I’ll rename Screen to ofxScreen. Thanks for the hint!