Game Development Community

Chromium Embedded Framework Support

by Scott Przybylski · in Torque 3D Professional · 09/21/2014 (10:29 pm) · 7 replies

If anyone's interested I started adding support for Chromium Embedded Framework to Torque3D. The branch is available here github.com/skaughtx0r/Torque3D/tree/cef

Current limitations:
  • Only tested in Windows with VS2013.
  • Only works with legacy project generator (no CMake support yet).
  • No JavaScript/TorqueScript bridge implemented yet.

Right now it only adds a new gui control. I eventually plan on making it so you can map a web page to a material.

To use:
  1. Download CEF http://cefbuilds.com/ (I've been testing with dev channel)
  2. Add a CEF_PATH to your system environment variables that points to the CEF directory.
  3. Currently you must build the libcef_dll_wrapper project manually. The cef download comes with a project file for it and you can use that to build.
  4. Add includeModule( 'CEF' ); to your project.conf (My Projects/<project>/buildFiles/config/project.conf)
  5. generate projects.

About the author

Attempting to create a Hydroplane Racing simulation with Torque 3D.


#1
09/22/2014 (1:18 am)
Awesome! Going to give this a test as soon as I can. How much weight does it add to the exe/libs?
#2
09/22/2014 (12:45 pm)
Ah that reminds me, I still need to make the project generator copy the dependencies (dll and pak files from CEF) to the game folder.

I'll take a look when I get home, I'm not sure how big everything is.
#3
09/22/2014 (1:36 pm)
Pretty cool stuff!
#4
09/24/2014 (11:10 pm)
Got the keyboard events working now. Currently you will need to set the "canKeyFocus" field to true on the gui control's profile.

Next I'm working on adding a custom resource handler to handle requests relative to the game directory. The planned protocol will be asset://game, since doing absolute file:/// paths isn't useful when deploying the game.
#5
09/25/2014 (8:33 am)
Just out of curiousity, is there any sort of open source *lightweight* browser framework out there, that might support rendering simple html but not html5/flash/javascript etc? I've been fantasizing for years (since awesomium hit T3D) about replacing all my GUIs with simple html code and carrying it with me to every project I work on, but Chromium is so big and bloaty for what I actually want that I hesitate to make it the one.

Great job though, can't wait to try it out!
#6
09/25/2014 (9:40 am)
I don't think there's really anything out there that's lightweight. The only thing I can think of would be libRocket. CEF is open source with the BSD license, one of the reasons I'm using this instead of the Awesomium implementation.

The whole reason I'm doing the CEF integration is so I can make more complex and better looking GUI's than I can with Torque's default GUI controls. Eventually, I want to have it render to materials as well, so I can have animated textures for gauges and other things. The latest CEF supports all of the hardware compositing, so you can do CSS 3D transforms and WebGL (Features that Awesomium lacks).

Buckmaster, it looks like the CEF dependencies add up to around 57mb, I'm not sure how much the Torque3D executable size is affected though.
#7
09/26/2014 (9:32 am)
Wow, really cool work, thank you Scott! I will definitely have to move to this over Awesomium when you get it stabilized.