![Josh](http://leadwerksstorage.s3.us-east-2.amazonaws.com/monthly_2022_11/josh_thuglife.thumb.jpg.1828f83a34b4decf0f4655ac21bf8e9b.jpg)
One interesting aspect of this design is code like that below works perfectly fine. See if you can work through it and understand what's going on:
int main(int argc, const char *argv[]) { //Create a model ;) auto box = CreateBox(nullptr); //Create the world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->Move(0,0,-5); //Create an instance of the model in the new world auto model = box->Instance(world); //Create a window auto window = CreateWindow(); //Create a rendering context auto context = CreateContext(window); while (not window->Closed()) { if (window->KeyDown(KEY_ESCAPE)) window->Close(); world->Update(); world->Render(context); } return 0; }
- Read more...
- 5 comments
- 3,977 views