- Hands-On Game Development with WebAssembly
- Rick Battagline
- 187字
- 2021-06-24 13:41:06
Sprite Animations in WebAssembly with SDL
At the time of writing, Simple DirectMedia Layer (SDL) is the only 2D rendering library integrated into Emscripten for use in WebAssembly. But, even as more rendering libraries become available, SDL is a highly supported rendering library that has been ported to a large number of platforms and will remain both relevant and useful for WebAssembly and C++ development into the foreseeable future. Using SDL to render to WebGL saves us a tremendous amount of time, because we do not have to write the code to interface between our WebAssembly C++ code and WebGL ourselves. The large community also offers support and documentation. You can find more SDL resources online at libsdl.org.
You will need to include several images in your build to make this project work. Make sure you include the /Chapter04/sprites/ and /Chapter04/font/ folders from the project's GitHub. If you haven't yet downloaded the GitHub project, you can get it online from: https://github.com/PacktPublishing/Hands-On-Game-Development-with-WebAssembly.
We will cover the following topics in this chapter:
- Using SDL in WebAssembly
- Rendering a sprite to the canvas
- Animating a sprite
- Moving the sprite
推薦閱讀
- 筆記本電腦使用、維護與故障排除實戰
- Aftershot Pro:Non-destructive photo editing and management
- 龍芯應用開發標準教程
- Applied Unsupervised Learning with R
- 嵌入式技術基礎與實踐(第5版)
- 分布式微服務架構:原理與實戰
- Apple Motion 5 Cookbook
- OUYA Game Development by Example
- RISC-V處理器與片上系統設計:基于FPGA與云平臺的實驗教程
- 無蘋果不生活:OS X Mountain Lion 隨身寶典
- Python Machine Learning Blueprints
- STM32自學筆記
- Spring Security 3.x Cookbook
- Blender for Video Production Quick Start Guide
- 筆記本電腦維修技能實訓