From b12eb4fb98621e82de4a8d6d5342e9b36a6d3a7f Mon Sep 17 00:00:00 2001 From: Martin Date: Mon, 11 Dec 2023 13:27:36 +0100 Subject: [PATCH] [Mac] Remove print in getProcAddressInternal --- .../Instructions/OpenGL.fs | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/Aardvark.Rendering.GL/Instructions/OpenGL.fs b/src/Aardvark.Rendering.GL/Instructions/OpenGL.fs index f06fdfe4..404c74bc 100644 --- a/src/Aardvark.Rendering.GL/Instructions/OpenGL.fs +++ b/src/Aardvark.Rendering.GL/Instructions/OpenGL.fs @@ -380,45 +380,43 @@ module OpenGl = /// 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) (name : string) =