官术网_书友最值得收藏!

The graphics engine

This book isn't about creating a graphics engine but we do need one to draw to the screen. Similar to how the M5App class encapsulates important OS function calls, our M5Gfx class encapsulates our graphics API. We want to make sure there is a clear separation between any API calls and our game logic. This is important so we can port our game to another system. For example, we may want to develop our game for PC, XBox One, and PlayStation 4. This will mean supporting multiple graphics APIs since a single API isn't available for all platforms. If our game logic contains API code, then those files will need to be modified for every platform.

We won't be going deep into the details of how to implement a full graphics engine, but we give an overview of how graphics works. Think of this as a primer to the world of graphics engines.

This class allows us manipulate and draw textures, as well as control the game camera and find the visible extents of the world. M5Gfx also manages two arrays of graphics components, one for world space and one for screen space. The most common use of the screen space components is for creating User Interface (UI) elements such as buttons.

主站蜘蛛池模板: 肇州县| 屏东市| 吉隆县| 石首市| 三明市| 长汀县| 申扎县| 新宾| 新平| 惠州市| 济源市| 霸州市| 石渠县| 仁化县| 宁远县| 天台县| 武威市| 双桥区| 苍山县| 卢龙县| 沙洋县| 海门市| 克什克腾旗| 延庆县| 日喀则市| 周口市| 永年县| 台北市| 湘乡市| 天峨县| 通州区| 鄂尔多斯市| 贺州市| 宕昌县| 如东县| 肃南| 灵台县| 札达县| 呼和浩特市| 郑州市| 肇东市|