<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wowcube.com/index.php?action=history&amp;feed=atom&amp;title=SDK_6.3%2FC%2B%2B%2FGraphics</id>
	<title>SDK 6.3/C++/Graphics - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wowcube.com/index.php?action=history&amp;feed=atom&amp;title=SDK_6.3%2FC%2B%2B%2FGraphics"/>
	<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK_6.3/C%2B%2B/Graphics&amp;action=history"/>
	<updated>2026-07-26T22:45:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0</generator>
	<entry>
		<id>https://wiki.wowcube.com/index.php?title=SDK_6.3/C%2B%2B/Graphics&amp;diff=16967&amp;oldid=prev</id>
		<title>WowBot: Split C++ Native API into per-module pages with minimal examples (WowBot)</title>
		<link rel="alternate" type="text/html" href="https://wiki.wowcube.com/index.php?title=SDK_6.3/C%2B%2B/Graphics&amp;diff=16967&amp;oldid=prev"/>
		<updated>2026-07-26T09:47:45Z</updated>

		<summary type="html">&lt;p&gt;Split C++ Native API into per-module pages with minimal examples (WowBot)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{notice|'''Official WOWCube SDK documentation.''' SDK 6.3, C++ (WebAssembly) API. Signatures are extracted from the canonical SDK headers shipped with the WOWCube Development Kit; the headers remain authoritative.}}&lt;br /&gt;
&lt;br /&gt;
{{SDK 6.3 nav}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''← [[SDK 6.3]] · [[SDK 6.3/C++/Native API|C++ Native API]] / Graphics''&lt;br /&gt;
&lt;br /&gt;
Immediate-mode drawing on the module's displays: primitives, images, text, shaders, QR codes and render targets. (The retained alternative is the [[SDK 6.3/C++/GFX Engine|GFX Engine]].)&lt;br /&gt;
&lt;br /&gt;
Shared types, enums and constants are listed on the [[SDK 6.3/C++/Native API#Types and data structures|Native API overview]].&lt;br /&gt;
&lt;br /&gt;
== Minimal example ==&lt;br /&gt;
&lt;br /&gt;
From the official ''HelloWOWCube'' project — direct drawing in &amp;lt;code&amp;gt;on_Render&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 for(auto it = screens.begin(); it != screens.end(); ++it)&lt;br /&gt;
 {&lt;br /&gt;
     GFX_setRenderTarget(it-&amp;gt;ID());&lt;br /&gt;
     GFX_clear(Colors::black);&lt;br /&gt;
     GFX_drawText(120, 100, TEXT_SIZE, 0, text_align_t::TEXT_ALIGN_CENTER, Colors::white, &amp;quot;HELLO&amp;quot;);&lt;br /&gt;
     GFX_render();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
===GFX_getAssetId===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_getAssetId(const char* spriteName)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Get an image ID by the filename.&lt;br /&gt;
: Usually an application uses image IDs to draw sprites and backgrounds. But&lt;br /&gt;
: sometimes IDs are unknown, e.g. in common libraries, or they change rapidly&lt;br /&gt;
: during development. This interface can be used to get an ID of the image by&lt;br /&gt;
: its filename in the runtime. Maximum asset name length is 15 characters,&lt;br /&gt;
: remaining symbols are truncated during lookup.&lt;br /&gt;
&lt;br /&gt;
Return values:&lt;br /&gt;
: The ID of image with a given filename or -1 in case of error.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - renamed from GFX_getId() to GFX_getAssetId()&lt;br /&gt;
: v6.0 - truncate asset name in WASM API&lt;br /&gt;
&lt;br /&gt;
===GFX_clear===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_clear(u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Clear a layer with a given color.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - changed color format&lt;br /&gt;
&lt;br /&gt;
===GFX_drawText===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawText(i32_t x, i32_t y, u32_t scale, u32_t angle, u32_t align, u32_t color, const char* text)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a formatted text by the specified coordinates with a given color,&lt;br /&gt;
: scale, text align and a rotation angle.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - clarified documentation, added GFX_drawTextXY() alias&lt;br /&gt;
&lt;br /&gt;
===GFX_drawPoint===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawPoint(i32_t x, i32_t y, u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a point specified by its coordinates with a given color.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawPointXY() alias&lt;br /&gt;
&lt;br /&gt;
===GFX_drawCircle===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawCircle(u32_t x, u32_t y, u32_t radius, u32_t width, u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a circle at the given point with given radius, color and line width.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawCircleXY() alias&lt;br /&gt;
&lt;br /&gt;
===GFX_drawSolidCircle===&lt;br /&gt;
:'''Deprecated.''' use fill shader intead&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawSolidCircle(u32_t x, u32_t y, u32_t radius, u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a solid circle at the given point with given radius and color.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawSolidCircleXY() alias&lt;br /&gt;
: v6.0 - DEPRECATED, use GFX_setFillShader() instead&lt;br /&gt;
&lt;br /&gt;
===GFX_drawArc===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawArc(i32_t x, i32_t y, u32_t radius, u32_t width, u32_t angle0, u32_t angle1, u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw an arc at the given point with given radius, line width, color and&lt;br /&gt;
: angles.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawArcXY() alias&lt;br /&gt;
&lt;br /&gt;
===GFX_drawSector===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawSector(i32_t x, i32_t y, u32_t radius, u32_t angle0, u32_t angle1, u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a filled circular sector, connecting the arc to the circle's center&lt;br /&gt;
: like a piece of pie.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.1 - created&lt;br /&gt;
&lt;br /&gt;
===GFX_drawLine===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawLine(i32_t x0, i32_t y0, i32_t x1, i32_t y1, u32_t thickness, u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a line with from a given point to another one and given width and&lt;br /&gt;
: color.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawLineXY() alias&lt;br /&gt;
&lt;br /&gt;
===GFX_drawRectangle===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawRectangle(i32_t x, i32_t y, i32_t w, i32_t h, u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a solid rectangle at a given position with specified dimensions and a&lt;br /&gt;
: color.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawRectangleXY() alias&lt;br /&gt;
&lt;br /&gt;
===GFX_bakeImage===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_bakeImage(spriteID_t id, u32_t width, u32_t height, GFX_PixelFormat_t format, u32_t overwrite)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Set an ID of a memory buffer to save next rendering result.&lt;br /&gt;
: Specifies the image that will be created by combining the group of&lt;br /&gt;
: graphical primitives used between GFX_bakeImage() and GFS_render()&lt;br /&gt;
: according their order and taking into account alpha channel in images. HW&lt;br /&gt;
: has a limitation and can combine no more than 4 layers simultaneously, so&lt;br /&gt;
: if there are more primitives then they will be combined in a cascade.&lt;br /&gt;
: Useful for creating complex images like backgrounds for later usage.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added overwrite parameter&lt;br /&gt;
&lt;br /&gt;
===GFX_setRenderTarget===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_setRenderTarget(u32_t display)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Set a screen which will be used to display next rendering result.&lt;br /&gt;
: Cube module is a special device which has 3 independent screens to display&lt;br /&gt;
: graphics. GFX_setRenderTarget() specifies a screen number which will be&lt;br /&gt;
: used to display a next rendering result. Graphics primitives used in&lt;br /&gt;
: between GFX_setRenderTarget() and GFX_render() calls will be combined&lt;br /&gt;
: together according their order and taking into account alpha channel in&lt;br /&gt;
: images. Resulting image will be immediately flushed onto the given screen.&lt;br /&gt;
: HW has a limitation and can combine no more than 4 layers simultaneously,&lt;br /&gt;
: so if there are more primitives then they will be combined in a cascade. To&lt;br /&gt;
: display anything on the screen GFX_setRenderTarget() has to be always&lt;br /&gt;
: called.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - renamed from GFX_updateDisplay() to GFX_setRenderTarget()&lt;br /&gt;
&lt;br /&gt;
===GFX_drawImage===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawImage(spriteID_t id, i32_t x, i32_t y, u32_t opacity, u32_t colorKey, u32_t scale_x, u32_t scale_y, u32_t angle, u32_t mirror)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw an image from application assets at a specified position and with&lt;br /&gt;
: given transformations.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawImageXY() alias, color argument clarified&lt;br /&gt;
: v6.0 - added scale parameters&lt;br /&gt;
&lt;br /&gt;
===GFX_drawBakedImage===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawBakedImage(i32_t x, i32_t y, u32_t opacity, u32_t colorKey, u32_t scale_x, u32_t scale_y, u32_t angle, u32_t mirror, spriteID_t id)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a previously baked image at a specified position and with given&lt;br /&gt;
: transformations.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - added GFX_drawBakedImageXY() alias, color argument clarified&lt;br /&gt;
: v6.0 - added scale parameters&lt;br /&gt;
&lt;br /&gt;
===GFX_drawQrCode===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawQRCode(i32_t x, i32_t y, u32_t size, u32_t color0, u32_t color1, u32_t angle, u32_t id, const char *text)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Generate and draw QR-code for a given text string.&lt;br /&gt;
: Supported version 2 which is limited by 32 characters of input.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added&lt;br /&gt;
&lt;br /&gt;
===GFX_render===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_render()&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Start rendering process.&lt;br /&gt;
&lt;br /&gt;
===GFX_clearCache===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_clearCache()&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Clear all cached images.&lt;br /&gt;
: Oldest accessed image cache will be automatically freed if there is not&lt;br /&gt;
: enough memory to cache a new image. This function forces this process, e.g.&lt;br /&gt;
: when switch game levels.&lt;br /&gt;
&lt;br /&gt;
===GFX_removeBakedImage===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_removeBakedImage(spriteID_t id)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Remove specified baked image from cache.&lt;br /&gt;
: Baked images do not automatically invalidate. This function allows to&lt;br /&gt;
: remove any baked image from cache to save some space.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added&lt;br /&gt;
&lt;br /&gt;
===GFX_cacheImages===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_cacheImages(spriteID_t* spriteIDs, u32_t count)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Force platform to cache application images.&lt;br /&gt;
: Platform automatically reads and caches images from flash when the&lt;br /&gt;
: application draws an image. Flash operations are synchronous and may cause&lt;br /&gt;
: delays especially when reading large portions of data. To prevent the&lt;br /&gt;
: application from lags it is possible to cache image data in advance.&lt;br /&gt;
: However if application requests to draw a non-cached image and there is not&lt;br /&gt;
: enough memory then oldest accessed images will be removed from cache. Also&lt;br /&gt;
: there is a limit of 256 for a total number of cached images.&lt;br /&gt;
&lt;br /&gt;
Return values:&lt;br /&gt;
: Number of cached images or negative value if an error happened. Error&lt;br /&gt;
: codes:&lt;br /&gt;
: * -1 invalid function arguments count&lt;br /&gt;
: * -2 invalid imageList array&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v5.0 - moved from appCtrl module to graphics&lt;br /&gt;
&lt;br /&gt;
===GFX_setFpsWindow===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_setFpsWindow(u32_t size)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Set the averaging window (in frames) used by the on-screen FPS counter (see &amp;lt;code&amp;gt;Application::ShowFPSCounter()&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
===GFX_getAssetsCount===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_getAssetsCount()&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Get the total count of graphic assets.&lt;br /&gt;
&lt;br /&gt;
Return values:&lt;br /&gt;
: Number of graphic assets.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added&lt;br /&gt;
&lt;br /&gt;
===GFX_setFillShader===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_setFillShader(u32_t color)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Fill next primitives with specified color.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added primitives shading&lt;br /&gt;
&lt;br /&gt;
===GFX_setLinearGradientShader===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_setLinearGradientShader(u32_t x0, u32_t y0, u32_t x1, u32_t y1, u32_t color0, u32_t color1)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Fill next primitives with linear gradient from a given point / color to&lt;br /&gt;
: another one.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added primitives shading&lt;br /&gt;
&lt;br /&gt;
===GFX_setRadialGradientShader===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_setRadialGradientShader(u32_t x0, u32_t y0, u32_t radius, u32_t color0, u32_t color1)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Fill next primitives with radial gradient from a given point with radius&lt;br /&gt;
: and from a given color to another one.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added primitives shading&lt;br /&gt;
&lt;br /&gt;
===GFX_removeShader===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_removeShader()&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Do not use shading in next primitives.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.0 - added primitives shading&lt;br /&gt;
&lt;br /&gt;
===GFX_drawSubImage===&lt;br /&gt;
Syntax:&lt;br /&gt;
 i32_t GFX_drawSubImage(spriteID_t id,i32_t x,i32_t y,u32_t rect_x,u32_t rect_y,u32_t rect_w,u32_t rect_h,u32_t opacity,u32_t colorKey,u32_t scale_x, u32_t scale_y,u32_t angle, u32_t mirror)&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
: Draw a sub window of an image from application assets at a specified&lt;br /&gt;
: position and with given transformations.&lt;br /&gt;
&lt;br /&gt;
History:&lt;br /&gt;
: v6.2 - added&lt;br /&gt;
&lt;br /&gt;
[[Category:SDK 6.3]]&lt;br /&gt;
[[Category:C++ API]]&lt;/div&gt;</summary>
		<author><name>WowBot</name></author>
		
	</entry>
</feed>