<!--
{
  "availability" : [
    "iOS: 5.0.0 - 12.0.0",
    "iPadOS: 5.0.0 - 12.0.0",
    "macOS: 10.8.0 - 10.14.0",
    "tvOS: 9.0.0 - 12.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "GLKit",
  "identifier" : "/documentation/GLKit/GLKReflectionMapEffect/prepareToDraw()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "GLKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GLKReflectionMapEffect(im)prepareToDraw"
  },
  "title" : "prepareToDraw()"
}
-->

# prepareToDraw()

Prepares an effect for rendering.

```
func prepareToDraw()
```

## Discussion

An effect must be prepared after it is configured and again when your application wants to use the effect to render any primitives. When your application prepares an effect, some OpenGL state is altered to allow the effect to operate:

- The `GL_CURRENT_PROGRAM` state is always changed to point to the shader provided by the effect object.
- When texturing is enabled, the `GL_TEXTURE_BINDING_2D` state and `GL_TEXTURE_BINDING_CUBE_MAP` state may also change.

If your application requires the previous state to be saved before the effect alters them, it must explicitly save and restore the values.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)