1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
{\rtf1\ansi\ansicpg1253\deff0{\fonttbl{\f0\fnil\fcharset0 Arial;}}
{\colortbl ;\red163\green21\blue21;}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\cf1\lang1033\b\fs28 Introduction\b0\fs22\par
\par
This sample tests the behavior of the OpenTK.BlittableValueType class. This class contains methods to simplify interop with unmanaged code: BlittableValueType.Check() returns true if the a specified type is safe for use with OpenGL/AL/CL, while BlittableValueType.StrideOf() returns the size of the type in bytes, after marshalling.\par
\par
Because those methods are relatively expensive, their results are cached in BlittableValueType<T> automatically. Unlike System.Runtime.InteropServices.Marshal.SizeOf() and similar methods, BlittableValueType is safe to use in performance-sensitive code.\par
\par
\b\fs28 Controls\par
\b0\fs22\par
None.\par
\par
\b\fs28 Implementation\par
\b0\fs22\par
1. The sample defines a number of of simple and composite managed types (enums, structs, generic structs, classes and generic classes and various combinations thereof.)\par
\par
2. The Main method creates an instance of each type and calls BlittableValueType.Check to see whether each type is blittable and BlittableValueType.StrideOf to print the size of blittable instances.\par
}
|