-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get it working with OF 0.9.8 (macOS) #34
Comments
i haven't looked at this in a few years -- will take a look! thanks for detailed notes. PRs always welcome if you feel there are useful changes... I don't think this project will work well with project generator because there's alot of weird stuff like this: https://github.com/ofZach/ofxCef/blob/master/example_ofxCEF/src/main.cpp that an empty project created using the PG won't have (but if you update a project with this kind of main it will be fine)... |
I'm currently working on getting it up and running on Windows 10 - Visual Studio 2015. Will update once I succeed. Thanks for the MacOS instructions @michaelbaisch, will give that a go later in the week too |
My colleague has got things running under windows pretty well - see the other issue - #32 I'll get him to update it with some more recent things he had fixed up |
@sheridanis I was checking up the steps in that issue but unfortunately it's not working that well for me. Will be great if we can hear back from him 👍 |
I've asked him to update the issue when he's working next (should be today or tomorrow) - could you please detail on the other thread where you got up to in his steps and what problems your still seeing |
@razvanilin @sheridanis, yes, just post the details in issue #32 and I will try and help |
Glad to see some interest in this! I looked into stuff a bit more. I created a new issue #36 for the main problem I think I'm having. @ofZach concerning the PG. I'm aware that this addon probably will never be completely useable with PG, without some some additional work (As long as the PG doesn't get more powerful). But then for every addon you have to do a bit of work, even if it's just including and calling some methods on an instance from a class from the addon. And normally this is explained in the Readme. For this addon there are a few more steps. I think making it as compatible as possible plus explaining the missing steps has quite a few advantages. For instance it makes it possible to add it to an existing project. Then we have to think about which steps are really necessary, which makes it more maintainable and easier to understand. Having said that, I don't think you disagree, I just wanted to throw it in there. About the changes in |
Hi @michaelbaisch , I tried to get it up and running on MacOS following your instructions. Unfortunately I get some linker errors, most likely because of the way the Helper and Chromium frameworks are referenced in the project.
I tried this on a new project generated with the OF project generator with ofxCef as an addon. Did you come across this issue at any point when setting up the project? |
Hey @razvanilin could it be that you missed step 5. ? |
Thanks for pointing that out, @michaelbaisch Regarding the memory usage, I can't see any spikes on my end. The helper and the OF app both stay under 100mb usage. (~60-80MB) I'll try and set up an example in my fork later today. |
@razvanilin My first guess is that you maybe didn't copy the data folder with the html file that is loaded there. It would interest me if it was only that or if there is something more going on. Concerning the memory, did you try running it a few times? Because it doesn't always happen. Maybe try the my other branch + example from the issue #36. There are also a few notes where I explained in which case it always happens on the first ofxCEF instance. It could be maybe some kind of weird timing issue where different machines react differently. I'm on a MacBook Pro Mid 2015, 2.8Ghz i7, 16GB. Lastly how do you measure the performance? Or is it just a feeling how smooth it runs? |
@michaelbaisch you were right, I figured that afterwards haha |
@razvanilin did you have time to test my example project in the other branch in my fork? When you say you "have a separate class handling the ofxCEF instance" does that really mean that you call in that class the methods of an ofxCEF instance, or did you actually replace the ofxCEF class and implemented your own setup and draw methods? In the first case I guess you simply do something similar like me in the ofApp but the second case would be interesting, and I would love to see some sample code. |
Hi @michaelbaisch , sorry for the late reply. Things are busy at work at the moment and I'm having a hard time getting on this. I still don't have my mac with me and will give you more details when I get to it. Regarding the separate class, it's the first case you are describing so it should be similar to your setup. |
@moebiussurfing First off all, sorry for the late reply.
Hope you're getting it to compile now! |
I would like to see this working on at least macOS and Windows. I started with macOS and I couldn't get the example working. After a while I decided to started from scratch with OF 0.9.8, Xcode 8.3.2, and macOS Sierra 10.12.4.
I tried to make this process a bit more automatic by using the ProjectGenerator as much as possible. This is why the folder structure is a bit different and the building phases are much simpler.
Here is my fork with a
cef-test
example (To get this working you need to do the first 6 steps anyway).This is what I did to get it working:
Download the latest Mac OS X 64-bit Build from the Spotify Automated Builds site. (I downloaded the Standard Distribution
3.2987.1601.gf035232
)cmake -G "Xcode"
in the root of the downloaded folder.Open the Xcode project and compile the
cefclient
Product
->Scheme
->Edit Scheme…
the Build Configuration toRelease
.Copy
Chromium Embedded Framework.framework
andcefclient Helper.app
fromtests/cefclient/Release/cefclient.app/Contents/Frameworks
into the ofxCEF folder inlibs/CEF/lib/osx
Also copy
libcef_dll_wrapper/Release/libcef_dll_wrapper.a
into the same folderlibs/CEF/lib/osx
.And copy the contents of the
include
folder intolibs/CEF/include
Now open the project generator and create a new project with ofxCef as addon selected.
Open the Xcode project and drag and drop the
cefclient Helper.app
intoaddons/ofxCef/libs/CEF/lib/osx
In the project settings got to Build Phases and add a Copy Files Phase. This is for
Chromium Embedded Framework.framework
andcefclient Helper.app
, the Destination should be set toFrameworks
. There might already be aCopy Files
Phase to Frameworks in withChromium Embedded Framework.framework
, in that case just add thecefclient Helper.app
.We need another build phase this time a script phase. In there goes:
With that I think I replaced all the other script phases and the additional script.
As far as I understand only the Helper app and executable name needs to be changed to *appName* + Helper. For some reason we also need to change "@rpath/Frameworks/Chromium Embedded Framework.framework/Chromium Embedded Framework" of the app executable, which I don't understand because it already seems to point to the right place?!
Also remove
process_helper_mac.cc
from theCompile Sources
phase.Now select each .cpp file in
addons/ofxCef/src
and set the type in the file inspector toObjective-C++ Source
. Do the same forofApp.cpp
. (If we have separate source files for macOS and windows we could change the extension for the macOS sources to.mm
to skip this step)Copy the contents from my cef-test project
main.cpp
,ofApp.cpp
, andofApp.h
Now your project should be in the same state as my
cef-test
project in my fork and it should hopefully compile and show a website.Well, sometimes at least. I'm running into a few problems:
The web content only showed up when resizing the window.
OnPaint
isn't called when the the browser initially loads the website, which I don't understand. A dirty workaround was to add this:at the end of
void ofxCEF::setup()
Sometimes the site doesn't seem to show at all. Even after I resize the window a few times. Although I see through Little Snitch that the app makes a connection.
Sometimes the memory skyrockets to ~3GB at the start and after a few laggy seconds it goes back to ~1GB. I wasn't able to find out what is using the memory. Looking at the app and the Helper app with Instruments only shows few MB. Normally the Debugging Navigator in Xcode shows around 40MB.
The menu bar isn't useable. I also can't cmd+q the app which is annoying.
I looked at cef and the ofxCef code and tried a few things. For example when calling
void ofxCEF::setup()
inofApp::setup()
NSView * view = [ cocoaWindow contentView];
isn't available. I guess OF hasn't created the window yet. So I moved that intooffApp::update()
but it didn't really improve a lot.Is there anyone else who wants to see this production ready? I would appreciate some feedback on the steps I took to get it working and the problems I run into. Maybe I missed something.
And I'm sorry to put all this in one Issue, it's pretty general and everything might be connected after all ;)
The text was updated successfully, but these errors were encountered: