Implementing the complete picture-puzzle game
Finally, we have all the parts at hand, and can combine them together into a puzzle game application.
Getting ready
Build and run the example 5_Puzzle
from the supplementary materials. This example, like others in this book, runs on Android as well as on Windows.
How to do it…
We start by augmenting our
3_UIPrototype
project with a new page,clPage_Gallery
. This page delegates rendering and updating to the globalg_Flow
object:class clPage_Gallery: public clGUIPage { public: … virtual void Render() { RenderDirect( g_Flow ); } virtual void Update(float DT) { g_Flow->FFlinger->Update(DT); } private: void RenderDirect( clPtr<clFlowUI> Control ); };
The
RenderDirect()
method is essentially a slightly modified version ofRenderDirect()
from the Implementing the animated 3D image selector recipe in this chapter. There are only two differences—we replace wireframe quad rendering with theclCanvas::Rect3D()
call (to render...