Add engine_draw_text to util
This commit is contained in:
parent
56217cc7f3
commit
6e640f483e
|
@ -33,6 +33,7 @@ float vec_len2d(vec3_t v);
|
|||
void vec_clamp(vec3_t v);
|
||||
float angle_delta_rad(float a, float b);
|
||||
bool world_to_screen(vec3_t vec, vec2_t screen);
|
||||
void engine_draw_text(int x, int y, char* s, rgb_t c);
|
||||
void gl_drawbox(int x, int y, int w, int h, rgb_t c);
|
||||
void gl_drawline(int x0, int y0, int x1, int y1, float w, rgb_t col);
|
||||
bool protect_addr(void* ptr, int new_flags);
|
||||
|
|
10
src/util.c
10
src/util.c
|
@ -95,6 +95,16 @@ bool world_to_screen(vec3_t vec, vec2_t screen) {
|
|||
return false;
|
||||
}
|
||||
|
||||
void engine_draw_text(int x, int y, char* s, rgb_t c) {
|
||||
/* Convert to 0..1 range */
|
||||
float r = c.r / 255.0f;
|
||||
float g = c.g / 255.0f;
|
||||
float b = c.b / 255.0f;
|
||||
|
||||
i_engine->pfnDrawSetTextColor(r, g, b);
|
||||
i_engine->pfnDrawConsoleString(x, y, s);
|
||||
}
|
||||
|
||||
void gl_drawbox(int x, int y, int w, int h, rgb_t c) {
|
||||
/* Line width */
|
||||
const int lw = 1;
|
||||
|
|
Loading…
Reference in New Issue