GithubHelp home page GithubHelp logo

hendrikp / cryhtml5 Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 14.0 2.18 MB

CryHTML5 is a bridge between the Chromium Embedded Framework and the CryEngine renderer, which allows developers to rapidly build UI for their games using HTML5 and JavaScript.

License: Other

C++ 91.68% HTML 1.91% C 6.41%

cryhtml5's People

Contributors

hendrikp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cryhtml5's Issues

I know you are looking for someone to take over this project..

And in a way I have, but probably not in the direction you were thinking.

I've hacked it (square peg, round hole, very heavy hammer) into working with DirectX11 directly as an alternative to Coherent-UI.

It is (if I can say nothing else positive about it) building against the current release of CEF (and I'm not saying it wasn't previously).

And it does work, it works great.

I have, however, hit a rather large SMACK ME IN THE FACE brick wall.

I was trying to implement JavaScript functionality in what we can arguably call "the opposite direction." - at least in respect to what you've coded for. So-called "Window Binding."

Firstly I naively copied this lovely example:

CefMessageRouterConfig config;
CefRefPtr<CefMessageRouterBrowserSide> browser_side_router_ = CefMessageRouterBrowserSide::Create(config);
CefMessageRouterBrowserSide::Handler* handler_ = client::binding_test::newHandler();
browser_side_router_->AddHandler(handler_, 1);

Which compiled fabulously but provided no functionality.

After some digging, I discovered the concept of Render and Browser threads, and then that you do not actually inherit from CefBrowserProcessHandler or CefRenderProcessHandler. In fact, I realised that for all the hacking around in your code, I didn't even know for sure that it had separate threads.

Oh, I'm not an idiot, I'm sure it has threads, I'm just at a bit of a loss as to how to go about binding to the render thread.

I've worked with Awesomium and even with a custom in-house WebKit derived framework, and am almost nauseatingly familiar with the:

frame->ExecuteJavaScript("alert('ExecuteJavaScript works!');",

method of JavaScript interaction. At the time (several years ago now), I remember going to some lengths to achieve faux async operatings through repeated polling and other such hideousness.

But now that there is the possibility of doing this:

void MyRenderProcessHandler::OnContextCreated(
    CefRefPtr<CefBrowser> browser,
    CefRefPtr<CefFrame> frame,
    CefRefPtr<CefV8Context> context) {
    // Retrieve the context's window object.
    CefRefPtr<CefV8Value> object = context->GetGlobal();

    // Create a new V8 string value. See the "Basic JS Types" section below.
    CefRefPtr<CefV8Value> str = CefV8Value::CreateString("My Value!");

    // Add the string to the window object as "window.myval". See the "JS Objects" section below.
    object->SetValue("myval", str, V8_PROPERTY_ATTRIBUTE_NONE);
}

/* javascript */
alert(window.myval); // Shows an alert box with "My Value!"

I'm quite excited.

Unfortunately, I cannot seem to jam in a facsimile of OnContextCreated (that would have been too easy) and have had epic failures trying to implement things like:

CEFCryHandler::CefRefPtr<CefMessageRouterRendererSide> renderer_side_router_ = ...

causing eventual crashes, due to the rather stubborn insistence of &browser->GetMainFrame()->GetV8Context() to always be NULL. I may have had success if I could have identified a better point to initiate, OTOH I might have the third end of stick.

It has occurred to me, that there may be issues related to spinning off threads when you're a DLL hooked into an already large executable process that doesn't belong to you, and that there may be reasons that I do not presently understand preventing me from accomplishing Window Binding.

As I said at the start, I know this is not a project you are overly-invested in, but it looks like I'm the only person who has done anything further than just fork your project... even if I am butchering it. (And FTR, almost all the CryEngine bindings are still there, they've just been removed from requiring the actual engine. Had to loose the plugin manager too, unfortunately.)

If you have any time to make suggestions, I would welcome them. Other than the obvious one, which is just use Coherent-UI. That's not an option, because I'm not a game developer, just a "mod maker."

Migrate to CryEngine V and integrate directly with Renderer

One of the first tasks would be to remove the dependency to the Plugin_D3D which is no longer needed as CryENGINE V is now shipping full engine Sourcecode. So one of the first things would be to extend the CryENGINE V Renderer interface to reliably update/exchange the HTML rendering surface, once this is done the Plugin is ready for its release.

The plugin was already fully working on older CryENGINE versions see here: https://www.youtube.com/watch?v=YphBFbS93EU

This issue and project itself can be taken on by anyone with intermediate C++, DirectX and CryENGINE experience. Happy Coding ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.