function initCanvas(%windowName)
{
   videoSetGammaCorrection($pref::OpenGL::gammaCorrection);
   if (!createCanvas(%windowName)) {
      quit();
      return;
   }

   setOpenGLTextureCompressionHint( $pref::OpenGL::compressionHint );
   setOpenGLAnisotropy( $pref::OpenGL::anisotropy );

   // Declare default GUI Profiles.
   exec("./ui/defaultProfiles.cs");

   // Common GUI's
   exec("./ui/ConsoleDlg.gui");

   // Commonly used helper scripts
   exec("./screenshot.cs");
   exec("./cursor.cs");
}

// required function: get console error without this
function resetCanvas()
{
   if (isObject(Canvas))
   {
      Canvas.repaint(); 
   }
}
