diff --git a/framework/Source/FillMode.swift b/framework/Source/FillMode.swift index 865fae75..7f45ffe4 100644 --- a/framework/Source/FillMode.swift +++ b/framework/Source/FillMode.swift @@ -14,6 +14,7 @@ import OpenGLES import COpenGL #endif +import Foundation public enum FillMode { case stretch diff --git a/framework/Source/OpenGLRendering.swift b/framework/Source/OpenGLRendering.swift index 1a935433..832c18ab 100755 --- a/framework/Source/OpenGLRendering.swift +++ b/framework/Source/OpenGLRendering.swift @@ -277,10 +277,10 @@ extension String { } func withGLChar(_ operation:(UnsafePointer) -> ()) { - if let value = self.cString(using:String.Encoding.utf8) { - operation(UnsafePointer(value)) - } else { - fatalError("Could not convert this string to UTF8: \(self)") + let cString = self.utf8CString + cString.withUnsafeBytes { ptr -> Void in + let bind = ptr.bindMemory(to: CChar.self) + operation(bind.baseAddress!) } } }