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);
|
2023-03-05 07:56:09 +00:00
|
|
|
void (*shutdown) (void);
|
2022-11-14 10:39:55 +00:00
|
|
|
void (*set_palette) (byte *palette, byte *colormap);
|
[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 (*init_cvars) (void);
|
|
|
|
void (*update_fullscreen) (int fullscreen);
|
2023-06-30 05:50:47 +00:00
|
|
|
void (*set_cursor) (bool visible);
|
[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
|
|
|
} vid_system_t;
|
|
|
|
|
|
|
|
extern vid_system_t vid_system;
|
|
|
|
|
2019-07-08 04:40:29 +00:00
|
|
|
typedef struct vid_internal_s {
|
2023-03-06 12:15:15 +00:00
|
|
|
void (*flush_caches) (void *ctx);
|
|
|
|
void (*init_buffers) (void *ctx);
|
|
|
|
void (*set_palette) (void *ctx, const byte *palette);
|
|
|
|
void (*set_colormap) (void *ctx, const byte *colormap);
|
2019-07-08 04:40:29 +00:00
|
|
|
|
2023-03-06 12:15:15 +00:00
|
|
|
void (*choose_visual) (void *ctx);
|
|
|
|
void (*create_context) (void *ctx);
|
2021-07-10 15:09:41 +00:00
|
|
|
|
2023-03-06 12:15:15 +00:00
|
|
|
void *ctx;
|
2019-07-08 16:00:47 +00:00
|
|
|
|
2023-03-06 12:15:15 +00:00
|
|
|
struct gl_ctx_s *(*gl_context) (struct vid_internal_s *);
|
|
|
|
struct sw_ctx_s *(*sw_context) (struct vid_internal_s *);
|
|
|
|
struct vulkan_ctx_s *(*vulkan_context) (struct vid_internal_s *);
|
|
|
|
|
|
|
|
void (*unload) (void *data);
|
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 *);
|
2023-06-13 09:06:11 +00:00
|
|
|
bool 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
|