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

PCVR (Rift) implementation (Initialize + Age Category API) #12

Open
Lucky-Mic opened this issue Oct 12, 2024 · 3 comments
Open

PCVR (Rift) implementation (Initialize + Age Category API) #12

Lucky-Mic opened this issue Oct 12, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@Lucky-Mic
Copy link

Feature description

It would be great if the addon also support PCVR (Rift). A first version which supports the initialize_windows_async and the useragecategory_get (Age Category API) would be very helpful. I would also try to help with the other feature implementattion, if you like.

@Lucky-Mic Lucky-Mic added the enhancement New feature or request label Oct 12, 2024
@decacis
Copy link
Owner

decacis commented Oct 12, 2024

Hi, indeed! I have tried to implement Rift/PC support before, but I just don't have the knowledge unfortunately... There is a portion of the code that comes with the SDK that finds some files on windows, but I just don't know how to integrate it (which means the platform doesn't actually start). If someone could figure out that part, the rest would be really easy actually since both versions share most of the code.

The user age category is already implemented (on android): https://decacis.github.io/godot_oculus_platform/functions/user-age-category/#useragecategory_get

To add to the first part, when you download the SDK from https://developers.meta.com/horizon/downloads/package/oculus-platform-sdk/ inside the Windows folder there is a file called OVR_PlatformLoader.cpp which loads the platform dynamically, but I haven't been able to actually do it.

@Lucky-Mic
Copy link
Author

Lucky-Mic commented Oct 15, 2024

Hi....

I added in the SConstruct for windows this part and copied the OVR_PlatformLoader.cpp into src directory (excluded in the android part):

sources = Glob("src/*.cpp", exclude=["src/*android.cpp"])
env.Append(LIBPATH=["demo/addons/godot_oculus_platform/bin/windows/"])
env.Append(LIBS=["LibOVRPlatformImpl64_1"])

In godot_oculus_platform_editor.cpp I added in initialize_android for testing:

ovrPlatformInitializeResult init_result = ovr_PlatformInitializeWindows(p_app_id.utf8().get_data());
ERR_FAIL_COND_V_MSG(init_result != ovrPlatformInitialize_Success, false, vformat("[GDOP] Error initializing windows platform: %s", ovrPlatformInitializeResult_ToString(init_result)));
return true;

The DLL can be used in Godot and the initialize call is successful but if I try to call e.g. ovr_Entitlement_GetIsViewerEntitled, the DLL cannot be used in Godot anymore (Identifier "GDOculusPlatform" not declared in the current scope.). Any idea?

BTW: I sent you an email.

@Lucky-Mic
Copy link
Author

If you create a new branch and I could get access to it, I would check in a first version there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants