2021-01-16 22:22:31 +01:00
|
|
|
#include "vk_renderstate.h"
|
|
|
|
|
|
|
|
#include "vk_core.h"
|
|
|
|
|
2021-01-09 22:21:58 +01:00
|
|
|
#include "cvardef.h"
|
|
|
|
#include "const.h"
|
|
|
|
#include "ref_api.h"
|
|
|
|
#include "com_strings.h"
|
2021-01-16 22:22:31 +01:00
|
|
|
#include "eiface.h" // ARRAYSIZE
|
2021-01-09 22:21:58 +01:00
|
|
|
|
2021-01-18 22:33:22 +01:00
|
|
|
render_state_t vk_renderstate = {0};
|
2021-01-09 22:21:58 +01:00
|
|
|
|
|
|
|
static const char *renderModeName(int mode)
|
|
|
|
{
|
|
|
|
switch(mode)
|
|
|
|
{
|
|
|
|
case kRenderNormal: return "kRenderNormal";
|
|
|
|
case kRenderTransColor: return "kRenderTransColor";
|
|
|
|
case kRenderTransTexture: return "kRenderTransTexture";
|
|
|
|
case kRenderGlow: return "kRenderGlow";
|
|
|
|
case kRenderTransAlpha: return "kRenderTransAlpha";
|
|
|
|
case kRenderTransAdd: return "kRenderTransAdd";
|
|
|
|
default: return "INVALID";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void GL_SetRenderMode( int renderMode )
|
|
|
|
{
|
2021-01-18 22:33:22 +01:00
|
|
|
vk_renderstate.blending_mode = renderMode;
|
2021-01-09 22:21:58 +01:00
|
|
|
}
|
|
|
|
|
2021-01-16 22:22:31 +01:00
|
|
|
void TriColor4ub( unsigned char r, unsigned char g, unsigned char b, unsigned char a )
|
2021-01-09 22:21:58 +01:00
|
|
|
{
|
2021-01-18 22:33:22 +01:00
|
|
|
vk_renderstate.tri_color = (color_rgba8_t){r, g, b, a};
|
2021-01-09 22:21:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void R_AllowFog( qboolean allow )
|
|
|
|
{
|
2021-01-18 22:33:22 +01:00
|
|
|
vk_renderstate.fog_allowed = allow;
|
2021-01-09 22:21:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void R_Set2DMode( qboolean enable )
|
|
|
|
{
|
2021-01-18 22:33:22 +01:00
|
|
|
vk_renderstate.mode_2d = enable;
|
2021-01-09 22:21:58 +01:00
|
|
|
}
|
2021-01-16 22:22:31 +01:00
|
|
|
|