| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174 |
- // 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
- {
- /// <summary>
- /// Base class for GPU resources.
- /// </summary>
- 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);
- /// <summary>
- /// Mark the GPU resource destroyed on graphics context destruction.
- /// </summary>
- public void OnDeviceLost ()
- {
- Runtime.ValidateObject (this);
- GPUObject_OnDeviceLost (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void GPUObject_OnDeviceReset (IntPtr handle);
- /// <summary>
- /// Recreate the GPU resource and restore data if applicable.
- /// </summary>
- public void OnDeviceReset ()
- {
- Runtime.ValidateObject (this);
- GPUObject_OnDeviceReset (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void GPUObject_Release (IntPtr handle);
- /// <summary>
- /// Unconditionally release the GPU resource.
- /// </summary>
- public void Release ()
- {
- Runtime.ValidateObject (this);
- GPUObject_Release (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern void GPUObject_ClearDataLost (IntPtr handle);
- /// <summary>
- /// Clear the data lost flag.
- /// </summary>
- public void ClearDataLost ()
- {
- Runtime.ValidateObject (this);
- GPUObject_ClearDataLost (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr GPUObject_GetGraphics (IntPtr handle);
- /// <summary>
- /// Return the graphics subsystem associated with this GPU object.
- /// </summary>
- private Graphics GetGraphics ()
- {
- Runtime.ValidateObject (this);
- return Runtime.LookupObject<Graphics> (GPUObject_GetGraphics (handle));
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern IntPtr GPUObject_GetGPUObject (IntPtr handle);
- /// <summary>
- /// Return the object pointer. Applicable only on Direct3D.
- /// </summary>
- public IntPtr GetGPUObject ()
- {
- Runtime.ValidateObject (this);
- return GPUObject_GetGPUObject (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern uint GPUObject_GetGPUObjectName (IntPtr handle);
- /// <summary>
- /// Return the object name. Applicable only on OpenGL.
- /// </summary>
- private uint GetGPUObjectName ()
- {
- Runtime.ValidateObject (this);
- return GPUObject_GetGPUObjectName (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool GPUObject_IsDataLost (IntPtr handle);
- /// <summary>
- /// Return whether data is lost due to context loss.
- /// </summary>
- private bool IsDataLost ()
- {
- Runtime.ValidateObject (this);
- return GPUObject_IsDataLost (handle);
- }
- [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
- internal static extern bool GPUObject_HasPendingData (IntPtr handle);
- /// <summary>
- /// Return whether has pending data assigned while graphics context was lost.
- /// </summary>
- public bool HasPendingData ()
- {
- Runtime.ValidateObject (this);
- return GPUObject_HasPendingData (handle);
- }
- /// <summary>
- /// Return the graphics subsystem associated with this GPU object.
- /// </summary>
- public Graphics Graphics {
- get {
- return GetGraphics ();
- }
- }
- /// <summary>
- /// Return the object name. Applicable only on OpenGL.
- /// </summary>
- public uint GPUObjectName {
- get {
- return GetGPUObjectName ();
- }
- }
- /// <summary>
- /// Return whether data is lost due to context loss.
- /// </summary>
- public bool DataLost {
- get {
- return IsDataLost ();
- }
- }
- }
- }
|