#########
Licensing
#########

You must specify a valid HOOPS Visualize Desktop license in your application code in order to use the HOOPS Visualize Desktop product. The license key is a character sequence either directly provided by Tech Soft 3D or generated using the "Generate Key" button located on the HOOPS Visualize Desktop downloads page in the Developer Zone.

If an invalid or expired license is set, your HOOPS Visualize Desktop-based application will exit when the application attempts to start. If you are using a time-bound evaluation license, the HOOPS Visualize Desktop viewport will display a small piece of text indicating that it's an evaluation license, and also display the number of days remaining until expiration.

Setting the License Key
-----------------------

The license should be compiled into your application via the ``HPS::World`` object, which initializes HOOPS Visualize Desktop. In C++, the license is delivered in a file called *hoops_license.h*. In C#, the license is set in a file called *hoops_license.cs*. Paste your license string into the ``HPS::World`` constructor.

.. tabs::

	.. code-tab:: c
	
		World world("[your unique license string]");
		
	.. code-tab:: csharp
		
		World world = new World("[your unique license string]");

Alternatively, users have the option of replacing the existing *hoops_license.h* or *hoops_license.cs* files in the *include* directory with the one from the Developer Zone, and passing the defined variable ``HOOPS_LICENSE`` to the ``HPS::World`` constructor.

The various samples and sandbox projects already reference *hoops_license.h* or *hoops_license.cs* for convenience, and you can simply copy your license file to your HOOPS Visualize Desktop installation's *include* directory.

**IMPORTANT:** Your application **must** instantiate the ``HPS::World`` object before interacting with HOOPS Visualize Desktop, and the object must stay in scope as long as the application continues to use HOOPS Visualize Desktop. For C# users, a static ``HPS::World`` object at the module level is recommended, due to the unpredictable nature of the .NET garbage collector.
