Is freetype installed on Mac?

I am relatively new to Mac OS X. I tried to install the freetype library to display text in OpenGL, but I failed. I read on some forum that freetype comes with a Mac OS X mountain lion preinstalled. I just wanted to confirm this. If this really happens with a Mac, then how can I include it in my project? If this does not happen with a Mac, then what is the ideal set of steps one for installing freetype on a Mac?

+6
source share
1 answer

The dynamic link library comes with a preinstalled version, so you can use any software that requires freetype2:

/usr/X11/lib/libfreetype.6.dylib 

However, the actual headers and those needed to create the freetype2 project do not ship with OS X. To get them, you need to install Xcode; when you install Xcode with any version of the OS X platform SDK, it comes with freetype2:

 /Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/freetype2/freetype/freetype.h 

These days, I think you need to go through the App Store to download Xcode, but it's free, and that's all you need to start developing GL / freetype2 software on OS X. I believe they have stopped turning on Xcode installs DVDs with OS 10.6 on OS X, so signing up as an Apple developer or through the App Store is probably your only option.


By the way, you will have to jump over a few hoops when you first start using OpenGL on OS X. It is slightly different from most platforms, especially when it comes to downloading (or rather not loading) extensions at runtime. Apple implements the full set of functions for the OpenGL 2.1 / 3.2 kernel for all OS X 10.7+ systems, even if the underlying GPU does not support all this - it has software backups for anything that is not supported by the hardware.

Thus, you do not need to worry about downloading extensions based on the installed capabilities of the GPU, but you need to worry about whether using the function will throw you on a programmatic path. You should also be content with more than the average wait time for new versions of OpenGL to be implemented, but this is the price you pay for guaranteed support for the feature set. I suppose.

I suggest you use something like glfw or SDL2 at startup, especially if you don't like Objective-C (anyone, honestly?). A lot of the new OpenGL contextual management these days should be done using Objective-C (cocoa); Apple is not a big fan of its own C (carbon) APIs. glfw and SDL2 hide all this from you, so you don’t need to write one piece of ugly Objective-C code if you don't want to :)

+8
source

Source: https://habr.com/ru/post/954133/


All Articles