add depth
This commit is contained in:
@@ -49,7 +49,9 @@ bool Renderer::Init() {
|
||||
#endif
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
glEnable(GL_BLEND);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthFunc(GL_LESS);
|
||||
InitShaders();
|
||||
return true;
|
||||
}
|
||||
@@ -71,7 +73,7 @@ void Renderer::RenderModel(const Model& model) {
|
||||
}
|
||||
|
||||
void Renderer::Prepare() {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
glClearColor(m_BackgroundColor.r, m_BackgroundColor.g, m_BackgroundColor.b, 0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user