Move backgroundColor out of Pipeline;

This commit is contained in:
bjorn 2018-12-24 18:53:23 -08:00 committed by Bjorn Swenson
parent 2ceb474b04
commit 030c765c6b
2 changed files with 4 additions and 5 deletions

View File

@ -151,8 +151,7 @@ void lovrGraphicsSetCamera(Camera* camera, bool clear) {
}
if (clear) {
Color backgroundColor = lovrGraphicsGetBackgroundColor();
lovrGpuClear(state.camera.canvas, &backgroundColor, &(float) { 1. }, &(int) { 0 });
lovrGpuClear(state.camera.canvas, &state.backgroundColor, &(float) { 1. }, &(int) { 0 });
}
}
@ -216,11 +215,11 @@ void lovrGraphicsSetAlphaSampling(bool sample) {
}
Color lovrGraphicsGetBackgroundColor() {
return state.pipeline->backgroundColor;
return state.backgroundColor;
}
void lovrGraphicsSetBackgroundColor(Color color) {
state.pipeline->backgroundColor = color;
state.backgroundColor = color;
}
void lovrGraphicsGetBlendMode(BlendMode* mode, BlendAlphaMode* alphaMode) {

View File

@ -101,7 +101,6 @@ typedef struct {
typedef struct {
bool alphaSampling;
Color backgroundColor;
BlendMode blendMode;
BlendAlphaMode blendAlphaMode;
Canvas* canvas;
@ -151,6 +150,7 @@ typedef struct {
Pipeline pipelines[MAX_PIPELINES];
Pipeline* pipeline;
int pipelineIndex;
Color backgroundColor;
DrawRequest batch;
int batchVertex;
int batchIndex;