66 lines
984 B
C++
66 lines
984 B
C++
/* -----------------------------------------------------------------------------
|
|
GSFramework
|
|
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
|
------------------------------------------------------------------------------*/
|
|
|
|
|
|
#ifndef __GPUDRAWCONTEXT__
|
|
#define __GPUDRAWCONTEXT__
|
|
|
|
|
|
#include "gpu/gpu_material.h"
|
|
|
|
|
|
namespace GS {
|
|
|
|
namespace Core { class Light; }
|
|
namespace GPU {
|
|
|
|
//
|
|
struct DrawContext
|
|
{
|
|
NPLACEMENT_NEW(Renderer)
|
|
|
|
enum Render
|
|
{
|
|
Deferred = 0,
|
|
Opaque,
|
|
Alpha
|
|
};
|
|
enum Draw
|
|
{
|
|
Base = 0,
|
|
Light
|
|
};
|
|
|
|
struct Context
|
|
{
|
|
Draw draw;
|
|
Render render;
|
|
MaterialShader::Variant variant;
|
|
};
|
|
|
|
Context ctx;
|
|
|
|
Core::Light *light;
|
|
|
|
void SetContext(Render rc, Draw dc, MaterialShader::Variant prg)
|
|
{
|
|
ctx.render = rc;
|
|
ctx.draw = dc;
|
|
ctx.variant = prg;
|
|
}
|
|
|
|
DrawContext(Render rc, Draw dc, MaterialShader::Variant prg = MaterialShader::Depth)
|
|
{
|
|
SetContext(rc, dc, prg);
|
|
light = 0;
|
|
}
|
|
};
|
|
|
|
} // GPU
|
|
} // GS
|
|
|
|
|
|
#endif // __GPUDRAWCONTEXT__
|