Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
blam_api.h
Go to the documentation of this file.
1 // Blamite Game Engine - API Header //
3 // Copyright (c) Elaztek Studios 2013-2020 //
5 
6 #pragma once
7 
8 #include <Windows.h>
9 #include <string>
10 #include <sdl2/SDL.h>
11 
13 #include <Strings/components/diagnostics/errors/errors.h>
14 
15 #ifdef BLAM_EXPORTS
16 #define BLAM_EXT_API __declspec(dllexport)
17 #else
18 #define BLAM_EXT_API __declspec(dllimport)
19 #endif
20 
21 #ifndef BLAM
22 #define BLAM
23 #endif
24 
25 class BlamVector2;
26 class BlamVector3;
27 
28 namespace Blam
29 {
39  BLAM bool GetEngineHookState();
40 
47  namespace InteropAPI
48  {
63 
73  BLAM_EXT_API int StartEngine(int args_count, char *args[], SDL_Window* window);
74 
78  BLAM_EXT_API void MainLoop();
79 
86 
91  }
92 
99  namespace API
100  {
108  BLAM_EXT_API void SetEngineHookState(bool hook_state);
109 
115  BLAM_EXT_API void ExecuteConsoleCommand(const char* command);
116 
123  BLAM_EXT_API void ResizeViewport(int width, int height);
124 
130  BLAM_EXT_API BlamVector3 GetDirectorPosition();
131 
138 
144  BLAM_EXT_API BlamVector2 GetMousePosition2D();
145 
153  BLAM_EXT_API BlamVector3 GetMousePosition3D();
154 
161  BLAM_EXT_API void SetEngineViewportActive(bool viewport_active);
162 
169 
175  BLAM_EXT_API BlamVector2 GetGameResolution();
176 
183 
184  BLAM_EXT_API BlamResult LoadTagFromMemory(char* address, int size, const char* tag_path);
185  }
186 }
Blam
Namespace surrounding all major engine components.
Definition: blam_api.h:28
Blam::Director::GetCamera
BLAM BlamDirector * GetCamera()
Retrieves the director instance.
Definition: director.cpp:31
Blam::World::GetWorldState
BLAM_EXT_API BlamWorldState * GetWorldState()
Retrieves the current world state.
Definition: world.cpp:44
tag_io.h
BLAM
#define BLAM
Definition: blam_api.h:22
BlamDirector::mouse_captured
bool mouse_captured
Whether or not the mouse is currently being captured by the camera.
Definition: director.h:84
width
int width
Definition: bgfx.cpp:19
imgui_impl_sdl.h
Blam::API::GetDirectorSpeed
BLAM_EXT_API float GetDirectorSpeed()
Retrieves the current speed of the debug director.
Definition: blam_api.cpp:44
Blam::API::SetEngineViewportActive
BLAM_EXT_API void SetEngineViewportActive(bool viewport_active)
API wrapper around ImGui_ImplSDL2_SetActiveWindowOverride.
Definition: blam_api.cpp:74
engine_hooked_in_qt
bool engine_hooked_in_qt
Definition: blam_api.cpp:10
ImGuiIO::MousePos
ImVec2 MousePos
Definition: imgui.h:1409
imgui.h
Blam::API::LoadTagFromMemory
BLAM_EXT_API BlamResult LoadTagFromMemory(char *address, int size, const char *tag_path)
Definition: blam_api.cpp:105
Blam::API::ExecuteConsoleCommand
BLAM_EXT_API void ExecuteConsoleCommand(const char *command)
Runs a command through the engine's console.
Definition: blam_api.cpp:22
world.h
BlamRendering::SetDisplayRes
BLAM HRESULT SetDisplayRes(int x, int y)
Changes the game's display resolution.
Definition: rendering_abstraction.cpp:8
Blam::API::ResizeViewport
BLAM_EXT_API void ResizeViewport(int width, int height)
Resizes the engine's viewport resolution.
Definition: blam_api.cpp:27
ImGuiIO
Definition: imgui.h:1338
director.h
Blam::InteropAPI::CleanupEngineResources
BLAM_EXT_API void CleanupEngineResources()
Instructs the engine to clean up any resources.
Definition: main.cpp:666
console.h
rendering.h
Blam::InteropAPI::EngineThreadInit
BLAM_EXT_API int EngineThreadInit()
Performs any additional engine initialization that needs to be called within the engine loop thread.
Definition: main.cpp:617
ImVec2::x
float x
Definition: imgui.h:181
Blam::API::GetMousePosition3D
BLAM_EXT_API BlamVector3 GetMousePosition3D()
Retrieves the 3D position of the mouse pointer.
Definition: blam_api.cpp:69
BlamRendering::BGFX::GetRenderHeight
BLAM int GetRenderHeight()
Definition: bgfx.cpp:190
Blam::GetEngineHookState
BLAM bool GetEngineHookState()
Retrieves the engine's hook state.
Definition: blam_api.cpp:17
Blam::API::GetDirectorPosition
BLAM_EXT_API BlamVector3 GetDirectorPosition()
Retrieves the current position of the debug director.
Definition: blam_api.cpp:32
Blam::API::SetEngineHookState
BLAM_EXT_API void SetEngineHookState(bool hook_state)
Sets whether or not the engine is hooked via Qt.
Definition: blam_api.cpp:12
Blam::InteropAPI::MainWindowProcedure
BLAM_EXT_API bool MainWindowProcedure(SDL_Event event)
Window Procedure for the main application window.
Definition: main.cpp:97
Blam::API::GetGameResolution
BLAM_EXT_API BlamVector2 GetGameResolution()
Retrieves the current render resolution for the engine.
Definition: blam_api.cpp:89
Blam::API::GetWorldState
BLAM_EXT_API BlamWorldState * GetWorldState()
Retrieves the current world state.
Definition: blam_api.cpp:100
Blam::Resources::Console::RunCommandLine
BLAM HRESULT RunCommandLine(std::string command_line)
Executed the provided string as a console command.
Definition: console.cpp:271
ImGui::GetIO
IMGUI_API ImGuiIO & GetIO()
Definition: imgui.cpp:3300
ImGui_ImplSDL2_SetActiveWindowOverride
void ImGui_ImplSDL2_SetActiveWindowOverride(bool override_state)
Special function used to override active window checks.
Definition: imgui_impl_sdl.cpp:375
BLAM_EXT_API
#define BLAM_EXT_API
Definition: blam_api.h:18
Blam::Content::Tags::LoadTagFromMemoryBlock
BLAM BlamResult LoadTagFromMemoryBlock(char *address, int size, std::string tag_path, bool reload_if_already_loaded=true)
Definition: tag_io.cpp:536
BlamDirector::speed
float speed
The camera's current speed.
Definition: director.h:88
Blam::API::GetMousePosition2D
BLAM_EXT_API BlamVector2 GetMousePosition2D()
Retrieves the 2D position of the mouse pointer.
Definition: blam_api.cpp:56
Blam::API::IsMouseCapturedByDirector
BLAM_EXT_API bool IsMouseCapturedByDirector()
Checks if the mouse is currently captured by the debug director.
Definition: blam_api.cpp:79
BlamRendering::BGFX::GetRenderWidth
BLAM int GetRenderWidth()
Definition: bgfx.cpp:185
height
int height
Definition: bgfx.cpp:20
blam_api.h
ImVec2::y
float y
Definition: imgui.h:181
Blam::InteropAPI::MainLoop
BLAM_EXT_API void MainLoop()
Function for the engine's main loop.
Definition: main.cpp:638
Blam::InteropAPI::StartEngine
BLAM_EXT_API int StartEngine(int args_count, char *args[], SDL_Window *window)
Entry point for the engine.
Definition: main.cpp:355
SDL_Event
Definition: SdlEmulationLayer.h:735
BlamDirector::camera_pos
BlamVector3 camera_pos
The current position of the camera.
Definition: director.h:77
BlamWorldState
Class representing a world state.
Definition: world_objects.h:149