Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
api.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
5 #include <Strings/components/diagnostics/errors/errors.h>
6 
7 #ifdef BLAM_EXPORTS
8 #define BLAM_EXT_API __declspec(dllexport)
9 #else
10 #define BLAM_EXT_API __declspec(dllimport)
11 #endif
12 
13 typedef union SDL_Event;
14 struct SDL_Window;
15 class BlamTagClass;
16 
20 namespace Blam::API::v1
21 {
25  namespace Logger
26  {
34  BLAM_EXT_API void LogEvent(std::string message);
35  }
36 
40  namespace Tags
41  {
47  BLAM_EXT_API void LoadScenarioTag(std::string path);
48 
56  BLAM_EXT_API BlamTagClass* GetTagClass(std::string class_name);
57 
58  BLAM_EXT_API BlamResult LoadTagFromMemory(char* address, int size, const char* tag_path);
59 
70  BLAM_EXT_API BlamTagData* GetTagData(std::string tag_path);
71 
78  }
79 
80  namespace World
81  {
88 
98 
107 
113  BLAM_EXT_API std::vector<std::string> GetPrimitiveTypeStringList();
114  }
115 
121  namespace HS
122  {
123  void Abort(std::string confirm = "");
124  void Classify(std::string command);
125  void Cls();
126  void Crash(std::string confirm);
127  void CreateCmdObj();
128  void DebugMenuRebuild();
129  void Drop(std::string tag_name);
130  void DxRenderTargetClear(bool enable);
131  void Explore(std::string mode, std::string path);
132  void GeneratePlugins();
133  void H2Help(std::string command);
134  void H2Print(std::string message);
135  void Help();
136  void History();
137  void ListColors();
138  void ListLevels();
139  void ListenerBugCheck();
140  void MapName(std::string scenario_name);
141  void NoU();
142  void OpenGameDir();
143  void OpenWebURL(std::string url);
144  void Print(std::string message);
145  void Quit();
147  void ScreenRes(std::string resolution);
148  void Screenshot(std::string filename = "");
149  void ScriptDoc(bool quiet = false);
150  void SentryTest();
151  void ShowStats();
152  void TagFieldSizes();
153  void TagLoadForce(std::string tag_path);
154  void ToggleImguiWindow(std::string window_name);
155  void Version();
156  void Win32DialogTest();
157  }
158 
165  namespace Hooking
166  {
177 
185  BLAM_EXT_API void SetEngineHookState(bool hook_state);
186 
201 
211  BLAM_EXT_API int StartEngine(int args_count, char* args[], SDL_Window* window);
212 
216  BLAM_EXT_API void MainLoop();
217 
224 
229  }
230 
236  BLAM_EXT_API void ExecuteConsoleCommand(const char* command);
237 
244  BLAM_EXT_API void ResizeViewport(int width, int height);
245 
251  BLAM_EXT_API BlamVector3 GetDirectorPosition();
252 
259 
265  BLAM_EXT_API BlamVector2 GetMousePosition2D();
266 
274  BLAM_EXT_API BlamVector3 GetMousePosition3D();
275 
282  BLAM_EXT_API void SetEngineViewportActive(bool viewport_active);
283 
290 
296  BLAM_EXT_API BlamVector2 GetGameResolution();
297 }
Blam::API::v1::Tags::RegisterTagClass
BLAM_EXT_API void RegisterTagClass(BlamTagClass *data)
Registers a new tag class within the engine.
Definition: api.cpp:39
Blam::API::v1::HS::MapName
void MapName(std::string scenario_name)
Definition: hs.cpp:99
Blam::API::v1::GetGameResolution
BLAM_EXT_API BlamVector2 GetGameResolution()
Retrieves the current render resolution for the engine.
Definition: api.cpp:131
Blam::API::v1::HS::Classify
void Classify(std::string command)
Definition: hs.cpp:19
Blam::API::v1::Hooking::EngineThreadInit
BLAM_EXT_API int EngineThreadInit()
Performs any additional engine initialization that needs to be called within the engine loop thread.
Definition: hooking.cpp:34
window_name
const wchar_t * window_name
Main window name (replaces what used to be called 'ver_conv').
Definition: main.cpp:64
Blam::API::v1::HS::Win32DialogTest
void Win32DialogTest()
Definition: hs.cpp:179
Blam::API::v1::HS::ToggleImguiWindow
void ToggleImguiWindow(std::string window_name)
Definition: hs.cpp:169
Blam::API::v1::HS::Cls
void Cls()
Definition: hs.cpp:24
Blam::API::v1::HS::H2Print
void H2Print(std::string message)
Definition: hs.cpp:69
Blam::API::v1::GetMousePosition3D
BLAM_EXT_API BlamVector3 GetMousePosition3D()
Retrieves the 3D position of the mouse pointer.
Definition: api.cpp:111
Blam::API::v1::HS::NoU
void NoU()
Definition: hs.cpp:104
Blam::API::v1::HS::Drop
void Drop(std::string tag_name)
Definition: hs.cpp:44
Blam::API::v1::GetDirectorPosition
BLAM_EXT_API BlamVector3 GetDirectorPosition()
Retrieves the current position of the debug director.
Definition: api.cpp:74
world_objects.h
Blam::API::v1::HS::OpenGameDir
void OpenGameDir()
Definition: hs.cpp:109
Blam::API::v1::IsMouseCapturedByDirector
BLAM_EXT_API bool IsMouseCapturedByDirector()
Checks if the mouse is currently captured by the debug director.
Definition: api.cpp:121
Blam::API::v1::HS::SentryTest
void SentryTest()
Definition: hs.cpp:149
Blam::API::v1::HS::Quit
void Quit()
Definition: hs.cpp:124
Blam::API::v1::Hooking::CleanupEngineResources
BLAM_EXT_API void CleanupEngineResources()
Instructs the engine to clean up any resources.
Definition: hooking.cpp:39
Blam::API::v1::HS::GeneratePlugins
void GeneratePlugins()
Definition: hs.cpp:59
Blam::API::v1::HS::Crash
void Crash(std::string confirm)
Definition: hs.cpp:29
Blam::API::v1::HS::ListLevels
void ListLevels()
Definition: hs.cpp:89
Blam::API::v1::Hooking::MainLoop
BLAM_EXT_API void MainLoop()
Function for the engine's main loop.
Definition: hooking.cpp:29
Blam::API::v1::HS::ScreenRes
void ScreenRes(std::string resolution)
Definition: hs.cpp:134
Blam::API::v1::World::GetPrimitiveTypeStringList
BLAM_EXT_API std::vector< std::string > GetPrimitiveTypeStringList()
Creates a list of primitive types, represented as strings.
Definition: api.cpp:59
Blam::API::v1::Hooking::MainWindowProcedure
BLAM_EXT_API bool MainWindowProcedure(SDL_Event event)
Window Procedure for the main application window.
Definition: hooking.cpp:19
Blam::API::v1::Tags::GetTagData
BLAM_EXT_API BlamTagData * GetTagData(std::string tag_path)
Retrieves information for a given tag.
Definition: api.cpp:34
Blam::API::v1::HS::TagFieldSizes
void TagFieldSizes()
Definition: hs.cpp:159
Blam::API::v1::World::ConvertStringToPrimitiveType
BLAM_EXT_API Blam3DPrimitiveType ConvertStringToPrimitiveType(std::string text)
Converts a string representation of a primitive type to the equivalent Blam3DPrimitiveType value.
Definition: api.cpp:49
BlamContentSource::Tags
@ Tags
The engine will load all content from tags.
Blam::API::v1::GetDirectorSpeed
BLAM_EXT_API float GetDirectorSpeed()
Retrieves the current speed of the debug director.
Definition: api.cpp:86
Blam::API::v1::HS::ListColors
void ListColors()
Definition: hs.cpp:84
Blam::API::v1::GetMousePosition2D
BLAM_EXT_API BlamVector2 GetMousePosition2D()
Retrieves the 2D position of the mouse pointer.
Definition: api.cpp:98
Blam::API::v1::Tags::LoadScenarioTag
BLAM_EXT_API void LoadScenarioTag(std::string path)
Attempts to load a scenario tag from a given tag path.
Definition: api.cpp:19
Blam::API::v1::HS::DebugMenuRebuild
void DebugMenuRebuild()
Definition: hs.cpp:39
Blam::API::v1::HS::ScriptDoc
void ScriptDoc(bool quiet=false)
Definition: hs.cpp:144
Blam::API::v1::HS::Version
void Version()
Definition: hs.cpp:174
Blam::API::v1::HS::Explore
void Explore(std::string mode, std::string path)
Definition: hs.cpp:54
Blam::API::v1
Namespace for version 1 of the Blamite Game Engine API.
Definition: api.h:20
Blam::API::v1::World::GetWorldState
BLAM_EXT_API BlamWorldState * GetWorldState()
Retrieves the current world state.
Definition: api.cpp:44
Blam::API::v1::HS::Abort
void Abort(std::string confirm="")
Definition: hs.cpp:5
Blam::API::v1::Hooking::StartEngine
BLAM_EXT_API int StartEngine(int args_count, char *args[], SDL_Window *window)
Entry point for the engine.
Definition: hooking.cpp:24
Blam::API::v1::Tags::GetTagClass
BLAM_EXT_API BlamTagClass * GetTagClass(std::string class_name)
Retrieves a tag class from either its short or long class name.
Definition: api.cpp:24
Blam::API::v1::SetEngineViewportActive
BLAM_EXT_API void SetEngineViewportActive(bool viewport_active)
API wrapper around ImGui_ImplSDL2_SetActiveWindowOverride.
Definition: api.cpp:116
Blam::API::v1::Hooking::GetEngineHookState
BLAM_EXT_API bool GetEngineHookState()
Retrieves the engine's hook state.
Definition: hooking.cpp:14
Blam::API::v1::HS::H2Help
void H2Help(std::string command)
Definition: hs.cpp:64
Blam::API::v1::ExecuteConsoleCommand
BLAM_EXT_API void ExecuteConsoleCommand(const char *command)
Runs a command through the engine's console.
Definition: api.cpp:64
Blam::API::v1::HS::OpenWebURL
void OpenWebURL(std::string url)
Definition: hs.cpp:114
Blam::API::v1::HS::Help
void Help()
Definition: hs.cpp:74
Blam::API::v1::HS::CreateCmdObj
void CreateCmdObj()
Definition: hs.cpp:34
Blam::API::v1::Logger::LogEvent
BLAM_EXT_API void LogEvent(std::string message)
Writes a message to the game engine log.
Definition: api.cpp:14
Blam::API::v1::HS::ReloadMaterialDatablocks
void ReloadMaterialDatablocks()
Definition: hs.cpp:129
Blam::API::v1::HS::ShowStats
void ShowStats()
Definition: hs.cpp:154
BLAM_EXT_API
#define BLAM_EXT_API
Definition: api.h:10
Blam::API::v1::HS::TagLoadForce
void TagLoadForce(std::string tag_path)
Definition: hs.cpp:164
Blam::API::v1::Tags::LoadTagFromMemory
BLAM_EXT_API BlamResult LoadTagFromMemory(char *address, int size, const char *tag_path)
Definition: api.cpp:29
Blam::API::v1::ResizeViewport
BLAM_EXT_API void ResizeViewport(int width, int height)
Resizes the engine's viewport resolution.
Definition: api.cpp:69
BlamTagData
Class used to contain and access tag data.
Definition: tags.h:125
SDL_Event
Definition: SdlEmulationLayer.h:735
Blam::API::v1::HS::Print
void Print(std::string message)
Definition: hs.cpp:119
Blam::API::v1::Hooking::SetEngineHookState
BLAM_EXT_API void SetEngineHookState(bool hook_state)
Sets whether or not the engine is hooked via Qt.
Definition: hooking.cpp:9
Blam::API::v1::HS::Screenshot
void Screenshot(std::string filename="")
Definition: hs.cpp:139
Blam3DPrimitiveType
Blam3DPrimitiveType
Definition: world_objects.h:34
Blam::API::v1::HS::ListenerBugCheck
void ListenerBugCheck()
Definition: hs.cpp:94
Blam::API::v1::HS::History
void History()
Definition: hs.cpp:79
BlamWorldState
Class representing a world state.
Definition: world_objects.h:156
Blam::API::v1::World::ConvertPrimitiveTypeToString
BLAM_EXT_API std::string ConvertPrimitiveTypeToString(Blam3DPrimitiveType type)
Converts a Blam3DPrimitiveType to a string representation.
Definition: api.cpp:54
BlamTagClass
Class representing a tag class.
Definition: tags.h:188
Blam::API::v1::HS::DxRenderTargetClear
void DxRenderTargetClear(bool enable)
Definition: hs.cpp:49