Renamed SHTextRenderer and to SHTextRenderable and added C# interface #239

Merged
Pycorax merged 4 commits from SP3-6-c-scripting into main 2022-11-22 01:19:52 +08:00
3 changed files with 46 additions and 21 deletions
Showing only changes of commit 07efa1ab51 - Show all commits

View File

@ -21,6 +21,17 @@ of DigiPen Institute of Technology is prohibited.
namespace SHADE
{
/*---------------------------------------------------------------------------------*/
/* Explicit Tempalte Instantiations */
/* Properties */
/*---------------------------------------------------------------------------------*/
GenericHandle Asset::NativeObjectHandle::get()
{
return nativeObjHandle;
}
/*---------------------------------------------------------------------------------*/
/* Constructors */
/*---------------------------------------------------------------------------------*/
Asset::Asset(Handle<void> nativeHandle)
: nativeObjHandle { Convert::ToCLI(Handle<void>(nativeHandle)) }
{}
}

View File

@ -24,11 +24,6 @@ namespace SHADE
/* Properties */
/*---------------------------------------------------------------------------------*/
template <typename NativeAssetType>
GenericHandle NativeAsset<NativeAssetType>::NativeObjectHandle::get()
{
return nativeObjHandle;
}
template <typename NativeAssetType>
Handle<NativeAssetType> NativeAsset<NativeAssetType>::NativeObject::get()
try
{
@ -44,7 +39,6 @@ namespace SHADE
/*---------------------------------------------------------------------------------*/
template <typename NativeAssetType>
NativeAsset<NativeAssetType>::NativeAsset(Handle<NativeAssetType> nativeObj)
: nativeObjHandle{ Convert::ToCLI(Handle<void>(nativeObj)) }
: Asset { Handle<void>(nativeObj) }
{}
}

View File

@ -19,13 +19,9 @@ of DigiPen Institute of Technology is prohibited.
namespace SHADE
{
/// <summary>
/// Generalised template class for a managed representation of a native asset
/// Abstract base class that all Native Assets will inherit from.
/// </summary>
/// <typeparam name="NativeAssetType">
/// The type of the asset's native representation.
/// </typeparam>
template<typename NativeAssetType>
public ref class NativeAsset
public ref class Asset abstract
{
internal:
/*-----------------------------------------------------------------------------*/
@ -38,6 +34,36 @@ namespace SHADE
{
GenericHandle get();
}
/*-----------------------------------------------------------------------------*/
/* Constructors/Destructor */
/*-----------------------------------------------------------------------------*/
/// <summary>
/// Constructor for the asset.
/// </summary>
/// <param name="ptr">Native asset object handle.</param>
Asset(Handle<void> nativeHandle);
protected:
/*-----------------------------------------------------------------------------*/
/* Data Members */
/*-----------------------------------------------------------------------------*/
GenericHandle nativeObjHandle;
};
/// <summary>
/// Generalised template class for a managed representation of a native asset
/// </summary>
/// <typeparam name="NativeAssetType">
/// The type of the asset's native representation.
/// </typeparam>
template<typename NativeAssetType>
public ref class NativeAsset abstract : Asset
{
internal:
/*-----------------------------------------------------------------------------*/
/* Properties */
/*-----------------------------------------------------------------------------*/
/// <summary>
/// Copy of the Handle to the native object.
/// </summary>
@ -52,14 +78,8 @@ namespace SHADE
/// <summary>
/// Constructor for the native asset
/// </summary>
/// <param name="ptr">Native asset object.</param>
/// <param name="ptr">Native asset object handle.</param>
NativeAsset(Handle<NativeAssetType> ptr);
protected:
/*-----------------------------------------------------------------------------*/
/* Data Members */
/*-----------------------------------------------------------------------------*/
GenericHandle nativeObjHandle;
};
}