Back to main page

Engine

void Engine_SetCurrentDirectory_InSB(void);

This method is only calling the windows method "SetCurrentDirectoryW". You can use absolute paths for loading in an editor but relative paths is recomended for games.

If you are using Visual Basic 6 then you should use Engine_SetCurrentDirectoryRelativeToApplicationPath_InSB when app.path contain questionmarks as a sign of unicode characters.

The string buffer must contain the path to the folder that you want to load files from.

Uses the path given in the string buffer as the current path.

void Engine_SetCurrentDirectoryRelativeToApplicationPath_InSB(void);

This method works like Engine_SetCurrentDirectory_InSB but automatically includes the application's path in the beginning so that languages that only allow ansi text can load files from a path with non ansi characters.

Since this method get the actual application path, simulation in Visual Basic 6 will fool the engine that Visual Studio is your game. When simulating, use Engine_SetCurrentDirectory_InSB and get the application path from the language that you use.

Current path = Application's folder path & \ & Relative path from string buffer

The string buffer must contain the path to the folder that you want to load files from relative to the application's path.

Uses the application's folder path concatunated with a slash and the relative path given in the string buffer as the current path.

int Engine_Initiate(void);

Returns 1 if it worked and 0 if something was wrong.

Tries to start the engine so that you can use it.

void Engine_RemoveUnusedResources(void);

A resource in this engine is something that can be allocated automatically by the engine and must therefor reuse content when loading the same file many times. Textures and shaders are resources that are loaded automatically when loading models. Since you might be using the resources manually, you automatically lock the resources when getting the reference number and may unlock them when you don't need them anymore. Debug_PrintGeneralData_OutSB can be used to see if a resource is locked.

Removes all resources that are both unused and unlocked.

int Engine_GetTypeFromID(int ID);

This is used if you have a reference number from the engine and don't know what it is.

Only use this when you are sure that the ID is valid or 0 since a random ID might refer to something else by accident.

Returns the type enumeration of ID.

If ID is 0 for NULL or don't refer to anything, return 0

If ID refer to a Texture, return 1

If ID refer to a DrawSurface, return 2

If ID refer to a Instance, return 3

If ID refer to a Model, return 4

If ID refer to a Camera, return 5

If ID refer to a Shader, return 6

If ID refer to a LightSource, return 7

If ID refer to a CPUSurface, return 8

If ID refer to a SoundBuffer, return 9

If ID refer to a BoneFrame, return 10

If ID refer to a Constraint, return 11

If ID refer to a RigidBody, return 12

If ID refer to a CollisionShape, return 13

void Engine_SetAutomaticSwapChain(bool Automatic);

This property is true by default until you change it.

The engine will update the swap chain after each time you write to the final draw surface if Automatic is true. You need to call Engine_UpdateSwapChain manually when you are done writing to the final draw surface if Automatic is false.

int Engine_GetAutomaticSwapChain();

Returns 1 if the swapchain is automatic and 0 otherwise.

void Engine_UpdateSwapChain();

The swap chain may not be automatic since that would remove the purpose of calling this method.

The swap chain is updated so that the user can see the current content of the final draw surface.