C2 Wrapper EXE in C#

0 favourites
  • 8 posts
From the Asset Store
A cool way for kids to write and practice English Alphabets
  • Hi Guy's,

    The PoC I did in python ( Previous post ) but it wasn't very practical. My next attempt was to write a C2 wrapper in C# using webkit (via OpenWebkitSharp)that would let your C2 projects look and behave a bit more like exe's.

    Essentially it's like having a webbrowser with no distracting controls on it to display your files on the desktop, in a way that makes it look like an ordinary application.

    <img src="http://dl.dropbox.com/u/41800350/desktop_sblaster.JPG" border="0">

    I tried using the inbuilt browser object in C# but it gave an error saying my browser could not render HTML5, I think it's cause I don't have IE 9 yet, so I'll need to do more testing.

    To get it going you just need to unpack the zip and edit the settings.ini file (even if you are just testing the copy of Space Blaster included).

    I've bundled it all up along with the source code and the HTML5 of Space Blaster as C2WebkitWrapper.zip (40 mb). All my test games worked OK but they arn't as intensive as something like Space Blaster so it was a good test. On my laptop I do get some lag here and their playing Space Blaster, but all in all the controls and sound are good. I've included a copy of space blaster in the package so you can see how it hangs together.

    I've also included a Settings.ini configuration file. This let's you customize a few aspects of the Wrapper (I have to think of a better name). Like:

    Name - Let's you customize what's written in the title bar.

    Url - This is the location of you C2 exported game files, this can be on the local disk or on the internet. Local locations start with file:// instead of http://

    Screen size: Adjusts the size of the exe's screen to suit your game.

    Thoughts:

    There's embedded versions of Mozilla's Gecko which I could try.

    Also OpenWebkitSharp can use nightly releases of webkit that would probably run a lot quicker than the default Cairo 0.5. Also there's Awesomium (awesomium.com) that let's you embed chrome but it has a licence and it might get messy.

    If I do get the embeded IE working it's not a great solution as you would have to ensure people are running something like IE 9, I'll post the results of that one as it's pretty easy to do.

    In my mind the best mix would be something like webkit, C++ and GTK.

    You could then compile for windows and Linux.

  • This is really interesting. Great work! How's the performance?

  • Hard to say, Space blaster is laggy but a lot of other games I tried were fine. I think there's better versions of webkit I could be using as well, but early indications are promising.

  • Great work! Very interesting stuff. I suppose it will work better if you enable 'fullscreen in browser' then just set the window size to match the game window size - then you shouldn't get any white margins.

    Do these embedded browsers have hardware acceleration? I'm not sure if that comes with webkit/gecko, or if it's part of the browser itself. Hardware acceleration is a biggie.

  • I think the speed will vary from each implementation of webkit, the best would be to use c++, the python/GTK version plays Space Blaster with no lag but I couldn't get sound working.

    I used Sunspider to do some bench marking as it also does 3d tests.

                Comparison        Webkit C#(OpenWebkitSharp)    Chrome(13)

    3d:        2.45x as fast     102.8ms +/- 12.4%          42.0ms +/- 8.1%

    cube:       2.54x as fast      32.8ms +/- 34.4%          12.9ms +/- 22.8%     

    morph:      2.49x as fast      33.3ms +/- 40.3%          13.4ms +/- 8.4%    

    raytrace:   2.34x as fast      36.7ms +/- 39.2%          15.7ms +/- 7.4%     

    As you can see Chrome is consistently twice as fast.

    But as far as 3d acceleration goes, I'm doing this on a laptop running XP with a 3D card but not sure if it's being used. But for what I have read webkit does do 3D acceleration.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • <img src="smileys/smiley4.gif" border="0" align="middle" />

  • leozin: The thread is from 2011

    Yesterday the latest beta release that already provides a promising new solution to wrap to exe node webkit: r115 was released.

    Please check the date of the threads in the future please.

  • Kyatric Sorry!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)