fteqw/engine/client/vr.h
Shpoike 8dadfb4878 Added sys_openfile console command(and menu option) to web and flatpak(via cmake+dbus) builds, to 'install' packages on sandboxed systems a bit more easily.
Cmake: Add FTE_WERROR option, defaults to true in debug builds and off in release builds (in case future compilers have issues).
Cmake: Pull in libXscreensaver so we don't get interrupted by screensavers when playing demos.
Make: Added `make webcl-rel` for a web build without server bloat (eg for sites focused on demo playback. Yes, this means you XantoM).
fteqcc: Include the decompiler in fteqcc (non-gui) builds ('-d' arg).
fteqcc: Decompiler can now mostly handle hexen2 mods without any unknown opcodes.
Allow ezHud and OpenSSL to be compiled as in-engine plugins, potentially for web and windows ports respectively.
Web: Fix support for ogg vorbis. Add support for voip.
Web: Added basic support for WebXR.
QTV: Don't try seeking on unseekable qtv streams. Don't spam when developer 1 is set.
QTV: add support for some eztv extensions.
MVD: added hack to use ktx's vweps in mvd where mvdsv doesn't bother to record the info.
qwfwd: hack around a hack in qwfwd, allowing it to work again.
recording: favour qwd in single player, instead of mvd.
Protocol: reduce client memory used for precache names. Bump maximum precache counts - some people are just abusive, yes you Orl.
hexen2: add enough clientside protocol compat to play the demo included with h2mp. lacks effects.
in_xflip: restored this setting.
fs_hidesyspaths: new cvar, defaults to enabled so you won't find your username or whatever turning up in screenshots or the like. change it to 0 before debuging stuff eg via 'path'.
gl_overbright_models: Added cvar to match QS.
netchan: Added MTU determination, we'll no longer fail to connect when routers stupidly drop icmp packets.
Win: try a few other versions of xinput too.
CSQC: Added a CSQC_GenerateMaterial function, to give the csqc a chance to generate custom materials.
MenuQC: Added support for the skeletal objects API.
2024-07-14 19:58:24 +01:00

83 lines
2.3 KiB
C

#include "merged.h"
typedef struct vrsetup_s
{
//engine-set
size_t structsize;
enum
{
VR_HEADLESS, //not to be confused with decapitation
VR_EGL,
VR_X11_GLX,
// VR_ANDROID_EGL,
VR_WIN_WGL,
VR_VULKAN, //vulkan has no platform variation
VR_D3D11, //d3d11 only works on windows, so no platform variation
} vrplatform; //the type of renderer/args getting inited. abort if unknown.
void *userctx; //for use in callbacks.
qboolean (*createinstance)(struct vrsetup_s *, char *instanceextensions, void *result); //used by vulkan, can be null for other renderers
//vr-set (by preinit)
struct
{
int major, minor;
} minver, maxver;
unsigned int deviceid[2];
char *deviceextensions;
//engine-set (for full init)
//this stuff is intentionally at the end
union {
struct
{
void *display;
int visualid;
void *glxfbconfig;
unsigned long drawable; //really int32
void *glxcontext;
} x11_glx;
struct
{
void *(*getprocaddr)(const char *name);
void *egldisplay;
void *eglconfig;
void *eglcontext;
} egl;
struct
{
void *hdc;
void *hglrc;
} wgl;
struct
{
void *device;
} d3d;
struct
{ //these are ALWAYS pointers in vulkan (annoyingly unlike many of its typedefs).
void *instance;
void *physicaldevice;
void *device;
unsigned int queuefamily;
unsigned int queueindex;
} vk;
};
} vrsetup_t;
#define VRF_OVERRIDEFRAMETIME 1 //the vr interface is responsible for determining frame intervals instead of using regular clocks (so they can fiddle with prediction etc)
#define VRF_UIACTIVE 2 //we're actually rendering through a headset. use 3d rendering exclusively, with VR UI and stuff.
//interface registered by plugins for VR stuff.
typedef struct plugvrfuncs_s
{
const char *description;
qboolean (*Prepare) (vrsetup_t *setupinfo); //called before graphics context init
qboolean (*Init) (vrsetup_t *setupinfo, rendererstate_t *info); //called after graphics context init
unsigned int (*SyncFrame)(double *frametime); //called in the client's main loop, to block/tweak frame times. True means the game should render as fast as possible.
qboolean (*Render) (void(*rendereye)(texid_t tex, const pxrect_t *viewport, const vec4_t fovoverride, const float projmatrix[16], const float eyematrix[12]));
void (*Shutdown) (void);
#define plugvrfuncs_name "VR"
} plugvrfuncs_t;