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

Fix compile error on visionOS Beta 4 SDK #6

Open
wants to merge 1 commit into
base: main
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
fix compile error on visionOS Beta 4 SDK
wutian committed Nov 14, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit fc2af53da70186e9901c40a38a2b2693fbb40002
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ Take stereoscopic (3D) screenshots in the visionOS simulator.

An example screenshot from the visionOS simulator in side-by-side stereo.

Tested on macOS 14 beta 2 / Xcode 15 beta 2.
Tested on macOS 14 / Xcode 15.1 beta 2 (visionOS Beta 4 SDK).

## Setup

14 changes: 7 additions & 7 deletions visionos_stereo_screenshots.m
Original file line number Diff line number Diff line change
@@ -129,24 +129,24 @@ static void hook_cp_drawable_encode_present(cp_drawable_t drawable,

DYLD_INTERPOSE(hook_cp_drawable_get_depth_texture, cp_drawable_get_depth_texture);

size_t cp_layer_properties_get_view_count(cp_layer_renderer_properties_t properties);
size_t cp_layer_renderer_properties_get_view_count(cp_layer_renderer_properties_t properties);

static size_t hook_cp_layer_properties_get_view_count(cp_layer_renderer_properties_t properties) {
static size_t hook_cp_layer_renderer_properties_get_view_count(cp_layer_renderer_properties_t properties) {
return 2;
}

DYLD_INTERPOSE(hook_cp_layer_properties_get_view_count, cp_layer_properties_get_view_count);
DYLD_INTERPOSE(hook_cp_layer_renderer_properties_get_view_count, cp_layer_renderer_properties_get_view_count);

cp_layer_renderer_layout cp_layer_configuration_get_layout_private(
cp_layer_renderer_layout cp_layer_renderer_configuration_get_layout(
cp_layer_renderer_configuration_t configuration);

static cp_layer_renderer_layout hook_cp_layer_configuration_get_layout_private(
static cp_layer_renderer_layout hook_cp_layer_renderer_configuration_get_layout(
cp_layer_renderer_configuration_t configuration) {
return cp_layer_renderer_layout_dedicated;
}

DYLD_INTERPOSE(hook_cp_layer_configuration_get_layout_private,
cp_layer_configuration_get_layout_private);
DYLD_INTERPOSE(hook_cp_layer_renderer_configuration_get_layout,
cp_layer_renderer_configuration_get_layout);

static void DumpScreenshot() {
NSLog(@"visionos_stereo_screenshot: DumpScreenshot");