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

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.

主站蜘蛛池模板: 舞钢市| 晋州市| 儋州市| 白山市| 华亭县| 外汇| 晋江市| 来凤县| 阿坝县| 永泰县| 宿州市| 耒阳市| 江口县| 都江堰市| 揭西县| 茂名市| 新建县| 九江市| 睢宁县| 乌拉特后旗| 江都市| 乡宁县| 广东省| 澳门| 浦东新区| 新乐市| 苍山县| 青铜峡市| 墨竹工卡县| 浪卡子县| 永川市| 德昌县| 安丘市| 滦南县| 北辰区| 汉中市| 佛山市| 茌平县| 富民县| 疏附县| 广州市|