2012-02-17 07:13:56 +00:00
|
|
|
#ifndef __vid_internal_h
|
|
|
|
#define __vid_internal_h
|
|
|
|
|
|
|
|
#include "QF/vid.h"
|
|
|
|
#include "QF/plugin/vid_render.h"
|
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
typedef struct vid_system_s {
|
|
|
|
void (*init) (byte *palette, byte *colormap);
|
|
|
|
void (*init_cvars) (void);
|
|
|
|
void (*update_fullscreen) (int fullscreen);
|
|
|
|
} vid_system_t;
|
|
|
|
|
|
|
|
extern vid_system_t vid_system;
|
|
|
|
|
2019-07-08 04:40:29 +00:00
|
|
|
typedef struct vid_internal_s {
|
2021-07-10 15:09:41 +00:00
|
|
|
void (*flush_caches) (void *data);
|
|
|
|
void (*init_buffers) (void *data);
|
|
|
|
void (*set_palette) (void *data, const byte *palette);
|
2022-03-29 04:08:58 +00:00
|
|
|
void (*set_colormap) (void *data, const byte *colormap);
|
2019-07-08 04:40:29 +00:00
|
|
|
|
2021-07-10 15:09:41 +00:00
|
|
|
void (*choose_visual) (void *data);
|
|
|
|
void (*create_context) (void *data);
|
|
|
|
|
|
|
|
void *data;
|
2019-07-08 16:00:47 +00:00
|
|
|
|
|
|
|
struct gl_ctx_s *(*gl_context) (void);
|
|
|
|
struct sw_ctx_s *(*sw_context) (void);
|
|
|
|
struct vulkan_ctx_s *(*vulkan_context) (void);
|
2019-07-08 04:40:29 +00:00
|
|
|
} vid_internal_t;
|
|
|
|
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
extern int vid_fullscreen;
|
|
|
|
extern int vid_system_gamma;
|
|
|
|
extern float vid_gamma;
|
2012-02-17 07:13:56 +00:00
|
|
|
|
|
|
|
void VID_GetWindowSize (int def_w, int def_h);
|
2022-09-21 16:05:55 +00:00
|
|
|
void VID_SetWindowSize (int width, int height);
|
2012-02-17 07:13:56 +00:00
|
|
|
|
2013-01-27 10:57:40 +00:00
|
|
|
void VID_InitGamma (const byte *);
|
2012-02-17 07:13:56 +00:00
|
|
|
qboolean VID_SetGamma (double);
|
[cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.
As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.
The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).
While not used yet (partly due to working out the design), cvars can
have a validation function.
Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.
nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-23 03:22:45 +00:00
|
|
|
void VID_UpdateGamma (void);
|
2012-02-17 07:13:56 +00:00
|
|
|
|
2014-02-02 07:42:08 +00:00
|
|
|
void VID_MakeColormaps (void);
|
|
|
|
|
2012-02-17 07:13:56 +00:00
|
|
|
#endif//__vid_internal_h
|