title: How to understand glVertexAttribPointer with UnsafeMutablePointer by Swift 4.2?
body: <p>I write some code about OpenGL ES. and I draw a triangle and want to put a image as texture on it. So I define a structure like this.</p>
  
  <pre><code>struct SceneVertor {
     var postion : GLKVector3
     var texture : GLKVector2
  
     init(_ value:(Float, Float, Float, Float, Float)) {
        self.postion = GLKVector3(v: (value.0, value.1, value.2))
        self.texture = GLKVector2(v: (value.3, value.4))
     }
  }
  </code></pre>
  
  <p>but when I found <code>glVertexAttribPointer</code> function. Its last argument is the UnSafeRowPointer type . In Objective-C, this argument can be </p>
  
  <pre><code>Null + offsetof(SceneVertor, texture)
  </code></pre>
  
  <p>but I don't understand to change it by Swift . </p>
  
  <p>In the Swift 4.2, we can calculate the offset like this</p>
  
  <pre><code>MemoryLayout&lt;SceneVertor&gt;.offset(of: \SceneVertor.texture)
  </code></pre>
  
  <p>now, how can I use it in the <code>glVertexAttribPointer</code> function.</p>
  
  <p>thx.</p>