Chronos 0.0
A advanced 2D rendering and animation system
Loading...
Searching...
No Matches
Chronos::Manager::Manager Class Reference

The main manager of chronos. More...

#include <chronos.hpp>

Collaboration diagram for Chronos::Manager::Manager:

Public Member Functions

 Manager (Initializer initializer)
 Constructor for chronos. The initalizer struct with the necessary options to be passed.
 
GLFWwindow * getWindow ()
 Gets a reference to the GLFWWindow.
 
void drawFrame ()
 Draws the current frame to the window.
 
int addText (Chronos::Engine::TextParams params, std::string fontType, int fontSize)
 Adds text to the window.
 
int addShape (Chronos::Manager::ShapeParams shapeParams, int texture)
 Adds a textured rectangle to the window.
 
int addShape (Chronos::Manager::ShapeParams shapeParams)
 Adds a soild color rectangle to the window.
 
void updateShape (int objectNo, Chronos::Manager::ShapeParams shapeParams)
 Updates the polygon(any) with the new parameters.
 
std::vector< std::pair< int, Chronos::Manager::ShapeParams > > getShapeDetails ()
 
void updateText (int objectNo, Chronos::Engine::TextParams params)
 Updates the text with the new parameters.
 
std::vector< std::pair< int, Chronos::Engine::TextParams > > getTextDetails ()
 Returns the details of all text defined.
 
void removeObject (int objectNo)
 
int changeBackgroundColor (float r, float g, float b)
 Changes the background color of the window.
 
int addTexture (std::string texturePath, std::string textureName)
 Loads a texture from file.
 
void removeTexture (int textureNo)
 Removes the texture from the window.
 
std::vector< TextureDetailsgetTextureDetails ()
 Returns the details of all textures defined.
 
void changePresentMode (std::string presentMode)
 Changes the present mode of the swapchain.
 
std::vector< std::string > getMSAAModes ()
 
void changeMSAA (std::string mode)
 
int addRig (int x, int y)
 
void removeRig (int rigNo)
 
void rigAddBone (int rigNo, int parentNo)
 
void rigRemoveBone (int rigNo, int boneNo)
 
void rigAddChild (int rigNo, int parentNo, int childNo)
 
void rigRemoveChild (int rigNo, int parentNo, int childNo)
 
void rigSetRelX (int rigNo, int boneNo, float relX)
 
void rigSetRelY (int rigNo, int boneNo, float relY)
 
void rigSetLength (int rigNo, int boneNo, float length)
 
void rigSetAngle (int rigNo, int boneNo, float angle)
 
void rigSetParent (int rigNo, int boneNo, int parentNo)
 
float rigGetRelX (int rigNo, int boneNo)
 
float rigGetRelY (int rigNo, int boneNo)
 
float rigGetLength (int rigNo, int boneNo)
 
float rigGetAngle (int rigNo, int boneNo)
 
float rigGetX (int rigNo, int boneNo)
 
float rigGetY (int rigNo, int boneNo)
 
int rigGetParent (int rigNo, int boneNo)
 
std::vector< int > rigGetChildren (int rigNo, int boneNo)
 
int addKeyframeVariable (std::vector< std::pair< float, float > > keyframes)
 
void removeKeyframeVariable (int keyframeNo)
 
void keyframeSetTime (int keyframeNo, float time)
 
void keyframeSetKeyframe (int keyframeNo, int keyframe)
 
int keyframeGetKeyframe (int keyframeNo)
 
std::vector< std::pair< float, float > > getKeyframes (int keyframeNo)
 
float keyframeGetVariable (int keyframeNo)
 

Private Attributes

Chronos::Engine::Engine engine
 The backend Vulkan engine, used for rendering the desired shapes and text.s.
 
Chronos::Animation::AnimationManager animManager
 

Detailed Description

The main manager of chronos.

Only this class must be used for interfacing with chronos. Do not use the internal classes for this Any changes to the window can be done via this object. Please use only the functions and variables in this class. For more information, refer to the individual methods and variables and the examples

Definition at line 109 of file chronos.hpp.

Constructor & Destructor Documentation

◆ Manager()

Chronos::Manager::Manager::Manager ( Initializer  initializer)

Constructor for chronos. The initalizer struct with the necessary options to be passed.

For options, refer to the Initializer struct

Definition at line 26 of file manager.cpp.

27{
28
29 // check whether the bg color is between 0 and 1
30 if (initializer.BackgroundColor[0] < 0 || initializer.BackgroundColor[0] > 1
31 || initializer.BackgroundColor[1] < 0
32 || initializer.BackgroundColor[1] > 1
33 || initializer.BackgroundColor[2] < 0
34 || initializer.BackgroundColor[2] > 1) {
35 throw std::runtime_error("Invalid background color");
36 }
37 engine.bgColor[0] = initializer.BackgroundColor[0];
38 engine.bgColor[1] = initializer.BackgroundColor[1];
39 engine.bgColor[2] = initializer.BackgroundColor[2];
40
41 if (initializer.WindowWidth <= 0 || initializer.WindowHeight <= 0) {
42 throw std::runtime_error("Invalid window size");
43 }
44 engine.width = initializer.WindowWidth;
45 engine.height = initializer.WindowHeight;
46
47#ifdef ENABLE_EDITOR
48 engine.setEditorAddElementsCallback(initializer.editorAddElements);
49#endif
50}
float bgColor[3]
This is the background color of the window.
Definition engine.hpp:132
int height
This is the initial width of the window. It can be changed later just by changing this directly.
Definition engine.hpp:119
int width
This is the initial width of the window. It can be changed later just by changing this directly.
Definition engine.hpp:113
Chronos::Engine::Engine engine
The backend Vulkan engine, used for rendering the desired shapes and text.s.
Definition chronos.hpp:509

References Chronos::Manager::Initializer::BackgroundColor, Chronos::Manager::Initializer::WindowHeight, and Chronos::Manager::Initializer::WindowWidth.

Member Function Documentation

◆ addKeyframeVariable()

int Chronos::Manager::Manager::addKeyframeVariable ( std::vector< std::pair< float, float > >  keyframes)
inline

Definition at line 457 of file chronos.hpp.

458 {
459 return animManager.addKeyframeVariable(keyframes);
460 }
Chronos::Animation::AnimationManager animManager
Definition chronos.hpp:511

References animManager.

◆ addRig()

int Chronos::Manager::Manager::addRig ( int  x,
int  y 
)
inline

Definition at line 368 of file chronos.hpp.

368{ return animManager.addRig(x, y); }

References animManager.

◆ addShape() [1/2]

int Chronos::Manager::Manager::addShape ( Chronos::Manager::ShapeParams  shapeParams)

Adds a soild color rectangle to the window.

Use this to add a shape rectangle to the window. Please note that this function only supports solid color shapes.

Options for the shape are defined in the ShapeParams struct. The color field in the struct must be filled. For options related to the shape, please refer the struct. To add other types of shapes, such as textured use the other overrides available.

It returns a objectNo that can be used for modifying the shape in other functions in this class

Parameters
shapeParamsThe parameters(x, y, rotation... etc) for the shape
Returns
Returns the objectNo that can be used for referencing this shape later.

Definition at line 26 of file managerShapeFunctions.cpp.

28{
31 shape->params = shapeParams;
32 shape->init(&this->engine.device, this->engine.commandPool,
33 &(this->engine.swapChain), this->engine.objectManager.textureSampler,
34 &this->engine.objectManager.renderPass);
35 return engine.objectManager.addObject(shape);
36}
void init(Chronos::Engine::Device *device, VkCommandPool commandPool, Chronos::Engine::SwapChain *swapChain, VkSampler textureSampler, VkRenderPass *renderPass)
Chronos::Manager::ShapeParams params
Chronos::Engine::Device device
This is the object that manages the device.
Definition engine.hpp:233
Chronos::Engine::ObjectManager objectManager
Definition engine.hpp:99

References Chronos::Engine::ObjectManager::addObject(), Chronos::Engine::Engine::device, engine, Chronos::Engine::ColoredRectangle::init(), Chronos::Engine::Engine::objectManager, and Chronos::Engine::ColoredRectangle::params.

Here is the call graph for this function:

◆ addShape() [2/2]

int Chronos::Manager::Manager::addShape ( Chronos::Manager::ShapeParams  shapeParams,
int  texture 
)

Adds a textured rectangle to the window.

Use this to add a shape rectangle to the window. Please note that this function only supports textured shapes.

Options for the shape are defined in the ShapeParams struct. The color field in the struct is not used, It can be skipped. The texture field must be set to the textureNo of the texture to be used. A texture path must be selected. To add other types of shapes, such as colored , use the other overrides available.

It returns an objectNo that can be used for modifying the shape in other functions in this class

Parameters
shapeParamsThe parameters(x, y, rotation... etc) for the shape)
textureThe textureNo of the texture to be used
Returns
Returns the objectNo that can be used for referencing this shape later.

Definition at line 38 of file managerShapeFunctions.cpp.

40{
43 shape->params = shapeParams;
44 shape->init(&this->engine.device, this->engine.commandPool,
45 &(this->engine.swapChain), this->engine.objectManager.textureSampler,
46 this->engine.textureManager.textures[texture],
47 &this->engine.objectManager.renderPass);
48 return engine.objectManager.addObject(shape);
49}
void init(Chronos::Engine::Device *device, VkCommandPool commandPool, Chronos::Engine::SwapChain *swapChain, VkSampler textureSampler, Chronos::Engine::Texture texture, VkRenderPass *renderPass)
Chronos::Manager::ShapeParams params

References Chronos::Engine::TexturedRectangle::init(), and Chronos::Engine::TexturedRectangle::params.

Here is the call graph for this function:

◆ addText()

int Chronos::Manager::Manager::addText ( Chronos::Engine::TextParams  params,
std::string  fontType,
int  fontSize 
)

Adds text to the window.

If you want to add text to the window, this function must be used. It returns an objectNo, that is used for updating, modifyign and removing the text instance One may select the fontType and fontSize from the available options. The fontType and fontSize must be selected from the available options. Font size may be from 6 to 50. The fontType may be one of the following:

  • arial
  • arial_bold
  • consolas
  • consolas_bold
  • courier
  • courier_bold
  • times
  • times_bold

An example of how this function is called is:

addText(params, "arial", 12);
int addText(Chronos::Engine::TextParams params, std::string fontType, int fontSize)
Adds text to the window.

In the above, params refer to the text parameters that are assumed to be defined and filled. The necessary functions must be defined in the struct. For the options, please refer to the Text struct

Parameters
paramsThe necessary parameters needed for rendering text
Returns
The objectNo, for the text instance.

Definition at line 26 of file managerTextFunctions.cpp.

28{
29 if (params.text == "") {
30 throw std::runtime_error("Text cannot be empty");
31 }
33 text->params = params;
35 = Chronos::Engine::getFontType(fontType, fontSize);
36 text->init(&this->engine.device, this->engine.commandPool,
37 &(this->engine.swapChain), this->engine.objectManager.textureSampler,
38 &this->engine.objectManager.renderPass, fontStyle);
39
40 return engine.objectManager.addObject(text);
41}
Class for creating a text object for rendering text.
Definition text.hpp:86
Chronos::Engine::TextParams params
Various parameters of the text that are set by the user.
Definition text.hpp:154
void init(Chronos::Engine::Device *device, VkCommandPool commandPool, Chronos::Engine::SwapChain *swapChain, VkSampler textureSampler, VkRenderPass *renderPass, Chronos::Engine::FontTypes fontStyle)
Initializes the font object and creates the necessary objects.
Definition text.cpp:28
Chronos::Engine::FontTypes getFontType(std::string fontType, int fontSize)
The parameters needed for the font style.
Definition text.hpp:58

References Chronos::Engine::ObjectManager::addObject(), Chronos::Engine::Engine::device, engine, Chronos::Engine::getFontType(), Chronos::Engine::Text::init(), Chronos::Engine::Engine::objectManager, Chronos::Engine::Text::params, and Chronos::Engine::TextParams::text.

Here is the call graph for this function:

◆ addTexture()

int Chronos::Manager::Manager::addTexture ( std::string  texturePath,
std::string  textureName 
)

Loads a texture from file.

If a texture is needed to be loaded from a file, then this function can be used. The texture is loaded from the file and added to the texture manager. The textureNo is returned, which can be used for referencing the texture in other functions.

Note: Only png and jpg files are supported.

Parameters
texturePathThe path of the texture file
textureNameThe name of the texture. This must be unique.

Definition at line 25 of file managerTextureFunctions.cpp.

27{
28 for (auto& textureDetail : getTextureDetails()) {
29 if (textureDetail.textureName == textureName) {
30 break;
31 }
32 }
33 return engine.textureManager.addTexture(texturePath, textureName);
34}
Chronos::Engine::TextureManager textureManager
Used to create and manage textures.
Definition engine.hpp:107
int addTexture(std::string texturePath, std::string textureName)
Adds a texture to the texture manager.
std::vector< TextureDetails > getTextureDetails()
Returns the details of all textures defined.

References Chronos::Engine::TextureManager::addTexture(), engine, getTextureDetails(), and Chronos::Engine::Engine::textureManager.

Here is the call graph for this function:

◆ changeBackgroundColor()

int Chronos::Manager::Manager::changeBackgroundColor ( float  r,
float  g,
float  b 
)

Changes the background color of the window.

If changing the background color of the window is desired, then by passing the RGB values to this function, it may be accomplished.

Parameters
rRed value
gGreen value
bBlue value

Definition at line 57 of file manager.cpp.

58{
59 if (r < 0 || r > 1 || g < 0 || g > 1 || b < 0 || b > 1) {
60 throw std::runtime_error("Invalid background color");
61 }
62 engine.bgColor[0] = r;
63 engine.bgColor[1] = g;
64 engine.bgColor[2] = b;
65 return 0;
66}

◆ changeMSAA()

void Chronos::Manager::Manager::changeMSAA ( std::string  mode)
inline

Definition at line 366 of file chronos.hpp.

366{ engine.changeMSAA(mode); }
void changeMSAA(std::string)
Definition engine.cpp:495

References Chronos::Engine::Engine::changeMSAA(), and engine.

Here is the call graph for this function:

◆ changePresentMode()

void Chronos::Manager::Manager::changePresentMode ( std::string  presentMode)
inline

Changes the present mode of the swapchain.

The present mode is the mode in which the images are presented to the screen. There are various methods available. this can be used to cap or unlock the framerate, control tearing etc. Some of the presentation modes available are:

  • immediate: Images submitted by your application are transferred to the screen right away, which may result in tearing.
  • fifo : The swap chain is a queue where the display takes an image from the front of the queue when the display is refreshed and the program inserts rendered images at the back of the queue.If the queue is full then the program has to wait. This is most similar to vertical sync as found in modern games.The moment that the display is refreshed is known as "vertical blank".
  • fifo_relaxed : This mode only differs from the previous one if the application is late and the queue was empty at the last vertical blank. Instead of waiting for the next vertical blank, the image is transferred right away when it finally arrives.This may result in visible tearing.
  • mailbox : This is another variation of the second mode.Instead of blocking the application when the queue is full, the images that are already queued are simply replaced with the newer ones.This mode can be used to render frames as fast as possible while still avoiding tearing, resulting in fewer latency issues than standard vertical sync.This is commonly known as "triple buffering", although the existence of three buffers alone does not necessarily mean that the framerate
Parameters
modeThe mode to change to. It can be one of the following:
  • immediate
  • fifo
  • fifo_relaxed
  • mailbox

Definition at line 356 of file chronos.hpp.

357 {
358 engine.setPresentMode(presentMode);
359 }
void setPresentMode(std::string mode)
Changes the present mode of the swapchain.
Definition engine.cpp:452

References engine, and Chronos::Engine::Engine::setPresentMode().

Here is the call graph for this function:

◆ drawFrame()

void Chronos::Manager::Manager::drawFrame ( )

Draws the current frame to the window.

This must called every frame during the game loop.

This function updates all the attributes of the objects defined by the user and submitted to chronos. It then submits sthe necessary information to the GPU to render the frame.

Definition at line 52 of file manager.cpp.

53{
54 animManager.update();
56}
void drawFrame()
Main draw call. Its responsible for drawing frames and resizing the window. To be added to the main g...
Definition engine.cpp:137
Here is the caller graph for this function:

◆ getKeyframes()

std::vector< std::pair< float, float > > Chronos::Manager::Manager::getKeyframes ( int  keyframeNo)
inline

Definition at line 482 of file chronos.hpp.

483 {
484 return animManager.getKeyframes(keyframeNo);
485 }

References animManager.

◆ getMSAAModes()

std::vector< std::string > Chronos::Manager::Manager::getMSAAModes ( )
inline

Definition at line 361 of file chronos.hpp.

362 {
364 }
std::vector< std::string > getAvailableMSAAModes()
Definition engine.cpp:469

References engine, and Chronos::Engine::Engine::getAvailableMSAAModes().

Here is the call graph for this function:

◆ getShapeDetails()

std::vector< std::pair< int, Chronos::Manager::ShapeParams > > Chronos::Manager::Manager::getShapeDetails ( )

Definition at line 52 of file managerShapeFunctions.cpp.

53{
54 std::vector<std::pair<int, Chronos::Manager::ShapeParams>> shapeDetails;
55 for (auto const& [objectNo, object] : engine.objectManager.objects) {
56 if (object->objectType
60 shapeDetails.push_back(std::make_pair(objectNo, shape->params));
61 } else if (object->objectType
65 shapeDetails.push_back(std::make_pair(objectNo, shape->params));
66 }
67 }
68 return shapeDetails;
69}

References Chronos::Engine::ColoredRectangle::params, Chronos::Engine::TexturedRectangle::params, Chronos::Engine::TypeColoredRectangle, and Chronos::Engine::TypeTexturedRectangle.

◆ getTextDetails()

std::vector< std::pair< int, Chronos::Engine::TextParams > > Chronos::Manager::Manager::getTextDetails ( )

Returns the details of all text defined.

If the details of the text are needed, this function can be used to get the details of all text. It returns a vector of pairs, where the first element is the textNo and the second element is the textParams.

Returns
A vector of pairs, where the first element is the objectNo and the second element is the textParams of the corresponding text.

Definition at line 61 of file managerTextFunctions.cpp.

62{
63 std::vector<std::pair<int, Chronos::Engine::TextParams>> textDetails;
64 for (auto& text : engine.objectManager.objects) {
65 if (text.second->objectType != Chronos::Engine::ObjectType::TypeText) {
66 continue;
67 }
68 std::pair<int, Chronos::Engine::TextParams> textDetail;
69 textDetail.first = text.first;
70 textDetail.second = ((Chronos::Engine::Text*)text.second)->params;
71 textDetails.push_back(textDetail);
72 }
73 return textDetails;
74}

References Chronos::Engine::TypeText.

◆ getTextureDetails()

std::vector< Chronos::Manager::TextureDetails > Chronos::Manager::Manager::getTextureDetails ( )

Returns the details of all textures defined.

If the details of the textures are needed, this function can be used to get the details of all textures. It returns a vector of TextureDetails, where the textureName, texturePath and textureNo are returned.

Returns
A vector of TextureDetails, where the textureName, texturePath and textureNo are returned.

Definition at line 41 of file managerTextureFunctions.cpp.

42{
43 std::vector<Chronos::Manager::TextureDetails> textureDetails;
44 for (auto& texture : engine.textureManager.textures) {
46 details.textureNo = texture.first;
47 details.textureName = texture.second.textureName;
48 details.texturePath = texture.second.texturePath;
49 details.height = texture.second.height;
50 details.width = texture.second.width;
51#ifdef ENABLE_EDITOR
52 details.descriptorSet = texture.second.descriptorSet;
53#endif
54 textureDetails.push_back(details);
55 }
56 return textureDetails;
57}
Holds some details about the texture.
Definition chronos.hpp:90

References Chronos::Manager::TextureDetails::height, Chronos::Manager::TextureDetails::textureName, Chronos::Manager::TextureDetails::textureNo, Chronos::Manager::TextureDetails::texturePath, and Chronos::Manager::TextureDetails::width.

Here is the caller graph for this function:

◆ getWindow()

GLFWwindow * Chronos::Manager::Manager::getWindow ( )

Gets a reference to the GLFWWindow.

Since Chronos initialzes the window, along with managing it, the window is with chronos.

However for input handling and advanced window management, chronos will not do this. Instead you are expected to directly call the GLFW functions and define the options yourself.

Returns
The GLFWWindow instance created and used by Chronos

Definition at line 25 of file manager.cpp.

25{ return engine.window; }
GLFWwindow * window
This is the GLFW window reference that is used by the engine.
Definition engine.hpp:124

References engine, and Chronos::Engine::Engine::window.

Here is the caller graph for this function:

◆ keyframeGetKeyframe()

int Chronos::Manager::Manager::keyframeGetKeyframe ( int  keyframeNo)
inline

Definition at line 477 of file chronos.hpp.

478 {
479 return animManager.keyframeGetKeyframe(keyframeNo);
480 }

References animManager.

◆ keyframeGetVariable()

float Chronos::Manager::Manager::keyframeGetVariable ( int  keyframeNo)
inline

Definition at line 487 of file chronos.hpp.

488 {
489 return animManager.keyframeGetVariable(keyframeNo);
490 }

References animManager.

◆ keyframeSetKeyframe()

void Chronos::Manager::Manager::keyframeSetKeyframe ( int  keyframeNo,
int  keyframe 
)
inline

Definition at line 472 of file chronos.hpp.

473 {
474 animManager.keyframeSetKeyframe(keyframeNo, keyframe);
475 }

References animManager.

◆ keyframeSetTime()

void Chronos::Manager::Manager::keyframeSetTime ( int  keyframeNo,
float  time 
)
inline

Definition at line 467 of file chronos.hpp.

468 {
469 animManager.keyframeSetTime(keyframeNo, time);
470 }

References animManager.

◆ removeKeyframeVariable()

void Chronos::Manager::Manager::removeKeyframeVariable ( int  keyframeNo)
inline

Definition at line 462 of file chronos.hpp.

463 {
464 animManager.removeKeyframeVariable(keyframeNo);
465 }

References animManager.

◆ removeObject()

void Chronos::Manager::Manager::removeObject ( int  objectNo)

Definition at line 68 of file manager.cpp.

69{
70
71 engine.objectManager.remove(objectNo);
72}

◆ removeRig()

void Chronos::Manager::Manager::removeRig ( int  rigNo)
inline

Definition at line 370 of file chronos.hpp.

370{ animManager.removeRig(rigNo); }

References animManager.

◆ removeTexture()

void Chronos::Manager::Manager::removeTexture ( int  textureNo)

Removes the texture from the window.

By referencing the textureNo, the manager removes and destroys the texture from the screen.

Parameters
textureNoThe reference to the texture

Definition at line 35 of file managerTextureFunctions.cpp.

36{
38}
void removeTexture(int textureNo)
Removes a texture from the texture manager.

◆ rigAddBone()

void Chronos::Manager::Manager::rigAddBone ( int  rigNo,
int  parentNo 
)
inline

Definition at line 372 of file chronos.hpp.

373 {
374 animManager.rigAddBone(rigNo, parentNo);
375 }

References animManager.

◆ rigAddChild()

void Chronos::Manager::Manager::rigAddChild ( int  rigNo,
int  parentNo,
int  childNo 
)
inline

Definition at line 382 of file chronos.hpp.

383 {
384 animManager.rigAddChild(rigNo, parentNo, childNo);
385 }

References animManager.

◆ rigGetAngle()

float Chronos::Manager::Manager::rigGetAngle ( int  rigNo,
int  boneNo 
)
inline

Definition at line 432 of file chronos.hpp.

433 {
434 return animManager.rigGetAngle(rigNo, boneNo);
435 }

References animManager.

◆ rigGetChildren()

std::vector< int > Chronos::Manager::Manager::rigGetChildren ( int  rigNo,
int  boneNo 
)
inline

Definition at line 452 of file chronos.hpp.

453 {
454 return animManager.rigGetChildren(rigNo, boneNo);
455 }

References animManager.

◆ rigGetLength()

float Chronos::Manager::Manager::rigGetLength ( int  rigNo,
int  boneNo 
)
inline

Definition at line 427 of file chronos.hpp.

428 {
429 return animManager.rigGetLength(rigNo, boneNo);
430 }

References animManager.

◆ rigGetParent()

int Chronos::Manager::Manager::rigGetParent ( int  rigNo,
int  boneNo 
)
inline

Definition at line 447 of file chronos.hpp.

448 {
449 return animManager.rigGetParent(rigNo, boneNo);
450 }

References animManager.

◆ rigGetRelX()

float Chronos::Manager::Manager::rigGetRelX ( int  rigNo,
int  boneNo 
)
inline

Definition at line 417 of file chronos.hpp.

418 {
419 return animManager.rigGetRelX(rigNo, boneNo);
420 }

References animManager.

◆ rigGetRelY()

float Chronos::Manager::Manager::rigGetRelY ( int  rigNo,
int  boneNo 
)
inline

Definition at line 422 of file chronos.hpp.

423 {
424 return animManager.rigGetRelY(rigNo, boneNo);
425 }

References animManager.

◆ rigGetX()

float Chronos::Manager::Manager::rigGetX ( int  rigNo,
int  boneNo 
)
inline

Definition at line 437 of file chronos.hpp.

438 {
439 return animManager.rigGetX(rigNo, boneNo);
440 }

References animManager.

◆ rigGetY()

float Chronos::Manager::Manager::rigGetY ( int  rigNo,
int  boneNo 
)
inline

Definition at line 442 of file chronos.hpp.

443 {
444 return animManager.rigGetY(rigNo, boneNo);
445 }

References animManager.

◆ rigRemoveBone()

void Chronos::Manager::Manager::rigRemoveBone ( int  rigNo,
int  boneNo 
)
inline

Definition at line 377 of file chronos.hpp.

378 {
379 animManager.rigRemoveBone(rigNo, boneNo);
380 }

References animManager.

◆ rigRemoveChild()

void Chronos::Manager::Manager::rigRemoveChild ( int  rigNo,
int  parentNo,
int  childNo 
)
inline

Definition at line 387 of file chronos.hpp.

388 {
389 animManager.rigRemoveChild(rigNo, parentNo, childNo);
390 }

References animManager.

◆ rigSetAngle()

void Chronos::Manager::Manager::rigSetAngle ( int  rigNo,
int  boneNo,
float  angle 
)
inline

Definition at line 407 of file chronos.hpp.

408 {
409 animManager.rigSetAngle(rigNo, boneNo, angle);
410 }

References animManager.

◆ rigSetLength()

void Chronos::Manager::Manager::rigSetLength ( int  rigNo,
int  boneNo,
float  length 
)
inline

Definition at line 402 of file chronos.hpp.

403 {
404 animManager.rigSetLength(rigNo, boneNo, length);
405 }

References animManager.

◆ rigSetParent()

void Chronos::Manager::Manager::rigSetParent ( int  rigNo,
int  boneNo,
int  parentNo 
)
inline

Definition at line 412 of file chronos.hpp.

413 {
414 animManager.rigSetParent(rigNo, boneNo, parentNo);
415 }

References animManager.

◆ rigSetRelX()

void Chronos::Manager::Manager::rigSetRelX ( int  rigNo,
int  boneNo,
float  relX 
)
inline

Definition at line 392 of file chronos.hpp.

393 {
394 animManager.rigSetRelX(rigNo, boneNo, relX);
395 }

References animManager.

◆ rigSetRelY()

void Chronos::Manager::Manager::rigSetRelY ( int  rigNo,
int  boneNo,
float  relY 
)
inline

Definition at line 397 of file chronos.hpp.

398 {
399 animManager.rigSetRelY(rigNo, boneNo, relY);
400 }

References animManager.

◆ updateShape()

void Chronos::Manager::Manager::updateShape ( int  objectNo,
Chronos::Manager::ShapeParams  shapeParams 
)

Updates the polygon(any) with the new parameters.

After initializing the shape, if you want to change the parameters of the shape to new attributes, using the shapeNo and passing the shapeParams, the new parameters can be propogated to the shape. The results will be displayed on the next drawFrame() call.

Note:

If textured shape is chosen then the color field will have no effect on the shape. The texture will be always be displayed.

Parameters
objectNoThe objectNo reference to the shape. Generated during `addObject() call.
shapeParamsThe updated shape parameters to update the shape with.

Definition at line 70 of file managerShapeFunctions.cpp.

72{
73 if (engine.objectManager.objects.count(objectNo) == 0) {
74 throw std::runtime_error("Shape does not exist");
75 }
76 if (engine.objectManager.objects[objectNo]->objectType
78 && engine.objectManager.objects[objectNo]->objectType
80 throw std::runtime_error("Object is not a shape object");
81 }
82 if (engine.objectManager.objects[objectNo]->objectType
87 shape->params = shapeParams;
88 } else if (engine.objectManager.objects[objectNo]->objectType
93 shape->params = shapeParams;
94 }
95}
std::map< int, Object * > objects

References Chronos::Engine::ColoredRectangle::params, Chronos::Engine::TexturedRectangle::params, Chronos::Engine::TypeColoredRectangle, and Chronos::Engine::TypeTexturedRectangle.

◆ updateText()

void Chronos::Manager::Manager::updateText ( int  objectNo,
Chronos::Engine::TextParams  params 
)

Updates the text with the new parameters.

After initializing the text, if you want to change the parameters of the text to new attributes, using the objectNo and passing the textParams, the new parameters can be propogated to the text. The results will be displayed on the next drawFrame() call.

Parameters
textNoThe objectNo reference to the text. Generated during
()
call.
paramsThe updated text parameters to update the text with.

Definition at line 43 of file managerTextFunctions.cpp.

45{
46 if (params.text == "") {
47 throw std::runtime_error("Text cannot be empty");
48 }
49 if (engine.objectManager.objects.count(objectNo) == 0) {
50 throw std::runtime_error("Text does not exist");
51 }
52 if (engine.objectManager.objects[objectNo]->objectType
54 throw std::runtime_error("Object is not a text object");
55 }
57 = params;
58}

References Chronos::Engine::TextParams::text, and Chronos::Engine::TypeText.

Member Data Documentation

◆ animManager

Chronos::Animation::AnimationManager Chronos::Manager::Manager::animManager
private

Definition at line 511 of file chronos.hpp.

◆ engine

Chronos::Engine::Engine Chronos::Manager::Manager::engine
private

The backend Vulkan engine, used for rendering the desired shapes and text.s.

Definition at line 509 of file chronos.hpp.


The documentation for this class was generated from the following files: