Skip to content
Permalink
Browse files

Added some error messages to the renderer initialization.

  • Loading branch information...
Angelo1211 committed Dec 28, 2018
1 parent aa0a48f commit 6ba388aed114882d6329a34ab6859119d304294f
Showing with 8 additions and 5 deletions.
  1. +0 −2 src/mesh.cpp
  2. +0 −1 src/meshPrimitives.cpp
  3. +8 −2 src/renderManager.cpp
@@ -49,13 +49,11 @@ void Mesh::draw(const Shader &shader, bool textured){
shader.setInt("metalRoughMap", 4);
glBindTexture(GL_TEXTURE_2D, textures[4]);

glActiveTexture(GL_TEXTURE0);
}

//Mesh Drawing
glBindVertexArray(VAO);
glDrawElements(GL_TRIANGLES, (GLsizei)indices.size(), GL_UNSIGNED_INT, 0);
glBindVertexArray(0);
}

//Sending the data to the GPU and formatting it in memory
@@ -34,7 +34,6 @@ void Primitive::draw(const unsigned int readTexture1, const unsigned int readTex

glDrawArrays(GL_TRIANGLES, 0, numVertices);

glBindVertexArray(0);
}

//----------------------------------------------------------------------------------------------------
@@ -19,32 +19,38 @@ RenderManager::~RenderManager(){}
//Sets the internal pointers to the screen and the current scene and inits the software
//renderer instance.
bool RenderManager::startUp(DisplayManager &displayManager, SceneManager &sceneManager ){
printf("\nInitializing Renderer.\n");
//Getting pointers to the data we'll render
screen = &displayManager;
sceneLocator = &sceneManager;
currentScene = sceneLocator->getCurrentScene();
sceneCamera = currentScene->getCurrentCamera();

printf("Loading FBO's...\n");
if( !initFBOs() ){
printf("FBO's failed to be initialized correctly.\n");
return false;
}


printf("Loading Shaders...\n");
if (!loadShaders()){
printf("Shaders failed to be initialized correctly.\n");
return false;
}

printf("Loading SSBO's...\n");
if (!initSSBOs()){
printf("SSBO's failed to be initialized correctly.\n");
return false;
}

printf("Preprocessing...\n");
if (!preProcess()){
printf("SSBO's failed to be initialized correctly.\n");
return false;
}

printf("Renderer Initialization complete.\n");
return true;
}

@@ -94,7 +100,7 @@ bool RenderManager::preProcess(){
for (unsigned int i = 0; i < currentScene->pointLightCount; ++i){
pointLightShadowFBOs[i].bind();
pointLightShadowFBOs[i].clear(GL_DEPTH_BUFFER_BIT, glm::vec3(1.0f));
currentScene->drawPointLightShadow(pointShadowShader, i, pointLightShadowFBOs[i].depthBuffer);
currentScene->drawPointLightShadow(pointShadowShader,i, pointLightShadowFBOs[i].depthBuffer);
}

// Directional shadows

0 comments on commit 6ba388a

Please sign in to comment.
You can’t perform that action at this time.