After loading the plugins you could use the following code snippet:
// We need a View to the virtual world.
view.AttachNew(new csView (engine, g3d));
iGraphics2D* g2d = g3d->GetDriver2D ();
// We use the full window to draw the world.
view->SetRectangle (0, 0, g2d->GetWidth (), g2d->GetHeight ());
// Get splash image file from configuration file
const char* splashFile = cfg->GetStr ("Credosim.Settings.SplashScreenFile","");
if (splashFile)
{
// Load splash screen
loader->LoadTexture ("splash", splashFile);
// Create a 2D sprite
iTextureWrapper *texWrapper;
iTextureHandle* phTexHandle;
csPixmap* csSplash;
texWrapper = engine->GetTextureList ()->FindByName ("splash");
if (texWrapper)
{
texWrapper->SetFlags (CS_TEXTURE_2D);
phTexHandle = texWrapper->GetTextureHandle();
if (phTexHandle)
{
csSplash = new csSimplePixmap (phTexHandle);
g2d->BeginDraw();
csSplash->DrawScaled (g3d, 0, 0, g2d->GetWidth(), g2d->GetHeight());
g3d->FinishDraw();
const csRect area;
g3d->Print(&area);
}
}
}
// Here we load our world from a map file.
if (!LoadMap ()) return false;