Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Proof of concept: WME lite engine running in browser  (Read 183 times)

0 Members and 1 Guest are viewing this topic.

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 163
    • View Profile
Proof of concept: WME lite engine running in browser
« on: October 13, 2018, 06:16:59 PM »

Hi,

I have created a proof-of-concept port of WMElite to run in a (modern) browser. You can check it out here:

http://wmelite.bplaced.net/wmelitedemo/test.html

The port is using Emscripten https://github.com/kripken/emscripten to compile the engine C++ code plus dependencies into JavaScript. Although I have not yet spent a lot of time for optimizations, it already seems to work well, without using too much resources. Nevertheless, there will likely be bugs.

Please try it and let me know what you think.
Logged

Mikael

  • Supporter
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 124
    • View Profile
    • MDNA Games
Re: Proof of concept: WME lite engine running in browser
« Reply #1 on: October 14, 2018, 06:15:07 AM »

Impressive! Works flawlessly here.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5677
    • View Profile
    • Dead:Code Site
Re: Proof of concept: WME lite engine running in browser
« Reply #2 on: October 14, 2018, 09:00:45 AM »

Wow, I didn't expect to see anything like that. That's awesome. How does it translate the graphics/sound stuff?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 163
    • View Profile
Re: Proof of concept: WME lite engine running in browser
« Reply #3 on: October 14, 2018, 09:44:54 AM »

Wow, I didn't expect to see anything like that. That's awesome. How does it translate the graphics/sound stuff?

The overall concept of WMElite hasn't changed since you created it, with the exception of replacing BASS by SDL_Mixer, and the addition of audio processing libraries for sound effects. I did not need to do sth special for this port to work.

The major work is done by SDL2, audio is provided by SDL_Mixer, images by the freeimage library and true type fonts by the freetype library.

All the libraries and the WMElite engine compile with minor modifications using the emscripten tools.

The data.dcp is preloaded and provided in something called "emscripten virtual file system", eliminating the need to adjust file system operations in the WMElite engine.

So it's basically the emscripten port of SDL2 that does all the translation work, from opengles2 to webgl, and also handles audio output somehow. I did not even have to look at how it is done, it "just worked". (Well, ok, I had to adjust the game main loop, emscripten wants to use it as callback, an endless loop would block the browser).
Logged

lacosaweb

  • Regular poster
  • ***
  • Karma: 1
  • Offline Offline
  • Posts: 112
    • View Profile
Re: Proof of concept: WME lite engine running in browser
« Reply #4 on: October 16, 2018, 02:36:43 PM »

Great job! This is amazing!

Thank you!  ;)
Logged

Jerrot

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 689
    • View Profile
Re: Proof of concept: WME lite engine running in browser
« Reply #5 on: Yesterday at 06:36:07 PM »

Hah! Impressive!  :)
Logged
Mooh!
 

Page created in 0.143 seconds with 22 queries.