I'm using CEF with openFrameworks. So far I have been able to do what I want on OS X (CEF OSR and using openFrameworks for the rendering). The repo is here. Now I want to support Windows. It's almost working (well I guess). The main issue I'm encountering right now is that 2 'extra' windows are opening when I run the application. See the 2 overlapping white windows in the following screen shoot. The main window displays some content loaded from the Internet and a red circle drawn on top.
One of the window is opened when the method CefInitialize is called and the other one is opened when some 'content' is loaded (either directly when the method CreateBrowserSync is called with an URL as argument or when 'browser->GetMainFrame()->LoadURL(url);' is called).
CEF is initialized like this:
- Code: Select all
CefRefPtr<ofxCEFClientApp> app(new ofxCEFClientApp);
CefMainArgs main_args(::GetModuleHandle(NULL));
int exit_code = CefExecuteProcess(main_args, app.get(), NULL);
if (exit_code >= 0) {
return exit_code;
}
CefSettings settings;
settings.windowless_rendering_enabled = true;
CefInitialize(main_args, settings, NULL, NULL);
And then the browser is created:
- Code: Select all
renderHandler = new ofxCEFRenderHandler();
client = new ofxCEFBrowserClient(this, renderHandler);
CefWindowInfo windowInfo;
HWND hWnd = ofGetWin32Window();
windowInfo.SetAsWindowless(hWnd, true);
CefBrowserSettings settings;
settings.webgl = STATE_ENABLED;
browser = CefBrowserHost::CreateBrowserSync(windowInfo, client.get(), "", settings, NULL);
This is quite similar to the way I'm doing it on OS X (here is the source file for the OS X version)
Here is my setup:
cef_binary_3.2171.1979_windows32
Visual Studio Express 2012
Windows 8.1
Any help would be appreciated.
Thanks!