Ticket #47244: pymol-use-glkit.diff
File pymol-use-glkit.diff, 3.2 KB (added by howarth.at.macports@…, 10 years ago) |
---|
-
layer0/os_gl.cpp
3 3 4 4 #include<stdio.h> 5 5 6 const char* PyMOLgluErrorString(GLenum errorCode) 7 { 8 static const struct { 9 GLenum code; 10 const char *string; 11 } errors[]= 12 { 13 /* GL */ 14 {GL_NO_ERROR, "no error"}, 15 {GL_INVALID_ENUM, "invalid enumerant"}, 16 {GL_INVALID_VALUE, "invalid value"}, 17 {GL_INVALID_OPERATION, "invalid operation"}, 18 {GL_STACK_OVERFLOW, "stack overflow"}, 19 {GL_STACK_UNDERFLOW, "stack underflow"}, 20 {GL_OUT_OF_MEMORY, "out of memory"}, 21 {GLU_INVALID_ENUM, "invalid enumerant"}, 22 {GLU_INVALID_VALUE, "invalid value"}, 23 {GLU_OUT_OF_MEMORY, "out of memory"}, 24 {GLU_INCOMPATIBLE_GL_VERSION, "incompatible gl version"}, 25 {GLU_INVALID_OPERATION, "invalid operation"}, 26 27 {0, NULL } 28 }; 29 30 int i; 31 32 for (i=0; errors[i].string; i++) 33 { 34 if (errors[i].code == errorCode) 35 { 36 return errors[i].string; 37 } 38 } 39 40 return NULL; 41 } 42 6 43 void PyMOLReadPixels(GLint x, 7 44 GLint y, 8 45 GLsizei width, … … int PyMOLCheckOpenGLErr(const char *pos) 96 133 int flag = 0; 97 134 GLenum glerr = glGetError(); 98 135 while(glerr != GL_NO_ERROR) { 99 printf("OpenGL-Error: Where? %s: %s\n", pos, (char *) gluErrorString(glerr));136 printf("OpenGL-Error: Where? %s: %s\n", pos, (char *) PyMOLgluErrorString(glerr)); 100 137 glerr = glGetError(); 101 138 flag = 1; 102 139 } -
layer0/os_gl.h
64 64 65 65 /* END PROPRIETARY CODE SEGMENT */ 66 66 67 static const char* PyMOLgluErrorString(GLenum errorCode); 68 67 69 void PyMOLReadPixels(GLint x, 68 70 GLint y, 69 71 GLsizei width, -
layer1/Scene.cpp
Z* ------------------------------------- 60 60 #include <string> 61 61 #include <vector> 62 62 63 #include <GLKit/GLKMatrix4.h> 64 63 65 #ifdef _PYMOL_IP_EXTRAS 64 66 #include "IncentiveCopyToClipboard.h" 65 67 #endif … … void SceneRender(PyMOLGlobals * G, Picki 9072 9074 } 9073 9075 if(!SettingGetGlobal_b(G, cSetting_ortho)) { 9074 9076 float fov = SettingGetGlobal_f(G, cSetting_field_of_view); 9075 gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe); 9077 // gluPerspective(fov, aspRat, I->FrontSafe, I->BackSafe); 9078 glMultMatrixf(GLKMatrix4MakePerspective(fov*PI/180., aspRat, I->FrontSafe, I->BackSafe).m); 9076 9079 } else { 9077 9080 height = fmax(R_SMALL4, -I->Pos[2]) * GetFovWidth(G) / 2.f; 9078 9081 width = height * aspRat; -
setup.py
else: # unix style (linux, mac, ...) 274 274 glut = posix_find_lib(['glut', 'freeglut'], lib_dirs) 275 275 pyogl_libs += ["GL", "GLU", glut] 276 276 277 if sys.platform == 'darwin': 278 ext_link_args += [ 279 "-framework", "GLKit", 280 ] 281 277 282 libs += ["GLEW"] 278 283 libs += pyogl_libs 279 284