From 9e3b1e9d5a0076299fc378c8461290892191dddf Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Sun, 13 May 2018 09:53:14 -0600 Subject: vulkaninfo: Moved new macOS files into new location --- demos/macOS/vulkaninfo/metal_view.h | 28 ------------------- demos/macOS/vulkaninfo/metal_view.m | 46 -------------------------------- vulkaninfo/macOS/vulkaninfo/metal_view.h | 28 +++++++++++++++++++ vulkaninfo/macOS/vulkaninfo/metal_view.m | 46 ++++++++++++++++++++++++++++++++ 4 files changed, 74 insertions(+), 74 deletions(-) delete mode 100644 demos/macOS/vulkaninfo/metal_view.h delete mode 100644 demos/macOS/vulkaninfo/metal_view.m create mode 100644 vulkaninfo/macOS/vulkaninfo/metal_view.h create mode 100644 vulkaninfo/macOS/vulkaninfo/metal_view.m diff --git a/demos/macOS/vulkaninfo/metal_view.h b/demos/macOS/vulkaninfo/metal_view.h deleted file mode 100644 index 82e98ec4..00000000 --- a/demos/macOS/vulkaninfo/metal_view.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2018 The Khronos Group Inc. - * Copyright (c) 2018 Valve Corporation - * Copyright (c) 2018 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. - * - * Author: Jeremy Kniager - */ - -#ifndef metal_view_h -#define metal_view_h - -void* CreateMetalView(uint32_t width, uint32_t height); - -void DestroyMetalView(void* view); - -#endif /* metal_view_h */ diff --git a/demos/macOS/vulkaninfo/metal_view.m b/demos/macOS/vulkaninfo/metal_view.m deleted file mode 100644 index 0e086537..00000000 --- a/demos/macOS/vulkaninfo/metal_view.m +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2018 The Khronos Group Inc. - * Copyright (c) 2018 Valve Corporation - * Copyright (c) 2018 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. - * - * Author: Jeremy Kniager - */ - -#import -#import - -@interface NativeMetalView : NSView -@end - -@implementation NativeMetalView -- (id)initWithFrame:(NSRect) frame { - if(self = [super initWithFrame: frame]){ - self.wantsLayer = YES; - } - return self; -} - -- (CALayer*)makeBackingLayer { - return [CAMetalLayer layer]; -} -@end - -void* CreateMetalView(uint32_t width, uint32_t height) { - return [[NativeMetalView alloc] initWithFrame:NSMakeRect(0, 0, width, height)]; -} - -void DestroyMetalView(void* view) { - [(NativeMetalView*)view dealloc]; -} diff --git a/vulkaninfo/macOS/vulkaninfo/metal_view.h b/vulkaninfo/macOS/vulkaninfo/metal_view.h new file mode 100644 index 00000000..82e98ec4 --- /dev/null +++ b/vulkaninfo/macOS/vulkaninfo/metal_view.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018 The Khronos Group Inc. + * Copyright (c) 2018 Valve Corporation + * Copyright (c) 2018 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. + * + * Author: Jeremy Kniager + */ + +#ifndef metal_view_h +#define metal_view_h + +void* CreateMetalView(uint32_t width, uint32_t height); + +void DestroyMetalView(void* view); + +#endif /* metal_view_h */ diff --git a/vulkaninfo/macOS/vulkaninfo/metal_view.m b/vulkaninfo/macOS/vulkaninfo/metal_view.m new file mode 100644 index 00000000..0e086537 --- /dev/null +++ b/vulkaninfo/macOS/vulkaninfo/metal_view.m @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2018 The Khronos Group Inc. + * Copyright (c) 2018 Valve Corporation + * Copyright (c) 2018 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. + * + * Author: Jeremy Kniager + */ + +#import +#import + +@interface NativeMetalView : NSView +@end + +@implementation NativeMetalView +- (id)initWithFrame:(NSRect) frame { + if(self = [super initWithFrame: frame]){ + self.wantsLayer = YES; + } + return self; +} + +- (CALayer*)makeBackingLayer { + return [CAMetalLayer layer]; +} +@end + +void* CreateMetalView(uint32_t width, uint32_t height) { + return [[NativeMetalView alloc] initWithFrame:NSMakeRect(0, 0, width, height)]; +} + +void DestroyMetalView(void* view) { + [(NativeMetalView*)view dealloc]; +} -- cgit v1.2.3