Laurent Crivello
Laurent Crivello

Reputation: 3931

Do I need to define an OpenGL context in Maya 2017?

I am updating a Maya 2016 plugin (C++) to Maya 2017. This plugin is displaying OpenGL shapes (VBOs) in the standard 2.0 ViewPort, and was working perfectly in Maya 2016 with OpenGL 2.1. Now Maya 2017 comes with OpenGL 4.1 and before doing any opengl action, the glErrorString executed in the prepareForDraw function gives Invalid Operation (code 1282).

This seems to come from the fact no OpenGL context is available. Do I need to manually create an OpenGL context or has Maya a function to create it for me, or should I link an existing Maya context to OpenGL ?

I can share some code if need be, but not sure it would be relevant at this stage.

Upvotes: 0

Views: 260

Answers (1)

Laurent Crivello
Laurent Crivello

Reputation: 3931

The issue came from an old define I had:

#ifdef __APPLE__
#define glGenVertexArrays glGenVertexArraysAPPLE
#define glBindVertexArray glBindVertexArrayAPPLE
#define glDeleteVertexArrays glDeleteVertexArraysAPPLE
#endif

removing these lines made the errors disappear

Upvotes: 2

Related Questions