Skip to content

Commit

Permalink
[Mac] Remove print in getProcAddressInternal
Browse files Browse the repository at this point in the history
  • Loading branch information
hyazinthh committed Dec 11, 2023
1 parent 4bda9ab commit b12eb4f
Showing 1 changed file with 29 additions and 31 deletions.
60 changes: 29 additions & 31 deletions src/Aardvark.Rendering.GL/Instructions/OpenGL.fs
Original file line number Diff line number Diff line change
Expand Up @@ -380,45 +380,43 @@ module OpenGl =
/// </summary>
let getProcAddressInternal (name : string) =
match System.Environment.OSVersion with
| Linux ->
if opengl32 = 0n then
opengl32Lib <- DynamicLinker.loadLibrary "libGL.so.1"
opengl32 <- opengl32Lib.Handle
| Linux ->
if opengl32 = 0n then
opengl32Lib <- DynamicLinker.loadLibrary "libGL.so.1"
opengl32 <- opengl32Lib.Handle

match GLX.GetProcAddress name with
| 0n -> 0n
| ptr -> ptr
| Mac ->
match GLX.GetProcAddress name with
| 0n -> 0n
| ptr -> ptr

let ctx = OpenTK.Graphics.GraphicsContext.CurrentContext :?> OpenTK.Graphics.IGraphicsContextInternal
| Mac ->
let ctx = OpenTK.Graphics.GraphicsContext.CurrentContext :?> OpenTK.Graphics.IGraphicsContextInternal
ctx.GetAddress name

let handle = ctx.GetAddress name
if handle = 0n then printfn "could not grab: %s" name
handle
(*if opengl32 = 0n then
let ctx : OpenTK.Graphics.IGraphicsContextInternal = failwith ""
(*if opengl32 = 0n then
let ctx : OpenTK.Graphics.IGraphicsContextInternal = failwith ""
ctx.GetAddress(name)
ctx.GetAddress(name)
opengl32Lib <- DynamicLinker.loadLibrary "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
opengl32 <- opengl32Lib.Handle
opengl32Lib <- DynamicLinker.loadLibrary "/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib"
opengl32 <- opengl32Lib.Handle
let handle = opengl32Lib.GetFunction(name).Handle
if handle <> 0n then Log.warn "could not get function ptr: %A" name
handle*)
let handle = opengl32Lib.GetFunction(name).Handle
if handle <> 0n then Log.warn "could not get function ptr: %A" name
handle*)

| Windows ->
if opengl32 = 0n then
opengl32Lib <- DynamicLinker.loadLibrary "Opengl32.dll"
opengl32 <- opengl32Lib.Handle
| Windows ->
if opengl32 = 0n then
opengl32Lib <- DynamicLinker.loadLibrary "Opengl32.dll"
opengl32 <- opengl32Lib.Handle

match Wgl.GetDefaultProcAddress name with
| 0n -> match Wgl.GLGetProcAddress name with
| 0n -> match Wgl.GetProcAddress(opengl32, name) with
| 0n -> 0n
| ptr -> ptr
| ptr -> ptr
| ptr -> ptr
match Wgl.GetDefaultProcAddress name with
| 0n -> match Wgl.GLGetProcAddress name with
| 0n -> match Wgl.GetProcAddress(opengl32, name) with
| 0n -> 0n
| ptr -> ptr
| ptr -> ptr
| ptr -> ptr


let rec getProcAddressProbing (suffixes : list<string>) (name : string) =
Expand Down

0 comments on commit b12eb4f

Please sign in to comment.