[OpenGL] gluLookAt?

Why No gluLookAt?
Anyone know a way to implement it?

Sure, GluLookAt can be implemented. I have many examples in the Program OpenGL Core 32-bit with Xojo book. Here are the Xojo declares needed for using it with OpenGL. There are also many examples which use this command in the book.

[code]Public Sub gluLookAt(eyeX as double, eyeY as double, eyeZ as double, centerX as double, centerY as double, centerZ as double, upX as double, upY as double, upZ as double)
//Compatibility with Windows and Mac
#If TargetWin32
Soft Declare sub gluLookAt lib “Glu32” (eyeX as Double, eyeY as Double, eyeZ as Double, centerX as Double, centerY as Double, centerZ as Double, upX as Double, upY as Double, upZ as Double)
#Endif

#If TargetMacOS
Soft Declare sub gluLookAt lib “OpenGL.framework” (eyeX as Double, eyeY as Double, eyeZ as Double, centerX as Double, centerY as Double, centerZ as Double, upX as Double, upY as Double, upZ as Double)
#Endif

gluLookAt(eyeX, eyeY, eyeZ, centerX, centerY, centerZ, upX, upY, upZ)
End Sub
[/code]

Happy to help.

Thanks Eugene.
I wonder normally the OpenGL methods are in the OpenGL namespace.
i.e. OpenGL.glEnable(GL_BLEND)

The gluLookAt now that it is defined by its signature, how/should you add it to the OpenGL namespace?
Will it ‘effect’ the OpenGL surface object?

What version is the OpenGL surface?

I haven’t been able to add it to the namespace (maybe someone has a trick that they could share?).

What I normally do is create a class called something like “OpenGLs”. When I make an instance then I can get the method, constants, or whatever, in the OpenGLs namespace. Its not a perfect solution, and it help prevent conflicts with IDE code.

I think the version of OpenGL used in the OpenGLSurface control is around 1.2 or 1.3, and I could be wrong.

I don’t mean to be an ass; it comes naturally. I’m sure that you’re aware if you’re targeting an Apple device you currently need to support OpenGL and Metal. OpenGL was deprecated last summer; Apple managed to introduce some bugs and AFAIK, have no intention of fixing them. We may find that OpenGL is gone with macOS 10.15, we should know shortly (WWDC’19).

Sadly it’s not as simple as switching over to Metal only, as the exact numbers are sketchy, but a Metal only solution is only viable on macOS 10.14, which accounts for ~40% of the Mac web traffic.

I just want to say this before you build an OpenGL only solution and find it doesn’t work in a month or so.

metalSurface???

Ya … Apple has lost it’s mind since steve passed. I’m sorry, but i don’t understand apples direction anymore, but I’m not dropping OpenGL. If I can’t target Apple anymore tough sh!t for them.