-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
132 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,25 @@ | ||
// | ||
// AppleFilamentView.h | ||
// Pods | ||
// react-native-filament | ||
// | ||
// Created by Marc Rousavy on 22.02.24. | ||
// | ||
|
||
#pragma once | ||
|
||
#import <UIKit/UIKit.h> | ||
#include "FilamentView.h" | ||
#include "FilamentMetalView.h" | ||
#include "SurfaceProvider.h" | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
namespace margelo { | ||
|
||
@interface AppleFilamentView : UIView | ||
class AppleFilamentView : public FilamentView { | ||
public: | ||
explicit AppleFilamentView(FilamentMetalView* view): _view(view) {} | ||
|
||
std::shared_ptr<SurfaceProvider> getSurfaceProvider() override; | ||
private: | ||
FilamentMetalView* _view; | ||
}; | ||
|
||
- (instancetype) init; | ||
|
||
- (CAMetalLayer*) layer; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END | ||
} // namespace margelo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,16 @@ | ||
#import "AppleFilamentView.h" | ||
#import <UIKit/UIKit.h> | ||
#import <Metal/Metal.h> | ||
// | ||
// AppleFilamentView.cpp | ||
// react-native-filament | ||
// | ||
// Created by Marc Rousavy on 22.02.24. | ||
// | ||
|
||
@implementation AppleFilamentView | ||
#include "AppleFilamentView.h" | ||
|
||
+ (Class) layerClass { | ||
return [CAMetalLayer class]; | ||
} | ||
namespace margelo { | ||
|
||
- (CAMetalLayer*) layer { | ||
return (CAMetalLayer*) super.layer; | ||
std::shared_ptr<SurfaceProvider> AppleFilamentView::getSurfaceProvider() { | ||
return nullptr; | ||
} | ||
|
||
- (instancetype)init { | ||
if (self = [super init]) { | ||
// init here | ||
} | ||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// | ||
// FilamentView.h | ||
// Pods | ||
// | ||
// Created by Marc Rousavy on 22.02.24. | ||
// | ||
|
||
#pragma once | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface FilamentMetalView : UIView | ||
|
||
- (instancetype) init; | ||
|
||
- (CAMetalLayer*) layer; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#import "FilamentMetalView.h" | ||
#import <UIKit/UIKit.h> | ||
#import <Metal/Metal.h> | ||
|
||
@implementation FilamentMetalView | ||
|
||
+ (Class) layerClass { | ||
return [CAMetalLayer class]; | ||
} | ||
|
||
- (CAMetalLayer*) layer { | ||
return (CAMetalLayer*) super.layer; | ||
} | ||
|
||
- (instancetype)init { | ||
if (self = [super init]) { | ||
// init here | ||
} | ||
return self; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <React/RCTViewManager.h> | ||
#import "AppleFilamentView.h" | ||
#import "FilamentMetalView.h" | ||
|
||
@interface FilamentViewManager : RCTViewManager | ||
@end | ||
|
||
@implementation FilamentViewManager | ||
|
||
RCT_EXPORT_MODULE(FilamentView) | ||
RCT_EXPORT_MODULE(FilamentMetalView) | ||
|
||
- (AppleFilamentView*)view { | ||
return [[AppleFilamentView alloc] init]; | ||
- (FilamentMetalView*)view { | ||
return [[FilamentMetalView alloc] init]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters