Rhino compatibility with OpenGL

Is OpenGL compatible with the Rhino SDK, when creating a Rhino Plugin?

I have the following problem: when I try to include <GL/CAPI_GLE.h>, an error stops the compilation saying that GL.h must be included AFTER capi_gle.h

So, if I try to include GL/CAPI_GLE.h in the stdafx.h file, before the gl.h inclusion, I have other errors, because probably both Rhino SDK and capi_gle.h redefine some of the same stuff, and so they conflict.

Is there any way to solve this problem or the two things are just incompatible?

Many thanks

The Rhino SDK probably includes gl.h, so you may have to include this CAPI_GLE.h file before including the Rhino SDK headers.

As I wrote, It’s exactly what I tried to do:

include <GL/CAPI_GLE.h>
include “C:\Program Files (x86)\Rhino 5.0 x64 SDK\Inc\RhinoSdk.h”

And as I wrote, I have many errors, I don’t know why, probably because they redefine the same stuff twice in different ways, and they conflict in some way.

I’m assuming this header file is the same as the one listed here. If that is the case, the error message is coming from CAPI_GLE_GL.h. which tests for gl and prints the error message you are seeing. I don’t think this is a redefinition problem; it still sounds like gl.h is being included before you include GL/CAPI_GLE.h. Are there other include occurring in stdafx.h above this include?

Yes, most of what you wrote is correct, but not everything.

I’ll try to explain myself better: when I try to put the include for capi_gle_gl BEFORE the RhinoSDK.h one, I DON’Tt have the “gl.h must be included after this” anymore, but INSTEAD many other errors not related to gl.h, but from inside the Rhino SDK; my assumption is that these MANY errors are because some stuff is redefined in a different way in capi_gle_gl.h.

Almost all of these errors come from rhinosdkglextensions.h, and seems related to all the method names present in that file, that seems the compiler can’t parse, like “IntelliSense: a type qualifier is not allowed on a nonmember function” and "IntelliSense: a trailing return type requires the ‘auto’ type specifier"
for ALL the methods in rhinosdkglextensions.h.

To summarize:

  1. including capi_gle_gl.h AFTER rhinosdk.h gives the “include gl_h after capi_gle_gl.h” error.
  2. including capi_gle_gl.h BEFORE rhinosdk.h gives many errors in the file “rhinosdkglextensions.h”, like there are redefined or conflicting names, but NO LONGER the “include gl_h after capi_gle_gl.h” error.
  3. From point 2, I’m assuming that capi_gle_gl.h is not compatible with the RhinoSDK.

I hope that this explanation is clearer, thanks for your help

Intellisense errors are not real errors for compiling. Are you able to compile your plug-in?

Usually yes, I worked until here and included other SDKs in this project without any problem.

The plugin works with all the other SDKs, and the execution works as it should

. I just had this problem only with OpenGL.

But I cannot compile because of these errors.

I have other errors, like

error C2371: ‘PFNGLSHADERSOURCEPROC’ : redefinition; different basic types
error C2371: ‘PFNGLMULTIDRAWELEMENTSPROC’ : redefinition; different basic types
error C2371: ‘PFNGLMULTIDRAWARRAYSPROC’ : redefinition; different basic types

that’s also why I think there are some redefinitions in the names.

what can I do to fix this problem? I have seen many people using OpenGL with Rhino, how could it be that I’m the only one with this problem?

If all you want to do is use OpenGL, then you shouldn’t have to include this header file at all. Obviously the Rhino SDK already includes OpenGL. I thought this was for some specific functionality that you were looking for in this header file.

Actually yes, I need to use this header file in my project, that’s the whole reason why I’m asking how to do it, what did I write that made you think otherwise? Sorry about that.

I wasn’t sure if you just need OpenGL in general or if there was something specific about this header file that you needed.

I really need capi_gle_gl.h because of many methods and stuff that is in it. I have a huge part of code that uses that library, and I need to integrate it with my Rhino project, that’s why I need to use capi_gle_gl.h, but I have the problems that I said before.
Can you help me with this?
Thank you very much for the large amount of time that you’re spending for trying to help me.