Forum > OpenGL

Metal Framework for MacOS

(1/6) > >>

I have created a few Lazarus projects that can be compiled for Apple's new Metal API.
Most of these projects can also be compiled to support OpenGL 3.3 Core - providing support for Windows, Linux and older Macs. By keeping a thin layer for either OpenGL or Metal, one can retain most of Lazarus' "write once, compile everywhere" magic.

  The documentation is sparse, but both the main page and the line project include some useful information

The Metal support uses Ryan Joseph's lazmetalcontrol
My examples all use Lazarus. However, Ryan's repository also includes some examples of how to use Metal directly from freepascal without Lazarus.

Ryan deserves incredible credit - has framework provides a great a very simple way to use this powerful but complex API.

Igor Kokarev:
Hi Chris,

Thanks for your demos with Metal API on macOS!

Can you check MeshProj project with Lazarus 2.0.6?

We have the following error during compilation on macOS High Sierra:

glcocoanscontext(506,45) Error: identifier idents no member "KeyEvent"
glcocoanscontext(512,45) Error: identifier idents no member "KeyEvent"
glcocoanscontext(518,45) Error: identifier idents no member "KeyEvent"

Project: Metal-Demos-master/mesh/MeshProj.lpi

I've added this overlooked macOS gem to the Wiki:

Igor Kokarev:
Thanks, one correction:
"to use Metal you will need macOS 10.12 (Sierra)"

Metal was introduced in macOS 10.11 (El Capitan).

The Lazarus 2.0.6 release for MacOS contained a regression for OpenGL support.
GLCocoaNSContext.pas now requires "cocoa_extra" in uses section. You can either edit your copy or get a new copy from trunk

Alternatively, you can use Lazarus trunk rather than 2.0.6.   


[0] Message Index

[#] Next page

Go to full version