**SFW Docs** what it is, notes Compile ------------------------------------------------------------------ License ------------------------------------------------------------------ CORE ==================================================================================== Use SFWCore::setup(); to initialize the library. This is necessary as some components (Like PoolVector, and StringNames.) need additional setup. Use SFWCore::cleanup(); to de-initialize the library. Note that if you use the Application class, it's constructor will do this for you automatically. Also note that if you don't use classes that doens't rely on this you can get away by not calling it. Initialization ------------------------------------------------------------------
SFWCore |||CLASS_SFWCore|||
Enums ------------------------------------------------------------------ Errors
Error |||ENUM_Error|||
Keys
KeyList |||ENUM_KeyList|||
KeyModifierMask |||ENUM_KeyModifierMask|||
ButtonList |||ENUM_ButtonList|||
Other
ClockDirection |||ENUM_ClockDirection|||
Orientation |||ENUM_Orientation|||
HAlign |||ENUM_HAlign|||
VAlign |||ENUM_VAlign|||
Margin |||ENUM_Margin|||
Side |||ENUM_Side|||
Corner |||ENUM_Corner|||
Errors and Logging ------------------------------------------------------------------
Logging Use the provided macros: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C #define PRINT_TRACE(str) #define LOG_TRACE(...) #define PRINT_MSG(str) #define LOG_MSG(...) #define PRINT_WARN(str) #define LOG_WARN(...) #define PRINT_ERR(str) #define ERR_PRINT(str) #define LOG_ERR(...) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error Uses these macros: Note that the library itself does not use exceptions, it uses these macros exclusively. Also note that you are not prevented you from using exceptions if you want to in your own code. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C #define ERR_FAIL_MSG(msg) #define ERR_FAIL_V(val) #define ERR_FAIL_V_MSG(val, msg) #define ERR_FAIL_INDEX(index, size) #define ERR_FAIL_INDEX_MSG(index, size, msg) #define ERR_FAIL_INDEX_V(index, size, val) #define ERR_FAIL_INDEX_V_MSG(index, size, val, msg) #define ERR_FAIL_COND(cond) #define ERR_FAIL_COND_MSG(cond, msg) #define ERR_FAIL_COND_V(cond, val) #define ERR_FAIL_COND_V_MSG(cond, val, msg) #define ERR_CONTINUE(cond) #define ERR_CONTINUE_MSG(cond, msg) #define ERR_CONTINUE_ACTION(cond, action) #define ERR_CONTINUE_ACTION_MSG(cond, action, msg) #define CRASH_INDEX(index, size) #define CRASH_BAD_INDEX(index, size) #define CRASH_BAD_UNSIGNED_INDEX(index, size) #define CRASH_COND(cond) #define CRASH_COND_MSG(cond, msg) #define CRASH_MSG(msg) #define CRASH_NOW(msg) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Asserts Use the provided macros: These should be 'free' checks for program flow and should not be needed in any releases, only used when the DEV_ENABLED define is set. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C #define DEV_CHECK(m_cond) #define DEV_CHECK_ONCE(m_cond) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Math ------------------------------------------------------------------
Math |||CLASS_Math|||
Vector2 |||STRUCT_Vector2|||
Vector2i |||STRUCT_Vector2i|||
Vector3 |||STRUCT_Vector3|||
Vector3i |||STRUCT_Vector3i|||
Vector4 |||STRUCT_Vector4|||
Vector4i |||STRUCT_Vector4i|||
Color |||STRUCT_Color|||
Rect2 |||STRUCT_Rect2|||
Rect2i |||STRUCT_Rect2i|||
Plane |||STRUCT_Plane|||
AABB |||STRUCT_AABB|||
Face3 |||STRUCT_Face3|||
Transform2D |||STRUCT_Transform2D|||
Quaternion |||STRUCT_Quaternion|||
Basis |||STRUCT_Basis|||
Transform |||STRUCT_Transform|||
Projection |||STRUCT_Projection|||
RandomPCG |||CLASS_RandomPCG|||
String ------------------------------------------------------------------ Helper Structs
CharRange |||STRUCT_CharRange|||
StrRange |||STRUCT_StrRange|||
NoCaseComparator |||STRUCT_NoCaseComparator|||
NaturalNoCaseComparator |||STRUCT_NaturalNoCaseComparator|||
Character Strings
StaticCString You can statically store a C string with this. |||STRUCT_StaticCString|||
Char16String 16 bit (wide char) char string. |||CLASS_Char16String|||
CharString 8 bit char string. |||CLASS_CharString|||
CharProxy Properly stores a reference to an element in a String. |||CLASS_CharProxy|||
Main
String Main String class. This is what you normally use. Stores characters as 32 bit variables. It's COW (Copy on Write). If you want to convert this to a char* use it's utf8() method. |||CLASS_String|||
StringName A String that is optimized for comparisons using ==. |||CLASS_StringName|||
Containers ------------------------------------------------------------------ Helper Structs
Pair |||STRUCT_Pair|||
KeyValue |||STRUCT_KeyValue|||
Comparator |||STRUCT_Comparator|||
Helper Classes
CowData A helper class that implements COW (Copy-on-Write) functionality. |||CLASS_CowData|||
VectorWriteProxy |||CLASS_VectorWriteProxy|||
Lists
List |||CLASS_List|||
Vectors
Vector Vector with COW support. |||CLASS_Vector|||
PoolVector Vector that does not fragment memory. |||CLASS_PoolVector|||
LocalVector Simple vector. Uses unsigned ints as indexes. Saves on allocation calls by overallocating memory. This is the most similar to std::vector. |||CLASS_LocalVector|||
LocalVectori Simple vector. Uses signed ints as indexes. Saves on allocation calls by overallocating memory. |||CLASS_LocalVectori|||
TightLocalVector Simple vector. Uses unsigned ints as indexes. Unlike LocalVector it always only allocates the space it needs. |||CLASS_TightLocalVector|||
TightLocalVectori Simple vector. Uses signed ints as indexes. Unlike LocalVector it always only allocates the space it needs. |||CLASS_TightLocalVectori|||
Sets
RBSet |||CLASS_RBSet|||
VSet |||CLASS_VSet|||
HashSet |||CLASS_HashSet|||
Maps
RBMap |||CLASS_RBMap|||
VMap |||CLASS_VMap|||
HashMaps
OGHashMap Simple HashMap implementation. |||CLASS_OGHashMap|||
HashMap HashMap implementation that uses open addressing with Robin Hood hashing. Use this by default. |||CLASS_HashMap|||
OrderedHashMap HashMap implementation that keeps the order of it's elements. |||CLASS_OrderedHashMap|||
Special
SortArray |||CLASS_SortArray|||
RingBuffer |||CLASS_RingBuffer|||
Files ------------------------------------------------------------------
FileAccess |||CLASS_FileAccess|||
DirAccess |||CLASS_DirAccess|||
Time ------------------------------------------------------------------
STime |||CLASS_STime|||
Threading ------------------------------------------------------------------ Thread
Thread |||CLASS_Thread|||
Atomics
SafeNumeric |||CLASS_SafeNumeric|||
SafeFlag |||CLASS_SafeFlag|||
SafeRefCount |||CLASS_SafeRefCount|||
Mutex
Mutex Typedefined to Mutex. |||CLASS_MutexImpl|||
MutexLock Helper class to lock and automatically release it on leaving scope. |||CLASS_MutexLock|||
RWLock
RWLock |||CLASS_RWLock|||
RWLockRead |||CLASS_RWLockRead|||
RWLockWrite |||CLASS_RWLockWrite|||
SpinLock
SpinLock |||CLASS_SpinLock|||
Networking ------------------------------------------------------------------ Socket
InetAddress |||CLASS_InetAddress|||
Socket |||CLASS_Socket|||
Processes ------------------------------------------------------------------
SubProcess |||CLASS_SubProcess|||
OBJECT ==================================================================================== Object
Object |||CLASS_Object|||
ObjectDB |||CLASS_ObjectDB|||
Reference
Reference |||CLASS_Reference|||
Ref |||CLASS_Ref|||
Resource
Resource |||CLASS_Resource|||
Variant
Variant |||CLASS_Variant|||
Variant Containers
Array |||CLASS_Array|||
Dictionary |||CLASS_Dictionary|||
Utilities
Signal |||CLASS_Signal|||
CoreStringNames |||CLASS_CoreStringNames|||
RENDER CORE ==================================================================================== Application ------------------------------------------------------------------
Application |||CLASS_Application|||
Scene |||CLASS_Scene|||
AppWindow |||CLASS_AppWindow|||
Input ------------------------------------------------------------------ Singletons
Input |||CLASS_Input|||
InputMap |||CLASS_InputMap|||
Events
InputEvent |||CLASS_InputEvent|||
InputEventWithModifiers |||CLASS_InputEventWithModifiers|||
InputEventKey |||CLASS_InputEventKey|||
InputEventMouse |||CLASS_InputEventMouse|||
InputEventMouseButton |||CLASS_InputEventMouseButton|||
InputEventMouseMotion |||CLASS_InputEventMouseMotion|||
InputEventAction |||CLASS_InputEventAction|||
InputEventShortCut |||CLASS_InputEventShortCut|||
Utility
ShortCut |||CLASS_ShortCut|||
Rendering ------------------------------------------------------------------ Images
Image |||CLASS_Image|||
Texture |||CLASS_Texture|||
Meshes
Mesh |||CLASS_Mesh|||
MeshUtils |||CLASS_MeshUtils|||
Shaders
Shader |||CLASS_Shader|||
ShaderCache |||CLASS_ShaderCache|||
Fonts
Font |||CLASS_Font|||
Materials
Material |||CLASS_Material|||
Text Materials
FontMaterial |||CLASS_FontMaterial|||
2D Materials
ColorMaterial2D |||CLASS_ColorMaterial2D|||
TextureMaterial2D |||CLASS_TextureMaterial2D|||
3D Materials
ColorMaterial |||CLASS_ColorMaterial|||
TextureMaterial |||CLASS_TextureMaterial|||
ColoredMaterial |||CLASS_ColoredMaterial|||
TransparentTextureMaterial |||CLASS_TransparentTextureMaterial|||
State
RenderState |||CLASS_RenderState|||
Coordinate System 3D TODO doube check z ****************************************************************** * * +x * *--->--------. .------------. * | | | | * v +y | | | * | | +y ^ ^ +z | * | | |/ | * '------------' *--->--------' * / +x * -z * 2D 3D ****************************************************************** RENDER IMMEDIATE ====================================================================================
Renderer |||CLASS_Renderer|||
RENDER OBJECTS ==================================================================================== Text ------------------------------------------------------------------ Base
Text2D |||CLASS_Text2D|||
2D ------------------------------------------------------------------ Base
Object2D |||CLASS_Object2D|||
Camera
Camera2D |||CLASS_Camera2D|||
Objects
Sprite |||CLASS_Sprite|||
TileMap |||CLASS_TileMap|||
MeshInstance2D |||CLASS_MeshInstance2D|||
3D ------------------------------------------------------------------ Base
Object3D |||CLASS_Object3D|||
Camera
Camera3D |||CLASS_Camera3D|||
OrthographicCamera |||CLASS_OrthographicCamera|||
PerspectiveCamera |||CLASS_PerspectiveCamera|||
FrustumCamera |||CLASS_FrustumCamera|||
Objects
MeshInstance3D |||CLASS_MeshInstance3D|||
ADVANCED ==================================================================================== There are a few remaining classes that were omitted from this document (Like allocators, hashers etc.), as you will normally won't need them. (If you do, you will likely just need to rread the source anyway.) WHERE TO GO NEXT ==================================================================================== TODO link a bunch of cool projects.