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

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.

主站蜘蛛池模板: 大英县| 皮山县| 山西省| 儋州市| 宣汉县| 亳州市| 梁平县| 内江市| 乌兰浩特市| 太仆寺旗| 阳信县| 黄平县| 山阴县| 吉林省| 昌平区| 平顺县| 马鞍山市| 柯坪县| 临夏市| 白玉县| 屯昌县| 崇左市| 乐山市| 醴陵市| 东莞市| 青阳县| 玉门市| 枝江市| 汤原县| 姜堰市| 玉屏| 洛扎县| 安阳县| 额敏县| 沙雅县| 台安县| 祁阳县| 肃北| 洪泽县| 乐东| 海盐县|