added clearColor attribute in sparrowRenderer
This commit is contained in:
parent
f5dfd8f5d3
commit
97032c2fe6
@ -29,9 +29,6 @@ void ForwardModule::renderGL(Camera* myCamera, Scene* scene)
|
||||
renderTarget->bindFBO();
|
||||
|
||||
// render ambient lighting
|
||||
glAssert(glClearColor(0, 0.1f, 0.05f, 1.)); // add attribute, and setter for clear color
|
||||
glAssert(glClearDepth(1.0));
|
||||
glAssert(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
|
||||
glAssert(glDepthFunc(GL_LESS));
|
||||
glAssert(glDisable(GL_BLEND));
|
||||
|
||||
|
@ -58,6 +58,9 @@ void SparrowRenderer::resizeGL(int width, int height)
|
||||
|
||||
void SparrowRenderer::renderGL()
|
||||
{
|
||||
glAssert(glClearColor(clearColor.r, clearColor.g, clearColor.b, 1));
|
||||
glAssert(glClearDepth(1.0));
|
||||
glAssert(glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));
|
||||
for(ModuleNode &m : modules)
|
||||
{
|
||||
if(m.isEnabled)
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <glm/vec3.hpp>
|
||||
|
||||
class Camera;
|
||||
class Module;
|
||||
@ -11,12 +12,19 @@ class Scene;
|
||||
class SparrowRenderer
|
||||
{
|
||||
public:
|
||||
SparrowRenderer() :
|
||||
camera(NULL),
|
||||
scene(NULL),
|
||||
clearColor(0)
|
||||
{}
|
||||
|
||||
// main methods
|
||||
void initGL(int width, int height, bool forceCrappy = false);
|
||||
void destroyGL();
|
||||
void resizeGL(int width, int height);
|
||||
void renderGL();
|
||||
static bool isModernOpenGLAvailable();
|
||||
void setClearColor(glm::vec3 color) {clearColor=color;}
|
||||
|
||||
// clock methods
|
||||
double getFPS();
|
||||
@ -48,6 +56,7 @@ protected:
|
||||
Scene* scene;
|
||||
std::vector<ModuleNode> modules;
|
||||
static bool modernOpenglAvailable;
|
||||
glm::vec3 clearColor;
|
||||
|
||||
std::vector<ModuleNode>::iterator getModuleNode(std::string name);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user