UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ui_render.h
Go to the documentation of this file.
1 
5 /*
6 Copyright (C) 2002-2020 UFO: Alien Invasion.
7 
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16 
17 See the GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, 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 
30 const struct image_s* UI_LoadImage(const char* name);
31 const struct image_s* UI_LoadWrappedImage(const char* name);
32 
33 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);
34 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);
35 
36 void UI_DrawPanel(const vec2_t pos, const vec2_t size, const char* texture, int texX, int texY, const int panelDef[7]);
37 void UI_DrawBorderedPanel (const vec2_t pos, const vec2_t size, const char* texture, int texX, int texY, int texW, int texH, int border);
38 void UI_DrawFill(int x, int y, int w, int h, const vec4_t color);
39 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);
40 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);
41 void UI_Transform(const vec3_t transform, const vec3_t rotate, const vec3_t scale);
42 void UI_DrawRect(int x, int y, int w, int h, const vec4_t color, float lineWidth, int pattern);
43 void UI_PushClipRect(int x, int y, int width, int height);
44 void UI_PopClipRect(void);
45 
46 void UI_EnableFlashing(const vec4_t flashingColor, float speed = 1);
47 void UI_DisableFlashing(void);
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)
Definition: ui_render.cpp:371
void UI_EnableFlashing(const vec4_t flashingColor, float speed=1)
Enables flashing effect for UI nodes.
Definition: ui_render.cpp:406
void UI_DrawRect(int x, int y, int w, int h, const vec4_t color, float lineWidth, int pattern)
Definition: ui_render.cpp:42
void UI_DisableFlashing(void)
Disables flashing effect for UI nodes.
Definition: ui_render.cpp:417
static const vec3_t scale
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
Definition: ui_render.cpp:359
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)
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.
Definition: ui_render.cpp:203
int width
Definition: r_image.h:64
align_t
We need this here for checking the boundaries from script values.
Definition: scripts.h:90
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
GLsizei size
Definition: r_gl.h:152
const struct image_s * UI_LoadImage(const char *name)
Searches for an image in the image array.
Definition: ui_render.cpp:91
const struct image_s * UI_LoadWrappedImage(const char *name)
Searches for a wrapped image in the image array.
Definition: ui_render.cpp:106
void UI_PopClipRect(void)
Definition: ui_render.cpp:52
void UI_PushClipRect(int x, int y, int width, int height)
Definition: ui_render.cpp:47
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition: r_gl.h:110
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
Definition: ui_render.cpp:293
int height
Definition: r_image.h:64
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
vec_t vec3_t[3]
Definition: ufotypes.h:39
vec_t vec2_t[2]
Definition: ufotypes.h:38
longlines_t
Definition: cl_renderer.h:217
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
Definition: ui_render.cpp:230
vec_t vec4_t[4]
Definition: ufotypes.h:40