From 165c94e3c1742dabaac73b20662e4d4c823dd310 Mon Sep 17 00:00:00 2001 From: Lizzy Fleckenstein Date: Sun, 12 Apr 2026 21:37:16 +0200 Subject: mkcube: use animtool --- tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.h | 23 ---- .../Vulkan-Tools/cube/macOS/cubepp/AppDelegate.mm | 48 -------- .../Vulkan-Tools/cube/macOS/cubepp/CMakeLists.txt | 91 -------------- .../cube/macOS/cubepp/DemoViewController.h | 36 ------ .../cube/macOS/cubepp/DemoViewController.mm | 118 ------------------- tools/Vulkan-Tools/cube/macOS/cubepp/Info.plist | 38 ------ .../cube/macOS/cubepp/Resources/Main.storyboard | 131 --------------------- .../cube/macOS/cubepp/Resources/VulkanIcon.icns | Bin 157001 -> 0 bytes tools/Vulkan-Tools/cube/macOS/cubepp/main.mm | 21 ---- 9 files changed, 506 deletions(-) delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.h delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.mm delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/CMakeLists.txt delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.h delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.mm delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/Info.plist delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/Resources/Main.storyboard delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/Resources/VulkanIcon.icns delete mode 100644 tools/Vulkan-Tools/cube/macOS/cubepp/main.mm (limited to 'tools/Vulkan-Tools/cube/macOS/cubepp') diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.h b/tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.h deleted file mode 100644 index 0b1dfe49..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * AppDelegate.h - * - * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -@interface AppDelegate : NSObject - -@end diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.mm b/tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.mm deleted file mode 100644 index c1ee96b4..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/AppDelegate.mm +++ /dev/null @@ -1,48 +0,0 @@ -/* - * AppDelegate.m - * - * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "AppDelegate.h" -#import "DemoViewController.h" - -@interface AppDelegate () - -@end - -@implementation AppDelegate - -- (void)applicationDidFinishLaunching:(NSNotification *)aNotification { - // Insert code here to initialize your application -} - -- (void)applicationWillTerminate:(NSNotification *)aNotification { - NSApplication *app = aNotification.object; - NSArray *windows = app.windows; - for (NSUInteger i = 0; i < windows.count; ++i) { - NSViewController *viewController = windows[i].contentViewController; - if ([viewController isKindOfClass:[DemoViewController class]]) { - [(DemoViewController *)viewController quit]; - break; - } - } -} - -- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender { - return YES; -} - -@end diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/CMakeLists.txt b/tools/Vulkan-Tools/cube/macOS/cubepp/CMakeLists.txt deleted file mode 100644 index 6390db0b..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/CMakeLists.txt +++ /dev/null @@ -1,91 +0,0 @@ -# ~~~ -# Copyright (c) 2018-2024 Valve Corporation -# Copyright (c) 2018-2024 LunarG, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ~~~ - -# VkCube Application Bundle - -set(cubepp_RESOURCES ${CMAKE_CURRENT_LIST_DIR}/Resources/VulkanIcon.icns) -if(NOT APPLE_USE_SYSTEM_ICD) - list(APPEND cubepp_RESOURCES ${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.json) -endif() - -# Have Xcode handle the Storyboard -if(XCODE) - set(cubepp_RESOURCES ${cubepp_RESOURCES} ${CMAKE_CURRENT_LIST_DIR}/Resources/Main.storyboard) -endif() - -add_executable(vkcubepp MACOSX_BUNDLE) - -target_sources(vkcubepp PRIVATE - main.mm - AppDelegate.mm - AppDelegate.h - DemoViewController.h - DemoViewController.mm - ${cubepp_RESOURCES} - ../../cube.vert.inc - ../../cube.frag.inc -) - -# Handle the Storyboard ourselves -if(NOT XCODE) - # Compile the storyboard file with the ibtool. - add_custom_command(TARGET vkcubepp POST_BUILD - COMMAND ${IBTOOL} - --errors - --warnings - --notices - --output-format human-readable-text - --compile ${CMAKE_CURRENT_BINARY_DIR}/vkcubepp.app/Contents/Resources/Main.storyboardc - ${CMAKE_CURRENT_LIST_DIR}/Resources/Main.storyboard - COMMENT "Compiling storyboard") -endif() - -if(NOT APPLE_USE_SYSTEM_ICD) - add_dependencies(vkcubepp MoltenVK_icd-staging-json) -endif() - -# Include demo source code dir because the MacOS vkcubepp's Objective-C source includes the "original" vkcubepp application C++ source -# code. -target_include_directories(vkcubepp PRIVATE ${CMAKE_CURRENT_LIST_DIR}) - -# We do this so vkcubepp is linked to an individual library and NOT a framework. -target_link_libraries(vkcubepp Vulkan::Loader "-framework Cocoa -framework QuartzCore") - -set_target_properties(vkcubepp PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_LIST_DIR}/Info.plist) - -# The RESOURCE target property cannot be used in conjunction with the MACOSX_PACKAGE_LOCATION property. We need fine-grained -# control over the Resource directory, so we have to specify the destination of all the resource files on a per-destination- -# directory basis. If all the files went into the top-level Resource directory, then we could simply set the RESOURCE property to a -# list of all the resource files. -set_source_files_properties(${cubepp_RESOURCES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") -if(NOT APPLE_USE_SYSTEM_ICD) - set_source_files_properties("${PROJECT_BINARY_DIR}/staging-json/MoltenVK_icd.json" - PROPERTIES - MACOSX_PACKAGE_LOCATION - "Resources/vulkan/icd.d") - - # Copy the MoltenVK lib into the bundle. - if(XCODE) - add_custom_command(TARGET vkcubepp POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" - ${CMAKE_CURRENT_BINARY_DIR}/$/vkcubepp.app/Contents/Frameworks/libMoltenVK.dylib) - else() - add_custom_command(TARGET vkcubepp POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy "${MOLTENVK_DIR}/Package/Release/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib" - ${CMAKE_CURRENT_BINARY_DIR}/vkcubepp.app/Contents/Frameworks/libMoltenVK.dylib) - endif() -endif() diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.h b/tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.h deleted file mode 100644 index 6d7ca215..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * DemoViewController.h - * - * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -#pragma mark - -#pragma mark DemoViewController - -/** The main view controller for the demo storyboard. */ -@interface DemoViewController : NSViewController - -- (void)quit; - -@end - -#pragma mark - -#pragma mark DemoView - -/** The Metal-compatibile view for the demo Storyboard. */ -@interface DemoView : NSView -@end diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.mm b/tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.mm deleted file mode 100644 index fbb17797..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/DemoViewController.mm +++ /dev/null @@ -1,118 +0,0 @@ -/* - * DemoViewController.m - * - * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import "DemoViewController.h" -#import - -#include "cube.cpp" - -#pragma mark - -#pragma mark DemoViewController - -@implementation DemoViewController { - CVDisplayLinkRef _displayLink; - struct Demo demo; - NSTimer* _timer; -} - -- (void)dealloc { - [self quit]; - [super dealloc]; -} - -- (void)quit { - CVDisplayLinkRelease(_displayLink); - demo.cleanup(); -} - -/** Since this is a single-view app, initialize Vulkan during view loading. */ -- (void)viewDidLoad { - [super viewDidLoad]; - - self.view.wantsLayer = YES; // Back the view with a layer created by the makeBackingLayer method. - - // Convert incoming args to "C" argc/argv strings - NSArray *args = [[NSProcessInfo processInfo] arguments]; - const char** argv = (const char**) alloca(sizeof(char*) * args.count); - for(unsigned int i = 0; i < args.count; i++) { - NSString *s = args[i]; - argv[i] = s.UTF8String; - } - - demo_main(demo, self.view.layer, args.count, argv); - - // Monitor the rendering loop for a quit condition - _timer = [NSTimer scheduledTimerWithTimeInterval: 0.2 - target: self - selector: @selector(onTick:) - userInfo: self - repeats: YES]; - - // Start the rendering loop - CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink); - CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, &demo); - CVDisplayLinkStart(_displayLink); -} - -// Close the window if the demo is in a Quit state --(void)onTick:(NSTimer*)timer { - if (demo.quit) { - [[[self view] window] close]; - } -} - -#pragma mark Display loop callback function - -/** Rendering loop callback function for use with a CVDisplayLink. */ -static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp* now, - const CVTimeStamp* outputTime, - CVOptionFlags flagsIn, CVOptionFlags* flagsOut, void* target) { - struct Demo* demo = (struct Demo*)target; - demo->run(); - if (demo->quit) { - CVDisplayLinkStop(displayLink); - } - return kCVReturnSuccess; -} - -@end - -#pragma mark - -#pragma mark DemoView - -@implementation DemoView - -/** Indicates that the view wants to draw using the backing layer instead of using drawRect:. */ -- (BOOL)wantsUpdateLayer { - return YES; -} - -/** Returns a Metal-compatible layer. */ -+ (Class)layerClass { - return [CAMetalLayer class]; -} - -/** If the wantsLayer property is set to YES, this method will be invoked to return a layer instance. */ -- (CALayer*)makeBackingLayer { - CALayer* layer = [self.class.layerClass layer]; - CGSize viewScale = [self convertSizeToBacking:CGSizeMake(1.0, 1.0)]; - layer.contentsScale = MIN(viewScale.width, viewScale.height); - return layer; -} - -@end diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/Info.plist b/tools/Vulkan-Tools/cube/macOS/cubepp/Info.plist deleted file mode 100644 index d0b74e01..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/Info.plist +++ /dev/null @@ -1,38 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${MACOSX_BUNDLE_EXECUTABLE_NAME} - CFBundleGetInfoString - VkCubepp - CFBundleIconFile - VulkanIcon.icns - CFBundleIdentifier - com.lunarg.cubepp - CFBundleInfoDictionaryVersion - 6.0 - CFBundleLongVersionString - 1.0 - CFBundleName - VkCubepp - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - CSResourcesFileMapped - - NSHumanReadableCopyright - Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved. - NSMainStoryboardFile - Main - NSPrincipalClass - NSApplication - - diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/Resources/Main.storyboard b/tools/Vulkan-Tools/cube/macOS/cubepp/Resources/Main.storyboard deleted file mode 100644 index abae39be..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/Resources/Main.storyboard +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/Resources/VulkanIcon.icns b/tools/Vulkan-Tools/cube/macOS/cubepp/Resources/VulkanIcon.icns deleted file mode 100644 index fb82fb7d..00000000 Binary files a/tools/Vulkan-Tools/cube/macOS/cubepp/Resources/VulkanIcon.icns and /dev/null differ diff --git a/tools/Vulkan-Tools/cube/macOS/cubepp/main.mm b/tools/Vulkan-Tools/cube/macOS/cubepp/main.mm deleted file mode 100644 index cf9e0d89..00000000 --- a/tools/Vulkan-Tools/cube/macOS/cubepp/main.mm +++ /dev/null @@ -1,21 +0,0 @@ -/* - * main.m - * - * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#import - -int main(int argc, const char* argv[]) { return NSApplicationMain(argc, argv); } -- cgit v1.2.3