Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

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

0 Members and 1 Guest are viewing this topic.

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • 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: 127
    • 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: 5683
    • 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: 168
    • 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: 116
    • 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: 690
    • View Profile
Re: Proof of concept: WME lite engine running in browser
« Reply #5 on: October 19, 2018, 06:36:07 PM »

Hah! Impressive!  :)
Logged
Mooh!
 

Page created in 0.037 seconds with 19 queries.