[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.13.1 Quick Start

In order to startup and use AWS, currently, the following tasks need to be accomplished:

  1. Load the AWS plugin.

     
    aws = CS_LOAD_PLUGIN(plugin_mgr,
      "crystalspace.window.alternatemanager", iAws);
    

    Where aws is type iAws* (or csRef<iAws>).

  2. Setup the AWS canvas.

     
    awsCanvas = aws->SetupCanvas (0, myG2D, myG3D);
    

    Where myG2D and myG3D are your iGraphics2D and iGraphics3D cavas objects, respectively.

  3. Load definition files.

     
    aws->GetPrefMgr()->Load("./data/temp/awstest.def");
    

  4. Select a default skin that all windows will use.

     
    aws->GetPrefMgr()->SelectDefaultSkin("Normal Windows");
    

  5. Create and display your windows.

     
    iAwsWindow *test1 = aws->CreateWindowFrom("Splash");
    iAwsWindow *test2 = aws->CreateWindowFrom("Another");
    if (test1) test1->Show();
    if (test2) test2->Show();
    

  6. And finally you have to make sure it actually prints the output to the screen. So in your programs main drawing loop you input code similar to this:
     
    // Start drawing 2D graphics.
    if (!myG3D->BeginDraw (CSDRAW_2DGRAPHICS))
      return;
    // Make sure invalidated areas get a chance to
    // redraw themselves.
    aws->Redraw ();
    // Draw the current view of the window system to a
    // graphics context with a certain alpha value.
    aws->Print (myG3D, 64);
    

That's all there is to it. AWS is designed to be easy to use. Of course, this brief look does not illustrate how to get user input, from components in the windows, nor does it illustrate how to do anything other than display your windows. However, the windows created here are full-fledged windows with all the controls listed in the definition that you've created. For more advanced topics, read about signals (see section 7.13.2 Signals: Responding To User Input) and custom components (see section 7.13.3 Creating Custom AWS Components).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated using texi2html