2012-02-14 08:28:09 +00:00
|
|
|
/*
|
|
|
|
QF/plugin/vid_render.h
|
|
|
|
|
|
|
|
Video Renderer plugin data types
|
|
|
|
|
|
|
|
Copyright (C) 2001 Jeff Teunissen <deek@quakeforge.net>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
|
|
|
|
|
|
|
*/
|
2021-06-22 10:47:20 +00:00
|
|
|
#ifndef __QF_plugin_vid_render_h
|
|
|
|
#define __QF_plugin_vid_render_h
|
2012-02-14 08:28:09 +00:00
|
|
|
|
|
|
|
#include <QF/draw.h>
|
|
|
|
#include <QF/plugin.h>
|
|
|
|
#include <QF/qtypes.h>
|
|
|
|
#include <QF/render.h>
|
|
|
|
#include <QF/screen.h>
|
|
|
|
|
|
|
|
struct plitem_s;
|
|
|
|
struct cvar_s;
|
2012-02-14 12:25:19 +00:00
|
|
|
struct skin_s;
|
2012-02-14 08:28:09 +00:00
|
|
|
|
2021-02-01 12:11:45 +00:00
|
|
|
struct mod_alias_ctx_s;
|
2021-12-13 23:36:19 +00:00
|
|
|
struct mod_sprite_ctx_s;
|
2021-02-01 12:11:45 +00:00
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
/*
|
|
|
|
All video plugins must export these functions
|
|
|
|
*/
|
|
|
|
|
2012-02-14 12:25:19 +00:00
|
|
|
typedef struct vid_model_funcs_s {
|
2021-01-19 04:05:39 +00:00
|
|
|
size_t texture_render_size;// size of renderer specific texture data
|
2021-02-01 05:39:00 +00:00
|
|
|
void (*Mod_LoadLighting) (model_t *mod, bsp_t *bsp);
|
|
|
|
void (*Mod_SubdivideSurface) (model_t *mod, msurface_t *fa);
|
|
|
|
void (*Mod_ProcessTexture) (model_t *mod, texture_t *tx);
|
2012-04-27 05:40:06 +00:00
|
|
|
void (*Mod_LoadIQM) (model_t *mod, void *buffer);
|
2012-02-14 12:25:19 +00:00
|
|
|
void (*Mod_LoadAliasModel) (model_t *mod, void *buffer,
|
|
|
|
cache_allocator_t allocator);
|
|
|
|
void (*Mod_LoadSpriteModel) (model_t *mod, void *buffer);
|
2021-02-01 12:11:45 +00:00
|
|
|
void (*Mod_MakeAliasModelDisplayLists) (struct mod_alias_ctx_s *alias_ctx,
|
2012-02-23 03:55:50 +00:00
|
|
|
void *_m, int _s, int extra);
|
2021-02-01 12:11:45 +00:00
|
|
|
void *(*Mod_LoadSkin) (struct mod_alias_ctx_s *alias_ctx, byte *skin,
|
|
|
|
int skinsize, int snum, int gnum,
|
2012-02-23 03:55:50 +00:00
|
|
|
qboolean group, maliasskindesc_t *skindesc);
|
2021-02-01 12:11:45 +00:00
|
|
|
void (*Mod_FinalizeAliasModel) (struct mod_alias_ctx_s *alias_ctx);
|
|
|
|
void (*Mod_LoadExternalSkins) (struct mod_alias_ctx_s *alias_ctx);
|
2012-05-14 14:02:06 +00:00
|
|
|
void (*Mod_IQMFinish) (model_t *mod);
|
2012-02-23 03:55:50 +00:00
|
|
|
int alias_cache;
|
2021-12-13 23:36:19 +00:00
|
|
|
void (*Mod_SpriteLoadFrames) (struct mod_sprite_ctx_s *sprite_ctx);
|
2012-02-14 12:25:19 +00:00
|
|
|
|
|
|
|
struct skin_s *(*Skin_SetColormap) (struct skin_s *skin, int cmap);
|
|
|
|
struct skin_s *(*Skin_SetSkin) (struct skin_s *skin, int cmap,
|
|
|
|
const char *skinname);
|
|
|
|
void (*Skin_SetupSkin) (struct skin_s *skin, int cmap);
|
|
|
|
void (*Skin_SetTranslation) (int cmap, int top, int bottom);
|
|
|
|
void (*Skin_ProcessTranslation) (int cmap, const byte *translation);
|
|
|
|
void (*Skin_InitTranslations) (void);
|
|
|
|
} vid_model_funcs_t;
|
|
|
|
|
2012-02-14 08:28:09 +00:00
|
|
|
typedef struct vid_render_funcs_s {
|
2021-06-26 06:43:17 +00:00
|
|
|
void (*init) (void);
|
2012-02-14 08:28:09 +00:00
|
|
|
void (*Draw_Character) (int x, int y, unsigned ch);
|
|
|
|
void (*Draw_String) (int x, int y, const char *str);
|
|
|
|
void (*Draw_nString) (int x, int y, const char *str, int count);
|
|
|
|
void (*Draw_AltString) (int x, int y, const char *str);
|
|
|
|
void (*Draw_ConsoleBackground) (int lines, byte alpha);
|
|
|
|
void (*Draw_Crosshair) (void);
|
|
|
|
void (*Draw_CrosshairAt) (int ch, int x, int y);
|
|
|
|
void (*Draw_TileClear) (int x, int y, int w, int h);
|
|
|
|
void (*Draw_Fill) (int x, int y, int w, int h, int c);
|
|
|
|
void (*Draw_TextBox) (int x, int y, int width, int lines, byte alpha);
|
|
|
|
void (*Draw_FadeScreen) (void);
|
|
|
|
void (*Draw_BlendScreen) (quat_t color);
|
|
|
|
qpic_t *(*Draw_CachePic) (const char *path, qboolean alpha);
|
|
|
|
void (*Draw_UncachePic) (const char *path);
|
|
|
|
qpic_t *(*Draw_MakePic) (int width, int height, const byte *data);
|
|
|
|
void (*Draw_DestroyPic) (qpic_t *pic);
|
|
|
|
qpic_t *(*Draw_PicFromWad) (const char *name);
|
|
|
|
void (*Draw_Pic) (int x, int y, qpic_t *pic);
|
|
|
|
void (*Draw_Picf) (float x, float y, qpic_t *pic);
|
|
|
|
void (*Draw_SubPic) (int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height);
|
|
|
|
|
|
|
|
struct tex_s *(*SCR_CaptureBGR) (void);
|
|
|
|
|
2021-12-19 05:47:25 +00:00
|
|
|
struct psystem_s *(*ParticleSystem) (void);
|
2012-04-10 04:27:53 +00:00
|
|
|
void (*R_Init) (void);
|
2012-02-14 08:28:09 +00:00
|
|
|
void (*R_ClearState) (void);
|
|
|
|
void (*R_LoadSkys) (const char *);
|
|
|
|
void (*R_NewMap) (model_t *worldmodel, model_t **models, int num_models);
|
2021-07-11 01:59:27 +00:00
|
|
|
void (*R_LineGraph) (int x, int y, int *h_vals, int count, int height);
|
2021-04-01 10:17:19 +00:00
|
|
|
void (*R_ViewChanged) (void);
|
2012-04-11 13:45:23 +00:00
|
|
|
|
2022-03-07 14:32:44 +00:00
|
|
|
void (*begin_frame) (void);
|
|
|
|
void (*render_view) (void);
|
|
|
|
void (*set_2d) (void);
|
|
|
|
void (*end_frame) (void);
|
|
|
|
|
2012-02-14 13:19:17 +00:00
|
|
|
vid_model_funcs_t *model_funcs;
|
2012-02-14 08:28:09 +00:00
|
|
|
} vid_render_funcs_t;
|
|
|
|
|
|
|
|
typedef struct vid_render_data_s {
|
|
|
|
viddef_t *vid;
|
|
|
|
refdef_t *refdef;
|
2021-07-10 09:04:34 +00:00
|
|
|
struct view_s *scr_view;
|
2012-02-14 08:28:09 +00:00
|
|
|
int scr_copytop;
|
|
|
|
int scr_copyeverything;
|
|
|
|
int scr_fullupdate; // set to 0 to force full redraw
|
|
|
|
void (*viewsize_callback) (struct cvar_s *);
|
|
|
|
struct cvar_s *scr_viewsize;
|
2012-02-14 10:47:02 +00:00
|
|
|
struct cvar_s *graphheight;
|
2012-02-14 08:28:09 +00:00
|
|
|
float min_wateralpha;
|
|
|
|
qboolean force_fullscreen;
|
|
|
|
qboolean inhibit_viewmodel;
|
|
|
|
qboolean paused;
|
|
|
|
int lineadj;
|
|
|
|
struct entity_s *view_model;
|
|
|
|
struct entity_s *player_entity;
|
|
|
|
float gravity;
|
|
|
|
double frametime;
|
|
|
|
double realtime;
|
|
|
|
lightstyle_t *lightstyle;
|
|
|
|
} vid_render_data_t;
|
|
|
|
|
2021-06-22 10:47:20 +00:00
|
|
|
#endif // __QF_plugin_vid_render_h
|