Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Awesomium Wrapper  (Read 5469 times)
0 Members and 1 Guest are viewing this topic.
Offline badlogicgames
« Posted 2010-12-21 03:05:52 »

Hi,

i wrote a C-wrapper for the C++ API of Awesomium. I made it a Google Code project. Based on that wrapper i wrote a JNA bridge so we can have nice things in Java as well.

You can find the code for it at here as part of libgdx. It's totally self-contained though with only a dependency to JNA. The code is Apache 2 and the version of awesomiumc i use i license as Apache 2 as well Smiley So the Java wrapper is totally free to use. The only caveat is that Awesomium itself is only free for non-commercial projects, indie licenses are 300$ atm.

So what is this all about? Here's an image:


This is an OpenGL Java application displaying the output of Awesomium on a simple quad. I also inject keyboard and mouse events into the Awesomium instance. As you can see it renders a Youtube video (it also plays audio of course). Awesomium is an off-screen web engine based on Chromium that is intended to be used for apps like games. We can use this in Java now as well. There's a couple of restrictions though:

- Windows only at the moment. Awesomium also supports MacOS but i don't have a Mac to compile the c-wrapper on. Volunteers welcome.
- 32-bit only at the moment. This is again a limitation of Awesomium itself, you'll need a 32-bit VM to run any app using Awesomium. No idea whether that will change in the future.

I expose almost all the original Awesomium classes and interfaces except for the ResourceIntercepter stuff that allows you to inject your own resources. Interaction with the V8 Javascript engine is in the c-wrapper but not yet fully implemented in the Java wrapper. I'll add that asap.

Here you can download a self-contained jar. It's 20mb due to the shared lib of Awesomium being a huge mofo. My server is slow so give it some time. Once downloaded put it in its own folder as it will unpack a couple of things. Start it up (on a 32-bit VM) and browse away. I don't pipe all keycodes to Awesomium yet, the same is true for the scrollwheel events. Other than that everything should work. Oh, you can also resize the window for profit...

The code for that little demo based on libgdx can be found at http://code.google.com/p/libgdx/source/browse/trunk/extensions/awesomium/gdx-awesomium-tests/src/com/badlogic/gdx/awesomium/GLTest.java?r=1251. Yes, it is not the most beautiful code ever but it does the job.

I plan on wrapping Berkelium as well as its BSD and available for all mainstream OS out there. Will take some time.

http://www.badlogicgames.com - musings on Android and Java game development
Offline kappa
« League of Dukes »

JGO Kernel


Medals: 74
Projects: 15


★★★★★


« Reply #1 - Posted 2010-12-21 10:28:40 »

oh super cool stuff, webkit inside opengl java Smiley

Should be really cool for stuff that ppl usually struggle with in OpenGL like GUI's, playing video and in game web content.
Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #2 - Posted 2010-12-21 13:00:00 »

Hi badlogic, I seem to recall contacting you a few months ago about this very thing! But you never replied :/

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline badlogicgames
« Reply #3 - Posted 2010-12-21 14:46:26 »

Hi Cas,

i don't remember you contacting me as i started that wrapper thing just 2 days ago.  Huh

ciao,
Mario

edit: oh just to clarify. I'm not part of the Awesomium project/Khrona. I just used their stuff and wrote a c-wrapper around their C++ API.

http://www.badlogicgames.com - musings on Android and Java game development
Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #4 - Posted 2010-12-21 15:59:11 »

Ah that'd be it then Smiley I contacted the Awesomium devs and asked if they might be interested in doing a Java port for the LWJGL project but they declined to reply. I think they thought I was some sort of fruitcake.

Cas Smiley

Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #5 - Posted 2010-12-21 19:52:39 »

I think they thought I was some sort of fruitcake.
Well, that's not really far off it is?

Offline princec

JGO Kernel


Medals: 339
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #6 - Posted 2010-12-21 20:42:08 »

I suppose not. I'm pretty keen on Awesomium but it's got to play nice with LWJGL, and it's got to work on i386, x64, Linux 32 and 64bit too, Mac OS PPC and Intel.

Cas Smiley

Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #7 - Posted 2010-12-21 22:54:22 »

Cool stuff! I'm more interested in Berkelium though.

Offline badlogicgames
« Reply #8 - Posted 2010-12-22 01:37:12 »

Yes, i'm also more interested in Berkelium. I'll see what i can do. Not a priority at the moment. But the API is similar and should be easily wrappable as well.

http://www.badlogicgames.com - musings on Android and Java game development
Pages: [1]
  ignore  |  Print  
 
 

 
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!