In my opengl project I need to convert an UIImage in texture; what's the way to do it? Can you help me?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
I haven't test the following but i will decompose the conversion in 3 steps:
Extract info for your image:
Allocate a
textureData
with the above properties:Set-up your texture:
EDIT:
Read this tut; everything is explained from the conversion of one image to a texture and applying a texture in an iOS environment.
Here is swift version of getting texture out of an UIImage
}
Note: Need to keep in mind that Core Graphics flips images when we load them in.
Another way of doing this using the GLKit framework:
texture.name
is The OpenGL context’s name for the texture.