// WARNING - AUTOGENERATED - DO NOT EDIT
//
// Generated using `sharpie urho`
//
// GPUObject.cs
//
// Copyright 2015 Xamarin Inc. All rights reserved.
using System;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Urho.Urho2D;
using Urho.Gui;
using Urho.Resources;
using Urho.IO;
using Urho.Navigation;
using Urho.Network;
namespace Urho
{
///
/// Base class for GPU resources.
///
public unsafe partial class GPUObject
{
unsafe partial void OnGPUObjectCreated ();
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr GPUObject_GPUObject (IntPtr graphics);
[Preserve]
public GPUObject (Graphics graphics)
{
Runtime.Validate (typeof(GPUObject));
handle = GPUObject_GPUObject ((object)graphics == null ? IntPtr.Zero : graphics.Handle);
OnGPUObjectCreated ();
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void GPUObject_OnDeviceLost (IntPtr handle);
///
/// Mark the GPU resource destroyed on graphics context destruction.
///
public void OnDeviceLost ()
{
Runtime.ValidateObject (this);
GPUObject_OnDeviceLost (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void GPUObject_OnDeviceReset (IntPtr handle);
///
/// Recreate the GPU resource and restore data if applicable.
///
public void OnDeviceReset ()
{
Runtime.ValidateObject (this);
GPUObject_OnDeviceReset (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void GPUObject_Release (IntPtr handle);
///
/// Unconditionally release the GPU resource.
///
public void Release ()
{
Runtime.ValidateObject (this);
GPUObject_Release (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern void GPUObject_ClearDataLost (IntPtr handle);
///
/// Clear the data lost flag.
///
public void ClearDataLost ()
{
Runtime.ValidateObject (this);
GPUObject_ClearDataLost (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr GPUObject_GetGraphics (IntPtr handle);
///
/// Return the graphics subsystem associated with this GPU object.
///
private Graphics GetGraphics ()
{
Runtime.ValidateObject (this);
return Runtime.LookupObject (GPUObject_GetGraphics (handle));
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern IntPtr GPUObject_GetGPUObject (IntPtr handle);
///
/// Return the object pointer. Applicable only on Direct3D.
///
public IntPtr GetGPUObject ()
{
Runtime.ValidateObject (this);
return GPUObject_GetGPUObject (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern uint GPUObject_GetGPUObjectName (IntPtr handle);
///
/// Return the object name. Applicable only on OpenGL.
///
private uint GetGPUObjectName ()
{
Runtime.ValidateObject (this);
return GPUObject_GetGPUObjectName (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool GPUObject_IsDataLost (IntPtr handle);
///
/// Return whether data is lost due to context loss.
///
private bool IsDataLost ()
{
Runtime.ValidateObject (this);
return GPUObject_IsDataLost (handle);
}
[DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
internal static extern bool GPUObject_HasPendingData (IntPtr handle);
///
/// Return whether has pending data assigned while graphics context was lost.
///
public bool HasPendingData ()
{
Runtime.ValidateObject (this);
return GPUObject_HasPendingData (handle);
}
///
/// Return the graphics subsystem associated with this GPU object.
///
public Graphics Graphics {
get {
return GetGraphics ();
}
}
///
/// Return the object name. Applicable only on OpenGL.
///
public uint GPUObjectName {
get {
return GetGPUObjectName ();
}
}
///
/// Return whether data is lost due to context loss.
///
public bool DataLost {
get {
return IsDataLost ();
}
}
}
}