-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRenderText.h
More file actions
51 lines (42 loc) · 1.75 KB
/
Copy pathRenderText.h
File metadata and controls
51 lines (42 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
* Copyright (C) 2025: Arizona Board of Regents on Behalf of the University of Arizona
*/
/**
* @file RenderText.h
* @brief Apache Strap-Down Pilotage Render header file for rendering text.
*
* @author ReliaSolve.
* @date November 20, 2025.
*/
#pragma once
#include <string>
#include <memory>
namespace asdp {
namespace render {
class RenderText {
public:
/// @brief Constructor
/// @param windowWidth The width of the window in pixels.
/// @param windowHeight The height of the window in pixels.
/// @details Note: An OpenGL context must be current when this is called.
RenderText(int windowWidth, int windowHeight);
/// @brief If the window size changes, this updates the internal parameters.
/// @param windowWidth The new width of the window in pixels.
/// @param windowHeight The new height of the window in pixels.
void SetWindowSize(int windowWidth, int windowHeight);
/// @brief Render the given text at the given position and color.
/// @param text The text to render. May include newline characters.
/// @param x The x position in normalized device coordinates (-1 to 1).
/// @param y The y position in normalized device coordinates (-1 to 1).
/// @param r The red color component (0 to 1).
/// @param g The green color component (0 to 1).
/// @param b The blue color component (0 to 1).
/// @param alpha The alpha (transparency) component (0 to 1).
std::string Draw(std::string text, float x, float y, float r, float g, float b, float alpha = 1);
private:
/// @brief Implementation class that hides details and #include files
class Impl;
std::shared_ptr<Impl> m_impl;
};
} // namespace render
} // namespace asdp