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

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.

主站蜘蛛池模板: 天全县| 吉木乃县| 清水县| 青浦区| 英吉沙县| 潞西市| 改则县| 乌兰县| 泸西县| 永新县| 宁晋县| 泸州市| 淮南市| 潞西市| 澎湖县| 新野县| 衡东县| 行唐县| 名山县| 长武县| 昭苏县| 慈溪市| 宝鸡市| 崇明县| 桦甸市| 左云县| 宿松县| 九江县| 定远县| 湖口县| 磐石市| 醴陵市| 宜昌市| 福安市| 乌拉特中旗| 松阳县| 龙泉市| 育儿| 巴楚县| 南安市| 新竹县|