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

You must specify a valid |HPSNOW| license in your application code in order to use the |HPSNOW| 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 |HPSNOW| downloads page in the Developer Zone.

If an invalid or expired license is set, your |HPSNOW|-based application will exit when the application attempts to start. If you are using a time-bound evaluation license, the |HPSNOW| 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 |HPSNOW|. 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 |HPSNOW| installation's *include* directory.

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