[Xquartz-dev] GLKit and Xquartz's GL support
Jack Howarth
howarth.mailing.lists at gmail.com
Thu Dec 11 10:42:26 PST 2014
When pymol 1.7.4.0 is built with the following patch...
-- pymol-1.7.4.0/layer1/Scene.cpp.orig 2014-12-11 12:48:50.000000000 -0500
+++ pymol-1.7.4.0/layer1/Scene.cpp 2014-12-11 13:30:54.000000000 -0500
@@ -57,6 +57,8 @@
#include"ScrollBar.h"
#include "ShaderMgr.h"
+#include <GLKit/GLKMatrix4.h>
+
#ifdef _PYMOL_IP_EXTRAS
#include "IncentiveCopyToClipboard.h"
#endif
@@ -9156,7 +9158,8 @@
}
if(!SettingGetGlobal_b(G, cSetting_ortho)) {
float fov = SettingGetGlobal_f(G, cSetting_field_of_view);
- gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe);
+ // gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe);
+ glMultMatrixf(GLKMatrix4MakePerspective(fov, aspRat,
I->FrontSafe, I->BackSafe).m);
} else {
height = fmax(R_SMALL4, -I->Pos[2]) * GetFovWidth(G) / 2.f;
width = height * aspRat;
it compiles without errors and runs the demos correctly except the
rendered images are about 10 times smaller than expected.
On Thu, Dec 11, 2014 at 1:12 PM, Jack Howarth
<howarth.mailing.lists at gmail.com> wrote:
> The following warning appears when compiling pymol 1.7.4.0 under
> OS X 10.10....
>
> layer1/Scene.cpp:9159:7: warning: 'gluPerspective' is deprecated:
> first deprecated in OS X 10.9 - "Use GLKMatrix4MakePerspective"
> [-Wdeprecated-declarations]
> gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe);
> ^
> /System/Library/Frameworks/OpenGL.framework/Headers/glu.h:278:13:
> note: 'gluPerspective' has been explicitly marked deprecated here
> extern void gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble
> zNear, GLdouble zFar) OPENGL_DEPRECATED_MSG(10_0, 10_9, "Use
> GLKMatrix4MakePerspective");
> ^
>
> from https://www.opengl.org/discussion_boards/showthread.php/184541-gluPerspective-vs-GLKMatrix4MakePerspective-use-in-OSX-OpenGL,
> it would appear that we want to use something like...
>
> --- layer1/Scene.cpp.orig 2014-12-11 12:48:50.000000000 -0500
> +++ layer1/Scene.cpp 2014-12-11 13:03:26.000000000 -0500
> @@ -9156,7 +9156,8 @@
> }
> if(!SettingGetGlobal_b(G, cSetting_ortho)) {
> float fov = SettingGetGlobal_f(G, cSetting_field_of_view);
> - gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe);
> + // gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe);
> + glMultMatrix(GLKMatrix4MakePerspective(fov, aspRat,
> I->FrontSafe, I->BackSafe).m);
> } else {
> height = fmax(R_SMALL4, -I->Pos[2]) * GetFovWidth(G) / 2.f;
> width = height * aspRat;
>
> However I am concerned about how using GLKit will interact with the
> X11 GL wrapper libraries. Have those been enhanced to interoperate
> with GLKit? Thanks in advance for any information.
> Jack
More information about the Xquartz-dev
mailing list