mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 09:45:32 +00:00
The Metal view is a full SDL_uikitview to support multi-touch
This commit is contained in:
parent
ef6e629d39
commit
cadf3e44ca
|
@ -38,7 +38,7 @@
|
||||||
|
|
||||||
#define METALVIEW_TAG 255
|
#define METALVIEW_TAG 255
|
||||||
|
|
||||||
@interface SDL_uikitmetalview : UIView
|
@interface SDL_uikitmetalview : SDL_uikitview
|
||||||
|
|
||||||
- (instancetype)initWithFrame:(CGRect)frame
|
- (instancetype)initWithFrame:(CGRect)frame
|
||||||
scale:(CGFloat)scale
|
scale:(CGFloat)scale
|
||||||
|
|
|
@ -49,9 +49,6 @@
|
||||||
tag:(int)tag
|
tag:(int)tag
|
||||||
{
|
{
|
||||||
if ((self = [super initWithFrame:frame])) {
|
if ((self = [super initWithFrame:frame])) {
|
||||||
/* Resize properly when rotated. */
|
|
||||||
self.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
||||||
|
|
||||||
/* Set the appropriate scale (for retina display support) */
|
/* Set the appropriate scale (for retina display support) */
|
||||||
self.contentScaleFactor = scale;
|
self.contentScaleFactor = scale;
|
||||||
self.tag = tag;
|
self.tag = tag;
|
||||||
|
@ -105,19 +102,7 @@ UIKit_Mtl_AddMetalView(SDL_Window* window)
|
||||||
= [[SDL_uikitmetalview alloc] initWithFrame:view.frame
|
= [[SDL_uikitmetalview alloc] initWithFrame:view.frame
|
||||||
scale:scale
|
scale:scale
|
||||||
tag:METALVIEW_TAG];
|
tag:METALVIEW_TAG];
|
||||||
#if 1
|
|
||||||
[view addSubview:metalview];
|
|
||||||
#else
|
|
||||||
/* Sets this view as the controller's view, and adds the view to
|
|
||||||
* the window hierarchy.
|
|
||||||
*
|
|
||||||
* Left here for information. Not used because I suspect that for correct
|
|
||||||
* operation it will be necesary to copy everything from the window's
|
|
||||||
* current SDL_uikitview instance to the SDL_uikitview portion of the
|
|
||||||
* SDL_metalview. The latter would be derived from SDL_uikitview rather
|
|
||||||
* than UIView. */
|
|
||||||
[metalview setSDLWindow:window];
|
[metalview setSDLWindow:window];
|
||||||
#endif
|
|
||||||
|
|
||||||
return metalview;
|
return metalview;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue