UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_render.h
Go to the documentation of this file.
1
4
5/*
6Copyright (C) 2002-2025 UFO: Alien Invasion.
7
8This program is free software; you can redistribute it and/or
9modify it under the terms of the GNU General Public License
10as published by the Free Software Foundation; either version 2
11of the License, or (at your option) any later version.
12
13This program is distributed in the hope that it will be useful,
14but WITHOUT ANY WARRANTY; without even the implied warranty of
15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
17See the GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with this program; if not, write to the Free Software
21Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23*/
24
25#pragma once
26
27#include "ui_nodes.h"
28#include "../cl_renderer.h"
29
30const struct image_s* UI_LoadImage(const char* name);
31const struct image_s* UI_LoadWrappedImage(const char* name);
32
33void UI_DrawNormImage(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const struct image_s* image);
34const image_t* UI_DrawNormImageByName(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const char* name);
35
36void UI_DrawPanel(const vec2_t pos, const vec2_t size, const char* texture, int texX, int texY, const int panelDef[7]);
37void UI_DrawBorderedPanel (const vec2_t pos, const vec2_t size, const char* texture, int texX, int texY, int texW, int texH, int border);
38void UI_DrawFill(int x, int y, int w, int h, const vec4_t color);
39int UI_DrawStringInBox(const char* fontID, align_t align, int x, int y, int width, int height, const char* text, longlines_t method = LONGLINES_PRETTYCHOP);
40int UI_DrawString(const char* fontID, align_t align, int x, int y, int absX, int maxWidth, const int lineHeight, const char* c, int box_height = 0, int scroll_pos = 0, int* cur_line = nullptr, bool increaseLine = false, longlines_t method = LONGLINES_WRAP);
41void UI_Transform(const vec3_t transform, const vec3_t rotate, const vec3_t scale);
42void UI_DrawRect(int x, int y, int w, int h, const vec4_t color, float lineWidth, int pattern);
43void UI_PushClipRect(int x, int y, int width, int height);
44void UI_PopClipRect(void);
45
46void UI_EnableFlashing(const vec4_t flashingColor, float speed = 1);
47void UI_DisableFlashing(void);
longlines_t
@ LONGLINES_WRAP
@ LONGLINES_PRETTYCHOP
voidpf void uLong size
Definition ioapi.h:42
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
align_t
We need this here for checking the boundaries from script values.
Definition scripts.h:89
vec_t vec3_t[3]
Definition ufotypes.h:39
vec_t vec4_t[4]
Definition ufotypes.h:40
vec_t vec2_t[2]
Definition ufotypes.h:38
static const vec3_t scale
const struct image_s * UI_LoadWrappedImage(const char *name)
Searches for a wrapped image in the image array.
int UI_DrawString(const char *fontID, align_t align, int x, int y, int absX, int maxWidth, const int lineHeight, const char *c, int box_height=0, int scroll_pos=0, int *cur_line=nullptr, bool increaseLine=false, longlines_t method=LONGLINES_WRAP)
void UI_DrawPanel(const vec2_t pos, const vec2_t size, const char *texture, int texX, int texY, const int panelDef[7])
draw a panel from a texture as we can see on the image
void UI_DisableFlashing(void)
Disables flashing effect for UI nodes.
int UI_DrawStringInBox(const char *fontID, align_t align, int x, int y, int width, int height, const char *text, longlines_t method=LONGLINES_PRETTYCHOP)
draw a line into a bounding box
void UI_EnableFlashing(const vec4_t flashingColor, float speed=1)
Enables flashing effect for UI nodes.
const struct image_s * UI_LoadImage(const char *name)
Searches for an image in the image array.
Definition ui_render.cpp:91
void UI_DrawBorderedPanel(const vec2_t pos, const vec2_t size, const char *texture, int texX, int texY, int texW, int texH, int border)
draw a panel from a texture as we can see on the image
void UI_DrawRect(int x, int y, int w, int h, const vec4_t color, float lineWidth, int pattern)
Definition ui_render.cpp:42
const image_t * UI_DrawNormImageByName(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const char *name)
Draws an image or parts of it.
void UI_DrawNormImage(bool flip, float x, float y, float w, float h, float sh, float th, float sl, float tl, const struct image_s *image)
void UI_PushClipRect(int x, int y, int width, int height)
Definition ui_render.cpp:47
void UI_Transform(const vec3_t transform, const vec3_t rotate, const vec3_t scale)
Pushes a new matrix, normalize to current resolution and move, rotate and scale the matrix to the giv...
Definition ui_render.cpp:68
void UI_DrawFill(int x, int y, int w, int h, const vec4_t color)
Fills a box of pixels with a single color.
Definition ui_render.cpp:37
void UI_PopClipRect(void)
Definition ui_render.cpp:52