Native Libraries

This page documents the native functions that are used by the Abstraction Layers of the Tinman 3D SDK.

Platforms

The following identifiers are used to refer to native platforms.

Windows / LowLevel.IsWindows

Running on a system with Windows 7 or newer.

POSIX / LowLevel.IsPosix

Running on a POSIX.1-2008 compliant system.

The LowLevel.PlatformForce method can be used to override automatic platform detection.

Static Linkage

The native functions listed in this section are required by the Tinman 3D SDK. If not available, errors will occur:

C#

DllNotFoundException or EntryPointNotFoundException will be thrown when the native function is used for the first time. If neither Windows nor POSIX is available at runtime, the .NET Fallback will be used.

C++

Executables will fail to start and dynamic link libraries will fail to load. Either the Windows or the POSIX platform must be available, otherwise compilation will fail.

The separate AddOn library components wrap 3rd-party libraries (for example Direct3D or SQLite). Their respective native function / library dependencies are not documented here.

The following convention is used by the Used By columns of the tables in the following subsections:

A ⇒ B, C, …​

The type or member A is used with a suitable API (see the documentation of A for obvious choices), to obtain objects of type B, C, …​

A . B
A :: B
A → B, C, …​

The members B, C, …​ of the type A are used.

CodeX.System / Windows

This section shows the native functions used by the SDK component CodeX.System.

Table 1. Native function dependencies of CodeX.System
Native Dependency Platform SDK Used By

EnterCriticalSection

Windows

C++

CodeX::SimpleMutex

EnumWindows

Windows

C++

CodeX::GetMainWindowHandle

GdiplusShutdown

Windows

C++

CodeX::GDIP_End

GdiplusStartup

Windows

C++

CodeX::GDIP_Begin

GetCurrentProcessId

Windows

C++

CodeX::GetMainWindowHandle

GetModuleHandleW

Windows

C++

CodeX::GetNativeModuleHandleFor

GetWindow

Windows

C++

CodeX::GetMainWindowHandle

GetWindowThreadProcessId

Windows

C++

CodeX::GetMainWindowHandle

InitializeCriticalSectionEx

Windows

C++

CodeX::SimpleMutex

IsWindowVisible

Windows

C++

CodeX::GetMainWindowHandle

LeaveCriticalSection

Windows

C++

CodeX::SimpleMutex

OutputDebugStringW

Windows

C++

Codex::MemoryPlumber

SetErrorMode

Windows

C++

Codex::SimpleMutex

WSACleanup

Windows

C++

CodeX::WSA_End

WSAGetLastError

Windows

C++

CodeX::WSA_Begin

WSAStartup

Windows

C++

CodeX::WSA_Begin

_CrtDumpMemoryLeaks

Windows

C++

CodeX::MemoryPlumber

_CrtSetDbgFlag

Windows

C++

CodeX::MemoryPlumber

CodeX.System / POSIX

This section shows the native functions used by the SDK component CodeX.System.

Table 2. Native function dependencies of CodeX.System
Native Dependency Platform SDK Used By

pthread_mutexattr_init

POSIX

C++

CodeX::SimpleMutex

pthread_mutexattr_settype

POSIX

C++

CodeX::SimpleMutex

pthread_mutex_init

POSIX

C++

CodeX::SimpleMutex

pthread_mutex_lock

POSIX

C++

CodeX::SimpleMutex

pthread_mutex_unlock

POSIX

C++

CodeX::SimpleMutex

Tinman.Licence / Windows

This section shows the native functions used by the SDK component Tinman.Licence.

Table 3. Native function dependencies of Tinman.Licence
Native Dependency Platform SDK Used By

CloseHandle

Windows

C++

CreateFileW

Windows

C++

GetAdaptersAddresses

Windows

C++

GetComputerNameW

Windows

C++

GetDiskFreeSpaceExW

Windows

C++

GetDriveTypeW

Windows

C++

GetFileSizeEx

Windows

C++

GetFileVersionInfoSizeW

Windows

C++

GetFileVersionInfoW

Windows

C++

GetLogicalDrives

Windows

C++

GetModuleFileNameW

Windows

C++

GetSystemDirectoryW

Windows

C++

GetSystemInfo

Windows

C++

GetSystemTime

Windows

C++

GetUserNameExW

Windows

C++

GetUserNameW

Windows

C++

GetVolumeInformationW

Windows

C++

ReadFile

Windows

C++

SystemTimeToFileTime

Windows

C++

VerQueryValueW

Windows

C++

Tinman.Licence / POSIX

This section shows the native functions used by the SDK component Tinman.Licence.

Table 4. Native function dependencies of Tinman.Licence
Native Dependency Platform SDK Used By

clock_gettime

POSIX

C++

close

POSIX

C++

freeifaddrs

POSIX

C++

fstat

POSIX

C++

geteuid

POSIX

C++

gethostname

POSIX

C++

getifaddrs

POSIX

C++

getpwuid

POSIX

C++

open

POSIX

C++

pread

POSIX

C++

readlink

POSIX

C++

sysconf

POSIX

C++

uname

POSIX

C++

Tinman.Core

This section shows the native functions used by the SDK component Tinman.Core.

Table 5. Native function dependencies of Tinman.Core
Native Dependency Platform SDK Used By

accept

all

C++

bind

all

C++

connect

all

C++

getsockname

all

C++

getsockopt

all

C++

inet_ntop

all

C++

listen

all

C++

mono_get_runtime_build_info

all

C#

recv

all

C++

send

all

C++

setsockopt

all

C++

shutdown

all

C++

socket

all

C++

Tinman.Core / Windows

This section shows the native functions used by the SDK component Tinman.Core.

Table 6. Native function dependencies of Tinman.Core
Native Dependency Platform SDK Used By

AllocConsole

Windows

C# C++

CloseHandle

Windows

C# C++

closesocket

Windows

C++

CreateDirectory

Windows

C++

CreateEventW

Windows

C++

CreateFileW

Windows

C# C++

CreateThread

Windows

C++

DeleteCriticalSection

Windows

C++

DeleteFile

Windows

C++

EnterCriticalSection

Windows

C++

FindClose

Windows

C++

FindFirstFile

Windows

C++

FindNextFile

Windows

C++

FindResource

Windows

C++

FlushFileBuffers

Windows

C# C++

FreeAddrInfoExW

Windows

C++

FreeLibrary

Windows

C# C++

GetAddrInfoExCancel

Windows

C++

GetAddrInfoExOverlappedResult

Windows

C++

GetAddrInfoExW

Windows

C++

GetConsoleScreenBufferInfoEx

Windows

C++

GetConsoleWindow

Windows

C++

GetCurrentDirectoryW

Windows

C++

GetCurrentProcess

Windows

C# C++

GetDiskFreeSpaceExW

Windows

C# C++

GetDriveTypeW

Windows

C++

GetEnvironmentVariableW

Windows

C++

GetFileAttributes

Windows

C++

GetFileAttributesEx

Windows

C++

GetFileSizeEx

Windows

C++

GetLastError

Windows

C++

GetLogicalDrives

Windows

C++

GetModuleHandleW

Windows

C++

GetProcAddress

Windows

C# C++

GetProcessMemoryInfo

Windows

C++

GetProcessTimes

Windows

C# C++

GetStdHandle

Windows

C++

GetSystemInfo

Windows

C++

GetSystemTime

Windows

C++

GetSystemTimes

Windows

C# C++

GetTempPathW

Windows

C++

GetTickCount

Windows

C++

GlobalFree

Windows

C++

GlobalMemoryStatusEx

Windows

C# C++

InitializeConditionVariable

Windows

C++

InitializeCriticalSectionEx

Windows

C++

ioctlsocket

Windows

C++

IsDebuggerPresent

Windows

C++

LeaveCriticalSection

Windows

C++

MonitorEnd

LoadIconW

Windows

C++

LoadLibraryW

Windows

C# C++

LoadResource

Windows

C++

LockResource

Windows

C++

MoveFile

Windows

C++

QueryPerformanceCounter

Windows

C++

QueryPerformanceFrequency

Windows

C++

RaiseException

Windows

C++

Thread.Name (DEBUG only)

ReadConsoleW

Windows

C++

ReadFile

Windows

C# C++

RegCloseKey

Windows

C++

RegOpenKeyExW

Windows

C++

RegQueryValueExW

Windows

C++

RemoveDirectory

Windows

C++

ResumeThread

Windows

C++

SendMessage

Windows

C++

SetConsoleCtrlHandler

Windows

C++

SetConsoleTitle

Windows

C++

SetCurrentDirectoryW

Windows

C++

SetEndOfFile

Windows

C# C++

SetEnvironmentVariableW

Windows

C++

SetFilePointerEx

Windows

C# C++

SetFileTime

Windows

C++

SetThreadPriority

Windows

C++

SHGetFolderPathW

Windows

C++

SizeofResource

Windows

C++

SleepConditionVariableCS

Windows

C++

SleepEx

Windows

C++

SystemTimeToFileTime

Windows

C++

WaitForSingleObject

Windows

C++

WakeAllConditionVariable

Windows

C++

WinHttpAddRequestHeaders

Windows

C++

SimpleHttp ⇒ …​

WinHttpCloseHandle

Windows

C++

SimpleHttp ⇒ …​

WinHttpConnect

Windows

C++

SimpleHttp ⇒ …​

WinHttpCrackUrl

Windows

C++

SimpleHttp ⇒ …​

WinHttpGetIEProxyConfigForCurrentUser

Windows

C++

SimpleHttp ⇒ …​

WinHttpOpen

Windows

C++

SimpleHttp ⇒ …​

WinHttpOpenRequest

Windows

C++

SimpleHttp ⇒ …​

WinHttpQueryHeaders

Windows

C++

SimpleHttp ⇒ …​

WinHttpReadData

Windows

C++

SimpleHttp ⇒ …​

WinHttpReceiveResponse

Windows

C++

SimpleHttp ⇒ …​

WinHttpSendRequest

Windows

C++

SimpleHttp ⇒ …​

WinHttpSetTimeouts

Windows

C++

SimpleHttp ⇒ …​

WriteConsoleW

Windows

C++

WriteFile

Windows

C# C++

WSAGetLastError

Windows

C++

SocketEndPoint ⇒ …​

WSAPoll

Windows

C++

Tinman.Core / POSIX

This section shows the native functions used by the SDK component Tinman.Core.

Table 7. Native function dependencies of Tinman.Core
Native Dependency Platform SDK Used By

chdir

POSIX

C++

clock_gettime

POSIX

C++

close

POSIX

C# C++

closedir

POSIX

C++

dlclose

POSIX

C# C++

dlopen

POSIX

C# C++

dlsym

POSIX

C# C++

fcntl

POSIX

C++

freeaddrinfo

POSIX

C++

fstat

POSIX

C++

fsync

POSIX

C# C++

ftruncate

POSIX

C# C++

ftruncate64

POSIX

C#

futimens

POSIX

C++

gai_cancel

POSIX

C++

gai_error

POSIX

C++

gai_suspend

POSIX

C++

getaddrinfo

POSIX

C++

getaddrinfo_a

POSIX

C++

getenv

POSIX

C++

localtime

POSIX

C++

mkdir

POSIX

C++

nanosleep

POSIX

C++

open

POSIX

C# C++

opendir

POSIX

C++

poll

POSIX

C++

pread

POSIX

C# C++

pread64

POSIX

C#

pthread_attr_getschedpolicy

POSIX

C++

pthread_attr_init

POSIX

C++

pthread_attr_setinheritsched

POSIX

C++

pthread_attr_setschedparam

POSIX

C++

pthread_cond_broadcast

POSIX

C++

pthread_cond_destroy

POSIX

C++

pthread_cond_init

POSIX

C++

pthread_cond_timedwait

POSIX

C++

pthread_create

POSIX

C++

pthread_exit

POSIX

C++

pthread_mutex_destroy

POSIX

C++

pthread_mutex_init

POSIX

C++

pthread_mutex_lock

POSIX

C++

pthread_mutex_unlock

POSIX

C++

MonitorEnd

pthread_mutexattr_init

POSIX

C++

pthread_mutexattr_settype

POSIX

C++

pthread_setname_np

POSIX

C++

Thread.Name (DEBUG only)

pwrite

POSIX

C# C++

pwrite64

POSIX

C#

readdir

POSIX

C++

readlink

POSIX

C++

realpath

POSIX

C++

remove

POSIX

C++

rename

POSIX

C++

rmdir

POSIX

C++

sched_get_priority_max

POSIX

C++

sched_get_priority_min

POSIX

C++

setenv

POSIX

C++

sigaction

POSIX

C++

stat

POSIX

C++

statvfs

POSIX

C# C++

statvfs64

POSIX

C#

sysconf

POSIX

C++

time

POSIX

C++

Tinman.Engine / Windows

This section shows the native functions used by the SDK component Tinman.Engine.

Table 8. Native function dependencies of Tinman.Engine
Native Dependency Platform SDK Used By

AdjustWindowRect

Windows

C# C++

ChoosePixelFormat

Windows

C# C++

ClientToScreen

Windows

C# C++

ClipCursor

Windows

C# C++

CloseClipboard

Windows

C# C++

CreateWindowExW

Windows

C# C++

DefWindowProcW

Windows

C# C++

DestroyWindow

Windows

C# C++

DispatchMessageW

Windows

C# C++

EmptyClipboard

Windows

C# C++

FreeLibrary

Windows

C++

GetClientRect

Windows

C# C++

GetClipboardData

Windows

C# C++

GetClipCursor

Windows

C# C++

GetCursorPos

Windows

C# C++

GetDC

Windows

C# C++

GetDpiForWindow

Windows

C# C++

GetFocus

Windows

C# C++

GetKeyState

Windows

C# C++

GetModuleHandleW

Windows

C# C++

GetPixelFormat

Windows

C# C++

GetProcAddress

Windows

C++

GetStockObject

Windows

C# C++

GetSystemDpiForProcess

Windows

C# C++

GetSystemMetrics

Windows

C# C++

GetWindowInfo

Windows

C# C++

GetWindowTextLengthW

Windows

C# C++

GetWindowTextW

Windows

C# C++

GlobalAlloc

Windows

C++

GlobalFree

Windows

C++

GlobalLock

Windows

C# C++

GlobalUnlock

Windows

C# C++

LoadCursorW

Windows

C# C++

LoadIconW

Windows

C# C++

LoadLibraryW

Windows

C++

OpenClipboard

Windows

C# C++

PeekMessageW

Windows

C# C++

RegisterClassW

Windows

C# C++

ReleaseDC

Windows

C# C++

SetClipboardData

Windows

C# C++

SetCursor

Windows

C# C++

SetCursorPos

Windows

C# C++

SetFocus

Windows

C# C++

SetPixelFormat

Windows

C# C++

SetWindowLongPtrW

Windows

C# C++

SetWindowPos

Windows

C# C++

SetWindowTextW

Windows

C# C++

ShowCursor

Windows

C# C++

ShowWindow

Windows

C# C++

SwapBuffers

Windows

C# C++

SystemParametersInfoW

Windows

C# C++

TrackMouseEvent

Windows

C# C++

TranslateMessage

Windows

C# C++

UnregisterClassW

Windows

C# C++

Tinman.AddOns.DirectX12

This section shows the native functions used by the SDK component Tinman.AddOns.DirectX12.

Table 9. Native function dependencies of Tinman.AddOns.DirectX12
Native Dependency Platform SDK Used By

CloseHandle

Windows

C++

Tinman.AddOns.WinForms

This section shows the native functions used by the SDK component Tinman.AddOns.WinForms.

Table 10. Native function dependencies of Tinman.AddOns.WinForms
Native Dependency Platform SDK Used By

GetFontUnicodeRanges

Windows

C#

Tinman.AddOns.WinForms.SystemFontGlyphs

SelectObject

Windows

C#

Tinman.AddOns.WinForms.SystemFontGlyphs

Dynamic Linkage

The native functions listed in this section are accessed through the NativeLibrary class. They are not required by the Tinman 3D SDK, but their availability will enable add-on features.

The source code of all NativeLibrary subclasses (including non-public ones) is included in the SDK. Please refer to the LibraryNames and InitializeFunctionPointers members for details on which native library files are loaded and which entry points are queried.
Table 11. Native library dependencies with dynamic linkage
SDK Feature Native Library Wrapper

File Formats

AssimpModelFormat

AssimpLibrary (non-public class)

GdalImageFormat

GdalLibrary (non-public class)

OpenFlightModelFormat

MG

OpenFlightSceneDataFormat

MG

OpenGL

OpenGLBufferFactory, OpenGLContextFactory, OpenGLMeshDispatcher, OpenGLPrimitiveRenderer, OpenGLTextureFactory, OpenGLWorkDispatcher

GL, EGL, GLX, WGL

OpenGLES

OpenGLESBufferFactory, OpenGLESContextFactory, OpenGLESMeshDispatcher, OpenGLESPrimitiveRenderer, OpenGLESTextureFactory,

GLES, EGL, GLX, WGL

Miscellaneous

ProjCoordinateTransform

ProjLibrary (non-public class)

.NET Fallback

The C# version of the Tinman 3D SDK will fallback to plain .NET 6.0 (or higher, if available) or .NET Standard 2.0, if both LowLevel.IsWindows and LowLevel.IsPosix return false. In fallback mode, some functionality will be limited or unavailable, as described below.

Tinman.Core

LocalFileSystemIFileSystem.MaximumDirectoryPathLength
LocalFileSystemIFileSystem.MaximumFilePathLength
LocalFileSystemIFileSystem.MaximumPathElementLength

Not available, the properties will return Maths.MaxInt.

LowLevel.CpuTotal
LowLevel.CpuUsed
LowLevel.MemoryTotal
LowLevel.MemoryUsed

Not available, the properties will return 0.

LowLevel.TickCount
LowLevel.TickCountPrecise

Instead of the high-resolution timer, the default system timer is used, which might be less accurate.

NativeLibrary.IsLibraryLoaded
NativeLibrary.LookupFunctionPointer

Available only when running in a .NET 6.0 (or higher) environment. In other environments, native libraries cannot be loaded dynamically.

In consequence, the following may be unavailable:
AssimpModelFormat, GdalImageFormat, ProjCoordinateTransform, MG, GL, GLES, WGL, GLX, EGL.
Terminal.Window

No new console window will be created. Only the title of the existing console window will be set.

Tinman.Engine

ApplicationWindowFactory.All

There is no built-in IApplicationWindowFactory instance, the returned list will be empty. Factories must be provided by another library.

This also affects the following:

In consequence, the following may be unavailable:
OpenGL, OpenGLES.