powerful and flexible 2d game engine written in C++ with a custom scripting language

#game-engine #gameengine #gamedev #engine #2d #cpp #scripting #opengl

James Urquhart dac8a599fa Don't dump string table in emscripten build 12 ani în urmă
engine dac8a599fa Don't dump string table in emscripten build 12 ani în urmă
modules 21b86e342d Revert "Hand merging rnd branch, which is just Leap Motion support and input improvements. This will temporarily break the other platforms, which I will fix immediately." 12 ani în urmă
tools d68dc83b2f Cleanup files that did merge properly 12 ani în urmă
tutorials ba0ec5d9ff tutorial tweaks that are not necessary but will make the tutorial a bit easier: 12 ani în urmă
.gitignore c1fd59d755 Added the temp files from eclipse to gitignore 12 ani în urmă
OpenAL32.dll a20f2864a1 - First push of Torque 2D 2.0 (MIT) 13 ani în urmă
README.md bf439c7c35 Update README so people know how to use this! 12 ani în urmă
cleandso.bat a20f2864a1 - First push of Torque 2D 2.0 (MIT) 13 ani în urmă
main.cs 9ba5b1b190 Added keyboard closing support and a fix for the NDK bug that locks up the app when closing keyboard 12 ani în urmă
main.runAllUnitTests.cs a20f2864a1 - First push of Torque 2D 2.0 (MIT) 13 ani în urmă
sandbox.torsion a20f2864a1 - First push of Torque 2D 2.0 (MIT) 13 ani în urmă
unicows.dll a20f2864a1 - First push of Torque 2D 2.0 (MIT) 13 ani în urmă

README.md

Torque2D

MIT Licensed Open Source version of Torque 2D from GarageGames.

You can find the main Wiki page here

This branch is dedicated to making stuff work in Emscripten. In order to compile you'll need the following:

  • Emscripten
  • Modified Emscripten libraries (to fix OpenAL and OpenGL)
  • CMake
  • Pre-generated font files
  • Web server to run the resulting page

The required font files as well as emscripten changes are all supplied in a downloadable archive

Setting up Emscripten

NOTE: these instructions assume you are using a Linux or OS X box. Other platforms may vary.

First you need to install emscripten itself. The emscripten wiki is a good starting point.

You also may need to modify emscriptens library_gl.js and library_openal.js in order to add some missing functionality to OpenAL and remove a rather annoying OpenGL logger statement. Modified versions of both files as well as a diff are included in the downloadable archive.

Note that the build has only been tested from emscripten built from commit 1a007b1631509b9d72499a8f4402294017ee04dc with the supplied changes, though you should be able to use later versions as well. The emscripten changes may or may not be required in a later emscripten build.

When you have the emscripten toolchain setup, you'll need to modify engine/compilers/emscripten/generate.sh and engine/compilers/emscripten/generate_release.sh in order to point it to the emscripten toolchain. For example if you have emscripten installed in /Users/kork/emscripten, the top should look like this:

EMSCRIPTEN_PATH=/Users/kork/emscripten

Before building, make sure you have generated all the neccesary font files. The current list of fonts required is stored in the "FontAssetFiles" list in emscripten/assets/CMakeLists.txt. Failing that the downloadable archive includes a prebuilt set of required font files.

When you are ready to build, run the following from a terminal:

cd engine/compilers/emscripten
sh ./generate.sh
make

Or if you want to make a release build:

cd engine/compilers/emscripten
sh ./generate_release.sh
make

After a long while you should get several files in the emscripten folder, the most important ones being "Torque2D.html", "Torque2D.js" and "Torque2D.data". If you want to test things out, simply copy these files to a web server and open Torque2D.html. Alternatively you can use python to start a http server and check it out, e.g.:

python -m SimpleHTTPServer

Then open http://(the address)/Torque2D.html

Have fun!