emcc编译选项

source: https://emscripten.org/docs/compiling/Building-Projects.html

To see a list of all available ports
emcc
 –show-ports

一、使用SDL_image

参考【1】用这个可以获得image宽、高,返回image data
Gets preloaded image data and the size of the image.

二、使用SDL_net
SDL_net has also been added to ports, use it with

三、编译优化
In order to properly optimize code, it is usually best to use the same optimization flags and other compiler options when compiling source to object code, and object code to JavaScript (or HTML).

 

参考:
1. emscripten.h
https://emscripten.org/docs/api_reference/emscripten.h.html#c.emscripten_get_preloaded_image_data