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
|
|
|
|
|
|
|
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-05-11 11:27:51 +00:00
|
|
|
RFL_FRAMEBUFFER = 4,
|
|
|
|
RFL_BUFFER_STORAGE = 8,
|
|
|
|
RFL_SHADER_STORAGE_BUFFER = 16,
|
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)
|
|
|
|
TM_MASK = 1, // (1, 1, 1, a)
|
|
|
|
TM_OPAQUE = 2, // (r, g, b, 1)
|
|
|
|
TM_INVERSE = 3, // (1-r, 1-g, 1-b, a)
|
|
|
|
TM_REDTOALPHA = 4, // (1, 1, 1, r)
|
|
|
|
|
|
|
|
// 4 cannot be done natively without shaders and requires special textures.
|
2013-06-23 07:49:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct RenderContext
|
|
|
|
{
|
|
|
|
unsigned int flags;
|
|
|
|
unsigned int maxuniforms;
|
2014-05-10 19:47:07 +00:00
|
|
|
float version;
|
2014-05-11 11:27:51 +00:00
|
|
|
float glslversion;
|
2013-06-23 07:49:34 +00:00
|
|
|
int max_texturesize;
|
|
|
|
char * vendorstring;
|
2014-05-11 15:56:38 +00:00
|
|
|
bool needAlphaTexture;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
int MaxLights() const
|
|
|
|
{
|
|
|
|
return maxuniforms>=2048? 128:64;
|
|
|
|
}
|
2014-05-11 11:27:51 +00:00
|
|
|
|
|
|
|
bool hasGLSL() const
|
|
|
|
{
|
|
|
|
return glslversion >= 1.3f;
|
|
|
|
}
|
2013-06-23 07:49:34 +00:00
|
|
|
};
|
|
|
|
|
2013-09-03 16:29:39 +00:00
|
|
|
extern RenderContext gl;
|
2013-06-23 07:49:34 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|