TriEngine  v0.0.16
General-purpose engine in C#/OpenGL
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events
TriDevs.TriEngine.Native.Helpers Class Reference

Helper class with various methods to help native coding and debugging. More...

Static Public Member Functions

static int GetLastError ()
 Gets the last error that was thrown. More...
 
static int GetLastErrorInfo (out string message)
 Gets information about the last error that was thrown. More...
 
static string GetErrorMessage (int err)
 Gets the error message associated with an error code. More...
 
static string GetLastErrorMessage ()
 Gets the error message associated with the last thrown error. More...
 

Detailed Description

Helper class with various methods to help native coding and debugging.

Member Function Documentation

static string TriDevs.TriEngine.Native.Helpers.GetErrorMessage ( int  err)
static

Gets the error message associated with an error code.

Parameters
errThe error code to get information about.
Returns
The error message.
73  {
74 #if WINDOWS
75  return GetWin32Exception(err).Message;
76 #else
77  throw new System.NotImplementedException();
78 #endif
79  }
static int TriDevs.TriEngine.Native.Helpers.GetLastError ( )
static

Gets the last error that was thrown.

Returns
The error code associated with the thrown error.
43  {
44 #if WINDOWS
45  return Marshal.GetLastWin32Error();
46 #else
47  throw new System.NotImplementedException();
48 #endif
49  }
static int TriDevs.TriEngine.Native.Helpers.GetLastErrorInfo ( out string  message)
static

Gets information about the last error that was thrown.

Parameters
messageWill be set to the error message.
Returns
The error code associated with the thrown error.
57  {
58  var err = GetLastError();
59 #if WINDOWS
60  message = GetWin32Exception(err).Message;
61 #else
62  throw new System.NotImplementedException();
63 #endif
64  return err;
65  }
static string TriDevs.TriEngine.Native.Helpers.GetLastErrorMessage ( )
static

Gets the error message associated with the last thrown error.

Returns
The error message.
86  {
87  return GetErrorMessage(GetLastError());
88  }

The documentation for this class was generated from the following file: