Class Cubemap
Represents a cubemap texture
public class Cubemap : IGraphicsResource, ISerialization
- Inheritance
-
Cubemap
- Implements
- Inherited Members
Constructors
Cubemap()
Creates a new cubemap
public Cubemap()
Properties
Faces
The faces of the cubemap
public List<byte[]> Faces { get; set; }
Property Value
Height
The height of the cubemap
public int Height { get; set; }
Property Value
IsInitialized
Gets a value indicating whether the object has been initialized and is ready for use.
public bool IsInitialized { get; }
Property Value
TextureId
The OpenGL texture ID of the cubemap
public int TextureId { get; set; }
Property Value
Width
The width of the cubemap
public int Width { get; set; }
Property Value
Methods
Deserialize(JObject, SerializationContext, Func<JObject, bool>)
Deserializes the object from a JSON representation.
public void Deserialize(JObject obj, SerializationContext serializationContext, Func<JObject, bool> callback = null)
Parameters
objJObjectserializationContextSerializationContextcallbackFunc<JObject, bool>
Exceptions
Dispose(IRenderDevice)
Releases resources associated with this cubemap using the specified render device.
public void Dispose(IRenderDevice renderer)
Parameters
rendererIRenderDeviceThe render device used to dispose of the cubemap resources. Cannot be null.
Remarks
After calling this method, the cubemap is no longer initialized and should not be used in rendering operations.
FreeCPUResources()
Releases any CPU resources that are currently allocated by the component.
public void FreeCPUResources()
Remarks
Call this method when the component no longer needs to perform CPU-intensive operations to allow the system to reclaim resources. After calling this method, the component may not be able to perform certain operations until resources are reallocated.
Init(IRenderDevice)
Initializes the cubemap by loading it into the specified render device.
public void Init(IRenderDevice renderer)
Parameters
rendererIRenderDeviceThe render device used to load the cubemap. Cannot be null.
LoadCubemap(string, bool)
Loads a cubemap from a JSON file
public static Cubemap LoadCubemap(string file, bool swapYAxisFaces = true)
Parameters
Returns
Exceptions
LoadCubemap(string[], bool)
Loads a cubemap from the specified paths
public static Cubemap LoadCubemap(string[] paths, bool swapYAxisFaces = true)
Parameters
Returns
Exceptions
Serialize(JsonWriter, SerializationContext, Action<JsonWriter>)
Serializes the current object to a JSON representation suitable for storage or transmission.
public void Serialize(JsonWriter writer, SerializationContext serializationContext, Action<JsonWriter> callback = null)
Parameters
writerJsonWriterserializationContextSerializationContextThe context that provides information required for serialization. This parameter can be used to customize serialization behavior.
callbackAction<JsonWriter>
Remarks
The returned JSON object includes the object's type, width, height, and an array of faces. Each face is represented as a Base64-encoded string. The structure of the output is intended for interoperability and persistence scenarios.