2013-06-23 07:49:34 +00:00
|
|
|
#ifndef R_RENDER
|
|
|
|
#define R_RENDER
|
|
|
|
|
2013-06-26 23:01:00 +00:00
|
|
|
#include "basictypes.h"
|
2013-06-23 07:49:34 +00:00
|
|
|
|
2016-04-26 11:50:05 +00:00
|
|
|
enum GLCompat
|
|
|
|
{
|
|
|
|
CMPT_GL2,
|
|
|
|
CMPT_GL2_SHADER,
|
|
|
|
CMPT_GL3,
|
|
|
|
CMPT_GL4
|
|
|
|
};
|
|
|
|
|
2013-06-23 07:49:34 +00:00
|
|
|
enum RenderFlags
|
|
|
|
{
|
|
|
|
// [BB] Added texture compression flags.
|
2014-05-11 11:27:51 +00:00
|
|
|
RFL_TEXTURE_COMPRESSION=1,
|
|
|
|
RFL_TEXTURE_COMPRESSION_S3TC=2,
|
2013-06-23 07:49:34 +00:00
|
|
|
|
2014-08-19 13:56:33 +00:00
|
|
|
RFL_SHADER_STORAGE_BUFFER = 4,
|
2016-04-22 17:54:51 +00:00
|
|
|
RFL_BUFFER_STORAGE = 8,
|
2016-04-26 11:50:05 +00:00
|
|
|
RFL_SAMPLER_OBJECTS = 16,
|
2016-07-29 19:31:20 +00:00
|
|
|
|
2016-09-01 09:52:52 +00:00
|
|
|
RFL_NO_CLIP_PLANES = 32,
|
2016-08-17 15:37:13 +00:00
|
|
|
|
2016-09-01 09:52:52 +00:00
|
|
|
RFL_INVALIDATE_BUFFER = 64,
|
|
|
|
RFL_DEBUG = 128
|
2013-06-23 07:49:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum TexMode
|
|
|
|
{
|
2014-05-11 15:56:38 +00:00
|
|
|
TM_MODULATE = 0, // (r, g, b, a)
|
2014-09-09 11:21:36 +00:00
|
|
|
TM_MASK, // (1, 1, 1, a)
|
|
|
|
TM_OPAQUE, // (r, g, b, 1)
|
|
|
|
TM_INVERSE, // (1-r, 1-g, 1-b, a)
|
|
|
|
TM_REDTOALPHA, // (1, 1, 1, r)
|
2014-09-21 09:08:17 +00:00
|
|
|
TM_CLAMPY, // (r, g, b, (t >= 0.0 && t <= 1.0)? a:0)
|
2016-04-26 11:50:05 +00:00
|
|
|
|
|
|
|
TM_INVERTOPAQUE, // used by GL 2.x fallback code.
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ELightMethod
|
|
|
|
{
|
2016-09-01 09:52:52 +00:00
|
|
|
LM_LEGACY = 0, // placeholder for legacy mode (textured lights), should not be checked anywhere in the code!
|
2016-04-26 11:50:05 +00:00
|
|
|
LM_DEFERRED = 1, // calculate lights up front in a separate pass
|
|
|
|
LM_DIRECT = 2, // calculate lights on the fly along with the render data
|
2013-06-23 07:49:34 +00:00
|
|
|
};
|
|
|
|
|
2016-08-06 10:03:16 +00:00
|
|
|
enum EBufferMethod
|
|
|
|
{
|
2016-09-01 09:52:52 +00:00
|
|
|
BM_LEGACY = 0, // placeholder for legacy mode (client arrays), should not be checked anywhere in the code!
|
|
|
|
BM_DEFERRED = 1, // use a temporarily mapped buffer, for GL 3.x core profile
|
2016-08-06 10:03:16 +00:00
|
|
|
BM_PERSISTENT = 2 // use a persistently mapped buffer
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2013-06-23 07:49:34 +00:00
|
|
|
struct RenderContext
|
|
|
|
{
|
|
|
|
unsigned int flags;
|
|
|
|
unsigned int maxuniforms;
|
2014-07-30 21:13:16 +00:00
|
|
|
unsigned int maxuniformblock;
|
2014-08-01 18:59:39 +00:00
|
|
|
unsigned int uniformblockalignment;
|
2016-04-26 11:50:05 +00:00
|
|
|
int lightmethod;
|
2016-08-06 10:03:16 +00:00
|
|
|
int buffermethod;
|
2014-05-11 11:27:51 +00:00
|
|
|
float glslversion;
|
2013-06-23 07:49:34 +00:00
|
|
|
int max_texturesize;
|
|
|
|
char * vendorstring;
|
2016-09-01 09:52:52 +00:00
|
|
|
bool legacyMode;
|
2017-01-25 06:18:26 +00:00
|
|
|
bool es;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
int MaxLights() const
|
|
|
|
{
|
|
|
|
return maxuniforms>=2048? 128:64;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-09-03 16:29:39 +00:00
|
|
|
extern RenderContext gl;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|