RazortoothRTC / rayfork-sokol-template

A simple rayfork project template with sokol-app and CMake
0 stars 0 forks source link

Add metal support on mac #2

Open truedat101 opened 6 months ago

truedat101 commented 6 months ago

Everything is hardcoded to GL but GL isn't supported (it compiles but is stuck at an old version). Move to metal. Might need matal-cpp or a C-wrapper: https://github.com/recp/cmt

truedat101 commented 6 months ago

Reviewing the sokol samples repo here:

The libraries needed:

https://github.com/floooh/sokol-samples/blob/master/metal/CMakeLists.txt

are

fips_begin_lib(osxentry)
    fips_files(osxentry.m osxentry.h)
    fips_frameworks_osx(Foundation)
    if (FIPS_MACOS)
        fips_frameworks_osx(Cocoa Metal MetalKit QuartzCore)
    else()
        fips_frameworks_osx(UIKit Metal MetalKit)
    endif()
fips_end_lib()

fips_begin_lib(sokol_gfx)
    fips_files(sokol_gfx.m)
    if (FIPS_MACOS)
        fips_frameworks_osx(Cocoa Metal MetalKit QuartzCore)
    else()
        fips_frameworks_osx(Metal MetalKit)
    endif()
fips_end_lib()
truedat101 commented 6 months ago

So really: