Initial sources
This commit is contained in:
89
engine/render/render_shared.h
Normal file
89
engine/render/render_shared.h
Normal file
@@ -0,0 +1,89 @@
|
||||
// Shared header for render stuff
|
||||
#ifndef RENDER_SHARED_H
|
||||
#define RENDER_SHARED_H
|
||||
|
||||
#include "utils/maths.h"
|
||||
|
||||
enum BufferAccess
|
||||
{
|
||||
BA_READ_ONLY,
|
||||
BA_WRITE_ONLY,
|
||||
BA_READ_WRITE
|
||||
};
|
||||
|
||||
// texture format
|
||||
enum PixelFormat
|
||||
{
|
||||
PF_UNKNOWN,
|
||||
PF_R8G8B8,
|
||||
PF_R8G8B8A8,
|
||||
PF_R8G8B8F,
|
||||
PF_R8G8B8A8F,
|
||||
|
||||
// Depth formats
|
||||
PF_DEPTH32F
|
||||
};
|
||||
|
||||
// Blending functions
|
||||
enum BlendFactor
|
||||
{
|
||||
BF_ZERO,
|
||||
BF_ONE,
|
||||
BF_SRC_COLOR,
|
||||
BF_ONE_MINUS_SRC_COLOR,
|
||||
BF_DST_COLOR,
|
||||
BF_ONE_MINUS_DST_COLOR,
|
||||
BF_SRC_ALPHA,
|
||||
BF_ONE_MINUS_SRC_ALPHA,
|
||||
BF_DST_ALPHA,
|
||||
BF_ONE_MINUS_DST_ALPHA,
|
||||
BF_CONSTANT_COLOR,
|
||||
BF_ONE_MINUS_CONSTANT_COLOR,
|
||||
BF_CONSTANT_ALPHA,
|
||||
BF_ONE_MINUS_CONSTANT_ALPHA
|
||||
};
|
||||
|
||||
enum TextureSurfaceType
|
||||
{
|
||||
TST_COLOR = 1 << 0,
|
||||
TST_DEPTH = 1 << 1,
|
||||
TST_STENCIL = 1 << 2,
|
||||
};
|
||||
|
||||
enum PrimitiveType
|
||||
{
|
||||
PT_POINTS,
|
||||
PT_LINES,
|
||||
PT_TRIANGLES
|
||||
};
|
||||
|
||||
// Base structure for render view (view and projection matrices, viewport settings)
|
||||
struct View
|
||||
{
|
||||
int x, y;
|
||||
int width, height;
|
||||
|
||||
float fov;
|
||||
};
|
||||
|
||||
// Global instance of render view
|
||||
extern View g_renderView;
|
||||
|
||||
// pixel format convertion
|
||||
uint GetGLPF(PixelFormat pf);
|
||||
uint GetGLInternalPF(PixelFormat pf);
|
||||
uint GetGLTypePF(PixelFormat pf);
|
||||
|
||||
// Blending factor convertion
|
||||
uint GetGLBlendFactor(BlendFactor factor);
|
||||
|
||||
// Stretched picture vertex
|
||||
//struct StretchedVertex
|
||||
//{
|
||||
// Vec3 position;
|
||||
// Vec2 texcoord;
|
||||
//};
|
||||
|
||||
//#define MAX_STRETCH_VX 12 * sizeof(StretchedVertex)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user