Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes for #1873 and #1874 #1875

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions headers/openvr_api.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ public struct IVRScreenshots
public struct IVRResources
{
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
internal delegate uint _LoadSharedResource(IntPtr pchResourceName, string pchBuffer, uint unBufferLen);
internal delegate uint _LoadSharedResource(IntPtr pchResourceName, System.Text.StringBuilder pchBuffer, uint unBufferLen);
[MarshalAs(UnmanagedType.FunctionPtr)]
internal _LoadSharedResource LoadSharedResource;

Expand Down Expand Up @@ -4075,7 +4075,7 @@ internal CVRResources(IntPtr pInterface)
{
FnTable = (IVRResources)Marshal.PtrToStructure(pInterface, typeof(IVRResources));
}
public uint LoadSharedResource(string pchResourceName,string pchBuffer,uint unBufferLen)
public uint LoadSharedResource(string pchResourceName,System.Text.StringBuilder pchBuffer,uint unBufferLen)
{
IntPtr pchResourceNameUtf8 = Utils.ToUtf8(pchResourceName);
uint result = FnTable.LoadSharedResource(pchResourceNameUtf8,pchBuffer,unBufferLen);
Expand Down Expand Up @@ -8214,6 +8214,19 @@ public CVRRenderModels VRRenderModels()
return m_pVRRenderModels;
}

public CVRResources VRResources()
{
CheckClear();
if (m_pVRResources == null)
{
var eError = EVRInitError.None;
var pInterface = OpenVRInterop.GetGenericInterface(FnTable_Prefix+IVRResources_Version, ref eError);
if (pInterface != IntPtr.Zero && eError == EVRInitError.None)
m_pVRResources = new CVRResources(pInterface);
}
return m_pVRResources;
}

public CVRExtendedDisplay VRExtendedDisplay()
{
CheckClear();
Expand Down Expand Up @@ -8352,6 +8365,7 @@ public CVRNotifications VRNotifications()
private CVROverlay m_pVROverlay;
private CVROverlayView m_pVROverlayView;
private CVRRenderModels m_pVRRenderModels;
private CVRResources m_pVRResources;
private CVRExtendedDisplay m_pVRExtendedDisplay;
private CVRSettings m_pVRSettings;
private CVRApplications m_pVRApplications;
Expand Down Expand Up @@ -8383,6 +8397,7 @@ static COpenVRContext OpenVRInternal_ModuleContext
public static CVROverlay Overlay { get { return OpenVRInternal_ModuleContext.VROverlay(); } }
public static CVROverlayView OverlayView { get { return OpenVRInternal_ModuleContext.VROverlayView(); } }
public static CVRRenderModels RenderModels { get { return OpenVRInternal_ModuleContext.VRRenderModels(); } }
public static CVRResources Resources { get { return OpenVRInternal_ModuleContext.VRResources(); } }
public static CVRExtendedDisplay ExtendedDisplay { get { return OpenVRInternal_ModuleContext.VRExtendedDisplay(); } }
public static CVRSettings Settings { get { return OpenVRInternal_ModuleContext.VRSettings(); } }
public static CVRApplications Applications { get { return OpenVRInternal_ModuleContext.VRApplications(); } }
Expand Down