Skip to content

Commit a725944

Browse files
author
Sven-Hendrik Haase
committed
Document recent changes to the SDL2_image port
With info taken from here: #3831
1 parent 42fb486 commit a725944

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

site/source/docs/compiling/Building-Projects.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Emscripten Ports is a collection of useful libraries, ported to Emscripten. They
174174
175175
You should see some notifications about SDL2 being used, and built if it wasn't previously. You can then view ``sdl2.html`` in your browser.
176176

177-
.. note:: *SDL_image* has also been added to ports, use it with ``-s USE_SDL_IMAGE=2``. To see a list of all available ports, run ``emcc --show-ports``.
177+
.. note:: *SDL_image* has also been added to ports, use it with ``-s USE_SDL_IMAGE=2``. To see a list of all available ports, run ``emcc --show-ports``. For SDL2_image in order to be useful, you need to specify the image formats you are planning on using with -s SDL2_IMAGE_FORMATS='["png"]'. This will also ensure that ``IMG_Init`` works properly. Alternatively, you can use specify ``emcc --use-preload-plugins`` but then you calls to ``IMG_Init`` will fail.
178178

179179
.. note:: Emscripten also has support for older SDL1, which is built-in. If you do not specify SDL2 as in the command above, then SDL1 is linked in and the SDL1 include paths are used. SDL1 has support for *sdl-config*, which is present in `system/bin <https://github.com/kripken/emscripten/blob/master/system/bin/sdl-config>`_. Using the native *sdl-config* may result in compilation or missing-symbol errors. You will need to modify the build system to look for files in **emscripten/system** or **emscripten/system/bin** in order to use the Emscripten *sdl-config*.
180180

0 commit comments

Comments
 (0)