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, only .NET Standard 2.0 is 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.

CodeX.System

This section shows the native functions that are used by the SDK component CodeX.System via static linkage.

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

GetModuleHandle

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

OutputDebugString

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

_CrtSetDbgFlag

Windows

C++

CodeX::MemoryPlumber

Tinman.Licence

This section shows the native functions that are used by the SDK component Tinman.Licence via static linkage.

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

GetFileVersionInfo

Windows

C++

GetFileVersionInfoSize

Windows

C++

GetModuleFileName

Windows

C++

GetSystemTime

Windows

C++

GetUserName

Windows

C++

GetUserNameEx

Windows

C++

SystemTimeToFileTime

Windows

C++

VerQueryValue

Windows

C++

Tinman.Core

This section shows the native functions that are used by the SDK component Tinman.Core via static linkage.

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

AllocConsole

Windows

C# C++

CloseHandle

Windows

C# C++

CreateDirectory

Windows

C++

CreateFile

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++

FreeAddrInfo

Windows

C++

FreeLibrary

Windows

C# C++

GetAddrInfo

Windows

C++

GetConsoleOutputCP

Windows

C++

GetConsoleScreenBufferInfo

Windows

C++

GetConsoleWindow

Windows

C++

GetCurrentDirectory

Windows

C++

GetCurrentProcess

Windows

C# C++

GetDiskFreeSpaceEx

Windows

C# C++

GetDriveType

Windows

C++

GetEnvironmentVariable

Windows

C++

GetFileAttributes

Windows

C++

GetFileAttributesEx

Windows

C++

GetFileSizeEx

Windows

C++

GetLastError

Windows

C++

GetLogicalDrives

Windows

C++

GetModuleHandle

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++

GetTempPath

Windows

C++

GetTickCount

Windows

C++

GlobalFree

Windows

C++

GlobalMemoryStatusEx

Windows

C# C++

InitializeConditionVariable

Windows

C++

InitializeCriticalSectionEx

Windows

C++

LeaveCriticalSection

Windows

C++

LoadIcon

Windows

C++

LoadLibrary

Windows

C# C++

LockResource

Windows

C++

MoveFile

Windows

C++

QueryPerformanceCounter

Windows

C# C++

QueryPerformanceFrequency

Windows

C# C++

RaiseException

Windows

C++

Thread.NameThread.Start (DEBUG only)

ReadFile

Windows

C# C++

RegCloseKey

Windows

C++

RegOpenKeyEx

Windows

C++

RegQueryValueEx

Windows

C++

RemoveDirectory

Windows

C++

ResumeThread

Windows

C++

SHGetFolderPath

Windows

C++

SendMessage

Windows

C++

SetConsoleCtrlHandler

Windows

C++

SetConsoleTitle

Windows

C++

SetCurrentDirectory

Windows

C++

SetEndOfFile

Windows

C# C++

SetEnvironmentVariable

Windows

C++

SetFilePointerEx

Windows

C# C++

SetFileTime

Windows

C++

SetThreadPriority

Windows

C++

SizeofResource

Windows

C++

SleepConditionVariableCS

Windows

C++

SleepEx

Windows

C++

SystemTimeToFileTime

Windows

C++

WSAGetLastError

Windows

C++

WakeAllConditionVariable

Windows

C++

WideCharToMultiByte

Windows

C++

WinHttpAddRequestHeaders

Windows

C++

WinHttpCloseHandle

Windows

C++

WinHttpConnect

Windows

C++

WinHttpCrackUrl

Windows

C++

WinHttpGetIEProxyConfigForCurrentUser

Windows

C++

WinHttpOpen

Windows

C++

WinHttpOpenRequest

Windows

C++

WinHttpQueryHeaders

Windows

C++

WinHttpReadData

Windows

C++

WinHttpReceiveResponse

Windows

C++

WinHttpSendRequest

Windows

C++

WinHttpSetTimeouts

Windows

C++

WriteFile

Windows

C# C++

accept

all

C++

bind

all

C++

closesocket

Windows

C++

connect

Windows

C++

fflush

all

C++

freopen

Windows

C++

gethostbyname

Windows

C++

getsockname

Windows

C++

htonl

Windows

C++

htons

Windows

C++

inet_ntoa

Windows

C++

listen

all

C++

memcpy

all

C++

memset

all

C++

mono_get_runtime_build_info

all

C#

printf

all

C++

recv

Windows

C++

send

Windows

C++

shutdown

Windows

C++

socket

Windows

C++

Tinman.Engine

This section shows the native functions that are used by the SDK component Tinman.Engine via static linkage.

Table 4. 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++

CreateWindowEx

Windows

C# C++

DefWindowProc

Windows

C# C++

DestroyWindow

Windows

C# C++

DispatchMessage

Windows

C# C++

EmptyClipboard

Windows

C# C++

FreeLibrary

Windows

C++

GetClientRect

Windows

C# C++

GetClipCursor

Windows

C# C++

GetClipboardData

Windows

C# C++

GetCursorPos

Windows

C# C++

GetDC

Windows

C# C++

GetDpiForWindow

Windows

C# C++

GetFocus

Windows

C# C++

GetKeyState

Windows

C# C++

GetModuleHandle

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++

GetWindowText

Windows

C# C++

GetWindowTextLength

Windows

C# C++

GlobalAlloc

Windows

C++

GlobalFree

Windows

C++

GlobalLock

Windows

C# C++

GlobalUnlock

Windows

C# C++

IsWindow

Windows

C# C++

LoadCursor

Windows

C# C++

LoadIcon

Windows

C# C++

LoadLibrary

Windows

C++

OpenClipboard

Windows

C# C++

PeekMessage

Windows

C# C++

RegisterClass

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++

SetWindowLongPtr

Windows

C# C++

SetWindowPos

Windows

C# C++

SetWindowText

Windows

C# C++

ShowCursor

Windows

C# C++

ShowWindow

Windows

C# C++

SwapBuffers

Windows

C# C++

SystemParametersInfo

Windows

C# C++

TrackMouseEvent

Windows

C# C++

TranslateMessage

Windows

C# C++

UnregisterClass

Windows

C# C++

Tinman.AddOns.DirectX12

This section shows the native functions that are used by the SDK component Tinman.AddOns.DirectX12 via static linkage.

Table 5. 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 that are used by the SDK component Tinman.AddOns.WinForms via static linkage.

Table 6. 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 7. 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 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

LocalFileSystemIFile.Read
LocalFileSystemIFile.Write

Concurrent accesses are synchronized per file and thus become sequential.

LocalFileSystemIFileSystem.DirectoryFreeSpace

Not available, the method will return 0.

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

Not available, native libraries cannot be loaded.

In consequence, the following will also not be available: AssimpModelFormat, GdalImageFormat, ProjCoordinateTransform, MG, GL, GLES, WGL, GLX, EGL.
Terminal.Window

Not available, the method will return silently.

Tinman.Engine

ApplicationUtil.Clipboard

Not available, using this property has no effect.

ApplicationWindow.Create

Not available, the method will return null.

RenderContext.Create
RenderContext.Current

Not available, the methods will return null.

In consequence, OpenGL and OpenGLES will also not be available.