mtkview

How do I position an image correctly in MTKView?

浪尽此生 提交于 2021-01-29 09:35:25
问题 I am trying to implement an image editing view using MTKView and Core Image filters and have the basics working and can see the filter applied in realtime. However the image is not positioned correctly in the view - can someone point me in the right direction for what needs to be done to get the image to render correctly in the view. It needs to fit the view and retain its original aspect ratio. Here is the metal draw function - and the empty drawableSizeWillChange!? - go figure. its probably

Why my MTKview is drawn like if there is a dark overlay on the top of it?

梦想与她 提交于 2020-02-21 06:49:04
问题 I'm under macOS and I create an MTKView , and I set this MTKView as a subview of the ContentView of my NSWindow . when I'm inside my MTKView.drawRect method and when I call NSView(Super).getRectsBeingDrawn it returns me nothing! why? But my main problem is that the MTKView is drawn darker (like there is something darker on the top of it) I must have something like this instead: Any idea what can cause this darker effect? 来源: https://stackoverflow.com/questions/60057910/why-my-mtkview-is-drawn