Refactor native core objects to simplify usage for newcomers
This commit is contained in:
@@ -13,13 +13,13 @@
|
||||
/// <summary>
|
||||
/// Interface for GPU device adapter.
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn, Attributes="HideInEditor") class FLAXENGINE_API GPUAdapter : public PersistentScriptingObject
|
||||
API_CLASS(NoSpawn, Attributes="HideInEditor") class FLAXENGINE_API GPUAdapter : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDevice);
|
||||
public:
|
||||
|
||||
GPUAdapter()
|
||||
: PersistentScriptingObject(SpawnParams(Guid::New(), TypeInitializer))
|
||||
: ScriptingObject(SpawnParams(Guid::New(), TypeInitializer))
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Textures/GPUTexture.h"
|
||||
|
||||
GPUContext::GPUContext(GPUDevice* device)
|
||||
: PersistentScriptingObject(ScriptingObjectSpawnParams(Guid::New(), TypeInitializer))
|
||||
: ScriptingObject(ScriptingObjectSpawnParams(Guid::New(), TypeInitializer))
|
||||
, _device(device)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDrawIndexedIndirectArgs);
|
||||
/// <summary>
|
||||
/// Interface for GPU device context that can record and send graphics commands to the GPU in a sequence.
|
||||
/// </summary>
|
||||
API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUContext : public PersistentScriptingObject
|
||||
API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUContext : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUContext);
|
||||
private:
|
||||
|
||||
@@ -173,12 +173,12 @@ GPUPipelineState::Description GPUPipelineState::Description::DefaultFullscreenTr
|
||||
};
|
||||
|
||||
GPUResource::GPUResource()
|
||||
: PersistentScriptingObject(SpawnParams(Guid::New(), GPUResource::TypeInitializer))
|
||||
: ScriptingObject(SpawnParams(Guid::New(), GPUResource::TypeInitializer))
|
||||
{
|
||||
}
|
||||
|
||||
GPUResource::GPUResource(const SpawnParams& params)
|
||||
: PersistentScriptingObject(params)
|
||||
: ScriptingObject(params)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -241,7 +241,7 @@ void GPUResource::OnDeleteObject()
|
||||
{
|
||||
ReleaseGPU();
|
||||
|
||||
PersistentScriptingObject::OnDeleteObject();
|
||||
ScriptingObject::OnDeleteObject();
|
||||
}
|
||||
|
||||
double GPUResourceView::DummyLastRenderTime = -1;
|
||||
@@ -262,7 +262,7 @@ struct GPUDevice::PrivateData
|
||||
GPUDevice* GPUDevice::Instance = nullptr;
|
||||
|
||||
GPUDevice::GPUDevice(RendererType type, ShaderProfile profile)
|
||||
: PersistentScriptingObject(SpawnParams(Guid::New(), TypeInitializer))
|
||||
: ScriptingObject(SpawnParams(Guid::New(), TypeInitializer))
|
||||
, _state(DeviceState::Missing)
|
||||
, _isRendering(false)
|
||||
, _wasVSyncUsed(false)
|
||||
|
||||
@@ -29,7 +29,7 @@ class MaterialBase;
|
||||
/// <summary>
|
||||
/// Graphics device object for rendering on GPU.
|
||||
/// </summary>
|
||||
API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUDevice : public PersistentScriptingObject
|
||||
API_CLASS(Sealed, NoSpawn) class FLAXENGINE_API GPUDevice : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUDevice);
|
||||
public:
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/// <summary>
|
||||
/// The base class for all GPU resources.
|
||||
/// </summary>
|
||||
API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API GPUResource : public PersistentScriptingObject
|
||||
API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API GPUResource : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUResource);
|
||||
public:
|
||||
@@ -108,7 +108,7 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
// [PersistentScriptingObject]
|
||||
// [ScriptingObject]
|
||||
String ToString() const override;
|
||||
void OnDeleteObject() override;
|
||||
};
|
||||
@@ -186,14 +186,14 @@ public:
|
||||
/// <summary>
|
||||
/// Interface for GPU resources views. Shared base class for texture and buffer views.
|
||||
/// </summary>
|
||||
API_CLASS(Abstract, NoSpawn, Attributes="HideInEditor") class FLAXENGINE_API GPUResourceView : public PersistentScriptingObject
|
||||
API_CLASS(Abstract, NoSpawn, Attributes="HideInEditor") class FLAXENGINE_API GPUResourceView : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_NO_SPAWN(GPUResourceView);
|
||||
protected:
|
||||
static double DummyLastRenderTime;
|
||||
|
||||
explicit GPUResourceView(const SpawnParams& params)
|
||||
: PersistentScriptingObject(params)
|
||||
: ScriptingObject(params)
|
||||
, LastRenderTime(&DummyLastRenderTime)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -167,9 +167,9 @@ struct SerializedMaterialParam
|
||||
/// <summary>
|
||||
/// Material variable object. Allows to modify material parameter value at runtime.
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API MaterialParameter : public PersistentScriptingObject
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API MaterialParameter : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialParameter, PersistentScriptingObject);
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialParameter, ScriptingObject);
|
||||
friend MaterialParams;
|
||||
friend MaterialInstance;
|
||||
private:
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
/// <summary>
|
||||
/// The material slot descriptor that specifies how to render geometry using it.
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API MaterialSlot : public PersistentScriptingObject
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API MaterialSlot : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialSlot, PersistentScriptingObject);
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(MaterialSlot, ScriptingObject);
|
||||
|
||||
/// <summary>
|
||||
/// The material to use for rendering.
|
||||
|
||||
@@ -14,7 +14,7 @@ class ModelBase;
|
||||
/// <summary>
|
||||
/// Base class for model resources meshes.
|
||||
/// </summary>
|
||||
API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API MeshBase : public PersistentScriptingObject
|
||||
API_CLASS(Abstract, NoSpawn) class FLAXENGINE_API MeshBase : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_MINIMAL(MeshBase);
|
||||
protected:
|
||||
@@ -30,7 +30,7 @@ protected:
|
||||
bool _use16BitIndexBuffer;
|
||||
|
||||
explicit MeshBase(const SpawnParams& params)
|
||||
: PersistentScriptingObject(params)
|
||||
: ScriptingObject(params)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -10,9 +10,9 @@ class MemoryReadStream;
|
||||
/// <summary>
|
||||
/// Represents single Level Of Detail for the model. Contains a collection of the meshes.
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API ModelLOD : public PersistentScriptingObject
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API ModelLOD : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(ModelLOD, PersistentScriptingObject);
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(ModelLOD, ScriptingObject);
|
||||
friend Model;
|
||||
friend Mesh;
|
||||
private:
|
||||
|
||||
@@ -10,9 +10,9 @@ class MemoryReadStream;
|
||||
/// <summary>
|
||||
/// Represents single Level Of Detail for the skinned model. Contains a collection of the meshes.
|
||||
/// </summary>
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedModelLOD : public PersistentScriptingObject
|
||||
API_CLASS(NoSpawn) class FLAXENGINE_API SkinnedModelLOD : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(SkinnedModelLOD, PersistentScriptingObject);
|
||||
DECLARE_SCRIPTING_TYPE_WITH_CONSTRUCTOR_IMPL(SkinnedModelLOD, ScriptingObject);
|
||||
friend SkinnedModel;
|
||||
private:
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "Engine/Engine/Engine.h"
|
||||
|
||||
RenderBuffers::RenderBuffers(const SpawnParams& params)
|
||||
: PersistentScriptingObject(params)
|
||||
: ScriptingObject(params)
|
||||
{
|
||||
#define CREATE_TEXTURE(name) name = GPUDevice::Instance->CreateTexture(TEXT(#name)); _resources.Add(name)
|
||||
CREATE_TEXTURE(DepthBuffer);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
/// <summary>
|
||||
/// The scene rendering buffers container.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API RenderBuffers : public PersistentScriptingObject
|
||||
API_CLASS() class FLAXENGINE_API RenderBuffers : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE(RenderBuffers);
|
||||
protected:
|
||||
|
||||
@@ -82,7 +82,7 @@ void RenderTask::DrawAll()
|
||||
}
|
||||
|
||||
RenderTask::RenderTask(const SpawnParams& params)
|
||||
: PersistentScriptingObject(params)
|
||||
: ScriptingObject(params)
|
||||
{
|
||||
// Register
|
||||
TasksLocker.Lock();
|
||||
|
||||
@@ -24,7 +24,7 @@ class Actor;
|
||||
/// <summary>
|
||||
/// Allows to perform custom rendering using graphics pipeline.
|
||||
/// </summary>
|
||||
API_CLASS() class FLAXENGINE_API RenderTask : public PersistentScriptingObject
|
||||
API_CLASS() class FLAXENGINE_API RenderTask : public ScriptingObject
|
||||
{
|
||||
DECLARE_SCRIPTING_TYPE(RenderTask);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user