-RenderTargetFormat::RenderTargetFormat():
- count(0)
-{ }
-
-RenderTargetFormat::RenderTargetFormat(RenderOutput o):
- count(1)
-{
- outputs[0] = o;
-}
-
-RenderTargetFormat RenderTargetFormat::operator,(RenderOutput o) const
-{
- if(count>=MAX_OUTPUTS)
- throw invalid_operation("RenderTargetFormat::operator,");
-
- RenderTargetFormat result = *this;
- result.outputs[result.count++] = o;
-
- return result;
-}
-
-RenderTargetFormat RenderTargetFormat::operator,(PixelFormat f) const
-{
- if(!count)
- throw invalid_operation("RenderTargetFormat::operator,");
-
- PixelComponents comp = get_components(f);
- unsigned size = get_component_size(f);
- unsigned char out = outputs[count-1];
- if(get_output_type(out)>=get_output_type(RENDER_DEPTH))
- {
- if(comp!=DEPTH_COMPONENT)
- throw invalid_argument("RenderTargetFormat::operator,");
- if(size>1)
- --size;
- if(get_component_type(f)==UNSIGNED_INT)
- --size;
- }
- else
- {
- if(comp!=RED && comp!=RG && comp!=RGB && comp!=RGBA)
- throw invalid_argument("RenderTargetformat::operator,");
- if(size>3)
- --size;
- }
-
- out = (out&~15) | (size<<2) | (get_component_count(f)-1);
- RenderTargetFormat result = *this;
- result.outputs[result.count-1] = out;
-
- return result;
-}
-
-int RenderTargetFormat::index(RenderOutput o) const