Created
June 24, 2011 02:38
-
-
Save frostney/1044116 to your computer and use it in GitHub Desktop.
Changes to get dglOpenGL.pas (www.delphigl.com) OpenGL 4.1 header working on Mac OS X
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
Open dglOpenGL.pas in your favorite text editor and change the following lines | |
*) | |
// Don't worry about having absolute filepaths. Mac OS X always installs the OpenGL framework with every | |
// clean installation of Mac OS X and the dylibs are ALWAYS in that path. (Tested on several Mac OS X | |
// machines including PowerMac G5 with Leopard, MacBook with Snow Leopard, MacBook Pro with Snow Leopard and Lion) | |
// While the standard search directory for libraries is /usr/lib on Mac OS X as well, you should not use this | |
// for developing your application as other Mac users don't have the OpenGL libraries in that folder and your | |
// application won't launch for them. (/usr/lib on Mac OS X is only used in some special cases, everything | |
// else relies on frameworks.) | |
// Lines 12900 - 12912 | |
const | |
{$IFDEF DGL_WIN} | |
OPENGL_LIBNAME = 'OpenGL32.dll'; | |
GLU_LIBNAME = 'GLU32.dll'; | |
{$ELSE} | |
{$IFDEF darwin} | |
OPENGL_LIBNAME = '/System/Library/Frameworks/OpenGL.framework/Libraries/libGL.dylib'; | |
GLU_LIBNAME = '/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib'; | |
{$ELSE} | |
OPENGL_LIBNAME = 'libGL.so.1'; | |
GLU_LIBNAME = 'libGLU.so.1'; | |
{$ENDIF} | |
{$ENDIF} | |
// If you don't add the additional Darwin condition, you'll get an access violation when launching your | |
// application (needed for 32-bit binaries) | |
// Lines 17855 - 17859 | |
{$IFDEF CPU386} | |
{$IFNDEF DARWIN} | |
Set8087CW($133F); | |
{$ENDIF} | |
{$ENDIF} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@CraigChapman53280 I used to do a lot of FreePascal, but I haven't done a lot in the recent years. For window management I would recommend using SDL2, SDL or GLFW with a strong preference on SDL2. (https://github.com/ev1313/Pascal-SDL-2-Headers)
This is an older example I made 2 1/2 years ago based on the rotating cube example to make sure SDL2 and the Pascal headers are going to work with OS X.