libShiva

Example: Hello World!

First thing you are required to do is initialize libShiva application. This is done by calling the static Initialize() function of the App class:

  App::Initialize();

Creation of a libShiva window is very simple. All we need to do is create a Window object with desired parameters:

  WindowRef wnd = new Window(400,400,"Hello World!");

The first two parameters specify the width and the height of our window. The last parameter specifies the title of the window. This can be later changed using SetTitle function:

  wnd->setTitle("Window title has been changed");

Note that WindowRef is actually a Smart Pointer. Internally it is defined as:

  typedef SmartPtr<Window> WindowRef;

Once you have created the window, you can run the application by calling the Start function of the App class:

  App::Start();

Upon this, the application will enter an event loop and block until an event happens or the window is closed. If everything went right, a libShiva window should pop-up looking like this: