 |
Blamite Game Engine - blam!
00423.10.27.24.0533.blamite
The core library for the Blamite Game Engine.
|
Go to the documentation of this file.
6 #include <sdl2/SDL_events.h>
8 #include <OGRE/Hlms/Pbs/OgreHlmsPbsDatablock.h>
9 #include <OGRE/Hlms/Unlit/OgreHlmsUnlitDatablock.h>
10 #include <Strings/components/classes/map/map.h>
25 #define GUI_RENDER_QUEUE_GROUP_ID 200
26 #define BLAM_OGRE_RESOURCE_GROUP Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
63 Ogre::HlmsTypes
hlms_type = Ogre::HlmsTypes::HLMS_UNLIT;
71 BlamMap<std::string, ogre_material_instance_data*>
instances = BlamMap<std::string, ogre_material_instance_data*>();
251 BLAM std::vector<BlamWorldObject*>
RaycastScreen(
int screen_x,
int screen_y,
bool sort_by_distance =
true,
257 BLAM std::vector<BlamWorldObject*>
Raycast(BlamVector3 origin, BlamVector3 direction,
bool sort_by_distance =
true,
425 BLAM Ogre::TextureGpu*
LoadTexture2D(std::string
id,
void* pixel_data,
int width,
int height, Ogre::PixelFormatGpu format,
int bytes_per_line);
BLAM BlamDirector * GetCamera()
Retrieves the director instance.
Definition: director.cpp:31
BLAM BlamWorldState * GetWorldState()
Retrieves the current world state.
Definition: world.cpp:40
BLAM BlamConfigurationFile * GetEngineConfiguration()
Retrieves the main engine configuration file.
Definition: config.cpp:60
void RenderObjects()
Definition: BlamWorldState.cpp:170
BLAM Ogre::HlmsUnlitDatablock * CreateDefaultUnlitDatablockForPrimitives(std::string id)
Creates a default Unlit datablock for use with 2D and 3D primitives.
Definition: materials.cpp:997
BlamVector3 gizmo_pos_3d
Definition: ogre.cpp:80
virtual void createScene02(void)
Definition: BaseSystem.cpp:40
Ogre::Window * getRenderWindow(void) const
Definition: GraphicsSystem.h:146
bool needs_reload
Whether or not this material instance needs to be reloaded.
Definition: rendering.h:46
BLAM bool LoadUnlitDatablockFromMaterialTag(Ogre::HlmsUnlitDatablock *datablock, material *material_tag)
Loads an Unlit datablock from a material tag.
Definition: materials.cpp:234
material * tag_instance
Pointer to the tag that uses this material instance.
Definition: rendering.h:45
BLAM void LogEvent(std::string message)
Logs a message to the log and/or console.
Definition: aliases.cpp:130
BLAM Ogre::HlmsUnlitDatablock * CreateDefaultUnlitDatablock(std::string id)
Creates a default Unlit datablock.
Definition: materials.cpp:986
BLAM void RebuildDatablocks()
Rebuilds ALL datablocks (including instances) from their original tags.
Definition: materials.cpp:673
float fov
The camera's current field of view.
Definition: director.h:91
bool screenshot_pending
Definition: ogre.cpp:64
float far_clip_plane_distance
Definition: director.h:114
Definition: render_model.h:25
BLAM BlamVector3 GetMousePosition3D()
Definition: ogre.cpp:599
Ogre::HlmsTypes hlms_type
The HLMS type of this material.
Definition: rendering.h:63
BLAM BlamUIWidget_Group * GetUIRoot()
Retrieves the root UI group widget.
Definition: ui.cpp:66
std::string referencing_tag_path
The path of the tag that uses this material instance.
Definition: rendering.h:43
BLAM Ogre::Window * GetRenderWindow()
Retrieves the primary OGRE rendering window.
Definition: ogre.cpp:537
BLAM void HandleWindowReisze(int width, int height)
Instructs OGRE to handle a window resize.
Definition: ogre.cpp:497
Class used to store OGRE material information.
Definition: rendering.h:56
@ QF_EXCLUDE_GIZMOS
Definition: world_objects.h:70
std::thread::id render_thread_id
Definition: ogre.cpp:70
BLAM Ogre::HlmsPbsDatablock * CreateDefaultPbsDatablockForPrimitives(std::string id)
Creates a default PBS datablock for use with 2D and 3D primitives.
Definition: materials.cpp:1038
float near_clip_plane_distance
Definition: director.h:113
BLAM void TakeScreenshot()
Instructs OGRE to save a screenshot on the next frame.
Definition: ogre.cpp:547
Demo::GraphicsSystem * ogre_graphics_system
Definition: ogre.cpp:52
BLAM void DisplayDetailedCrashScreen(std::string expression, std::string file, int line, std::string message)
Displays a detailed crash screen.
Definition: ogre.cpp:578
bool ogre_use_render_thread
Definition: ogre.cpp:63
BLAM BlamUIWidget_CrashScreen * GetCrashScreenWidget()
Retrieves the built-in crash screen widget.
Definition: ui.cpp:279
BLAM Ogre::Camera * Get2DCamera()
Retrieves the camera used to handle 2D rendering.
Definition: ogre.cpp:557
BLAM int ShowWin32ErrorDialog(std::string message, BlamResult error, bool allow_continue, bool allow_safemode)
Shows an Error dialog with the specified error details and result handle.
Definition: errors.cpp:139
BLAM BlamVector2 GetScreenPointFrom3DPoint(BlamVector3 point)
Definition: ogre.cpp:609
BLAM void RenderThread()
Function used to handle the render thread.
Definition: ogre.cpp:422
BLAM void EndFrame()
Ends ImGUI drawing for the current frame.
Definition: imgui.cpp:188
BLAM Ogre::HlmsPbsDatablock * CreateDefaultPbsDatablock(std::string id)
Creates a default PBS datablock.
Definition: materials.cpp:1027
Ogre::Item * __debug_floor_item
Definition: ogre.cpp:74
BLAM bool LoadPBSDatablockFromMaterialTag(Ogre::HlmsPbsDatablock *datablock, material *material_tag)
Loads a PBS (Physically-Based Shading) datablock from a material tag.
Definition: materials.cpp:376
BLAM void PrepareCamera()
Prepares the director for use.
Definition: director.cpp:5
BLAM double GetDeltaTime()
Retrieves delta time that has passed since the previous frame was completed.
Definition: ogre.cpp:542
Ogre::SceneManager * getSceneManager(void) const
Definition: GraphicsSystem.h:147
BLAM void ProcessSDLEvents(SDL_Event *event)
Function used to allow OGRE to handle SDL events.
Definition: ogre.cpp:476
BLAM Ogre::TextureGpu * LoadTexture2D(std::string id, void *pixel_data, int width, int height, Ogre::PixelFormatGpu format, int bytes_per_line)
Loads a 2D texture from data in memory.
Definition: textures.cpp:140
BlamQueryFlags
Definition: world_objects.h:34
size_t debug_mode_thread_count
Definition: GraphicsSystem.h:99
BLAM std::vector< BlamWorldObject * > RaycastScreenNormalized(float screen_normalized_x, float screen_normalized_y, bool sort_by_distance=true, uint16_t max_results=0U, BlamQueryFlags query_flags=BlamQueryFlags::QF_EXCLUDE_GIZMOS)
Definition: ogre.cpp:652
bool ogre_render_thread_stopped
Definition: ogre.cpp:61
BLAM bool NeedsWorldStateUpdate()
Checks if the world state needs to be re-prepared.
Definition: scenario.cpp:13
ogre_material_instance_data * CreateNewInstance(BlamTagData *referencing_tag)
Creates a new instance of this material.
Definition: ogre_material_info_data.cpp:5
BLAM BlamVector3 GetGizmoMousePosition3D()
Definition: ogre.cpp:604
BLAM bool BuildDatablockFromTag(material *material_tag, std::string tag_path)
Creates an OGRE material datablock from a material tag.
Definition: materials.cpp:760
BLAM Ogre::TextureGpu * GetTextureFromTag(std::string tag_path)
Retrieves an OGRE texture from a tag path.
Definition: textures.cpp:93
BlamMap< std::string, ogre_material_instance_data * > instances
A map containing all instances of this material.
Definition: rendering.h:71
BLAM void BuildTextureFromTag(bitmap *bitmap_tag, std::string tag_path)
Loads a texture into OGRE from a bitmap tag.
Definition: textures.cpp:81
BLAM void Render()
Renders all UI to the screen.
Definition: ui.cpp:43
BLAM void Shutdown()
Shuts down the UI system.
Definition: ui.cpp:57
BLAM bool GetImGuiHiddenState()
Checks whether ImGUI is currently hidden or not.
Definition: ogre.cpp:594
BLAM void WriteScreenshot()
Saves a screenshot of the current frame to a file.
Definition: utils.cpp:25
@ QF_NONE
Definition: world_objects.h:68
Ogre::Camera * getCamera(void) const
Definition: GraphicsSystem.h:148
BLAM void ShutdownCamera()
Destroys the director and cleans up any data related to it.
Definition: director.cpp:26
int max_2d_z_depth
Definition: ogre.cpp:66
Definition: material.h:52
std::vector< BlamWorldObject * > raycast(Ogre::Ray ray, bool sort_by_distance=true, uint16_t max_results=0U, BlamQueryFlags query_flags=BlamQueryFlags::QF_EXCLUDE_GIZMOS)
Definition: ogre.cpp:667
virtual void destroyScene(void)
Definition: BaseSystem.cpp:48
bool needs_reload
Whether or not this material needs to be reloaded.
Definition: rendering.h:61
@ QF_ANY
Definition: world_objects.h:69
Ogre::HlmsDatablock * instance_datablock
The datablock used for this material instance.
Definition: rendering.h:44
void deinitialize(void)
Definition: GraphicsSystem.cpp:535
Data structure used to store OGRE material instance data.
Definition: rendering.h:40
BLAM Demo::GraphicsSystem * GetGraphicsSystem()
Retrieves the graphics system used by OGRE.
Definition: ogre.cpp:492
BLAM bool Initialize()
Initializes the OGRE rendering library.
Definition: ogre.cpp:88
Namespace for things relating to rendering.
Definition: rendering.h:94
Class representing the Director.
Definition: director.h:27
BLAM int GetRenderHeight()
Retrieves the current height of the OGRE viewport.
Definition: ogre.cpp:532
@ QF_ENGINE_GIZMO
Definition: world_objects.h:36
sock planetquake com All rights reserved Quake III Arena is a registered trademark of id Inc This level may be electronically distributed only at NO CHARGE to the recipient in its current MUST include this txt file
Definition: chiropteraDM.txt:95
BLAM void LoadPendingModels()
Definition: models.cpp:207
Ogre::Window * renderWindow
Definition: ogre.cpp:53
Class representing a world object.
Definition: world_objects.h:119
BLAM void ReloadPendingMaterials()
Reloads all datablocks which are flagged as requiring a reload.
Definition: materials.cpp:856
BLAM void ReloadPendingBitmaps()
Reloads all bitmaps that are currently pending a reload.
Definition: textures.cpp:112
volatile bool render_thread_paused
Definition: ogre.cpp:69
BlamDirector * camera
Definition: director.cpp:3
double timeSinceLast
Definition: ogre.cpp:56
#define WORLD_OBJECT_USER_KEY
Definition: world_objects.h:16
bool hide_imgui
Definition: ogre.cpp:67
Definition: GraphicsSystem.h:27
BLAM void PrepareNewWorldState()
Prepares a new world state.
Definition: scenario.cpp:18
BLAM Ogre::SceneManager * Get2DSceneManager()
Retrieves the scene manager used to handle 2D rendering.
Definition: ogre.cpp:552
volatile bool raycast_pending
Definition: ogre.cpp:71
void update(float timeSinceLast)
Definition: GraphicsSystem.cpp:569
BLAM Ogre::MeshPtr GetModelFromTagPath(std::string tag_path)
Definition: models.cpp:221
BLAM Ogre::Light * CreateLightFromTag(light *light)
Definition: lights.cpp:9
bool getQuit(void) const
Definition: GraphicsSystem.h:141
volatile bool pause_render_thread
Definition: ogre.cpp:68
BLAM ogre_material_instance_data * CreateDatablockInstance(std::string tag_path, std::string referencing_tag_path)
Creates a new datablock instance from a material tag path, and a referencing tag path.
Definition: materials.cpp:948
BLAM void DisplayBasicCrashScreen(std::string additional_info="")
Displays a basic crash screen, with an optional message.
Definition: ogre.cpp:562
Ogre::Timer timer
Definition: ogre.cpp:55
virtual void createScene01(void)
Definition: BaseSystem.cpp:32
Ogre::uint64 startTime
Definition: ogre.cpp:57
BLAM std::vector< BlamWorldObject * > Raycast(BlamVector3 origin, BlamVector3 direction, bool sort_by_distance=true, uint16_t max_results=0U, BlamQueryFlags query_flags=BlamQueryFlags::QF_EXCLUDE_GIZMOS)
Definition: ogre.cpp:660
bool ogre_stop_render_thread
Definition: ogre.cpp:62
#define BLAM
Definition: rendering.h:22
BLAM std::vector< BlamWorldObject * > RaycastScreen(int screen_x, int screen_y, bool sort_by_distance=true, uint16_t max_results=0U, BlamQueryFlags query_flags=BlamQueryFlags::QF_EXCLUDE_GIZMOS)
Definition: ogre.cpp:622
bool post_init_needs_datablock_update
Definition: ogre.cpp:65
void initialize(const Ogre::String &windowTitle)
Definition: GraphicsSystem.cpp:120
BLAM bool Initialize()
Initializes the UI system.
Definition: ui.cpp:17
Class used to contain and access tag data.
Definition: tags.h:124
bool persistent_reload
Whether or not to continuously update this material (ie, live editing).
Definition: rendering.h:62
std::string tag_path
The tag path that this material was loaded from.
Definition: rendering.h:59
Ogre::Camera * camera2
Definition: ogre.cpp:77
BLAM Ogre::HlmsDatablock * GetDatablockFromTag(std::string tag_path)
Retrieves an OGRE datablock from a material tag path.
Definition: materials.cpp:915
Definition: SdlEmulationLayer.h:735
ogre_material_info_data * original_material
Pointer to the original material information.
Definition: rendering.h:42
BLAM ogre_material_instance_data * GetDatablockInstanceFromTag(std::string tag_path, std::string referencing_tag_path)
Retrieves a datablock instance from a material tag path, and a referencing tag path.
Definition: materials.cpp:927
bool persistent_reload
Whether or not to continuously update this material (ie, live editing).
Definition: rendering.h:47
volatile bool raycast_ready
Definition: ogre.cpp:72
BLAM void LoadModel(render_model *model, std::string tag_path)
Definition: models.cpp:184
Ogre::Root * getRoot(void) const
Definition: GraphicsSystem.h:145
BlamVector3 camera_front
The calculated point representing the front of the camera.
Definition: director.h:84
unsigned short uint16_t
Definition: stdint.h:16
BLAM void PauseRenderThread()
Pauses the render thread.
Definition: ogre.cpp:435
BlamVector3 camera_pos
The current position of the camera.
Definition: director.h:80
BLAM void ResumeRenderThread()
Resumes the render thread.
Definition: ogre.cpp:445
Ogre::HlmsDatablock * datablock
The datablock used for this material.
Definition: rendering.h:60
void beginFrameParallel(void)
Definition: BaseSystem.cpp:56
BlamVector3 mouse_pos_3d
Definition: ogre.cpp:79
Ogre::SceneManager * scene_manager_2d
Definition: ogre.cpp:78
BLAM void Shutdown()
Shuts down OGRE and cleans up any memory used by it.
Definition: ogre.cpp:451
void finishFrameParallel(void)
Definition: BaseSystem.cpp:72
BLAM void RenderLoop()
Function to handle the render loop.
Definition: ogre.cpp:273
BLAM void UnloadModels()
Definition: models.cpp:244
Definition: rendering.h:86
bool ogre_initialized
Definition: ogre.cpp:59
BLAM int * GetGlobalAsInteger(std::string name)
Retrieves a global's value as an int.
Definition: globals.cpp:391
BLAM int GetRenderWidth()
Retrieves the current width of the OGRE viewport.
Definition: ogre.cpp:527