Changeset cd487fb in opengl-game for graphics-pipeline_vulkan.hpp


Ignore:
Timestamp:
Nov 12, 2019, 9:48:50 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
b8777b7
Parents:
e3bef3a
git-author:
Dmitry Portnoy <dmitry.portnoy@…> (11/12/19 21:25:58)
git-committer:
Dmitry Portnoy <dmitry.portnoy@…> (11/12/19 21:48:50)
Message:

Replace some couts with runtime_exceptions and, in vulkangame, only call SDL_SetRenderTarget once, during initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • graphics-pipeline_vulkan.hpp

    re3bef3a rcd487fb  
    44#include "graphics-pipeline.hpp"
    55
    6 #include <iostream>
     6#include <stdexcept>
    77#include <vector>
    88
     
    1212
    1313using namespace std;
    14 
    15 // TODO: Remove any instances of cout and instead throw exceptions
    1614
    1715// TODO: Maybe change the name of this struct so I can call the list something other than descriptorInfoList
     
    113111bool GraphicsPipeline_Vulkan::addObject(const vector<VertexType>& vertices, vector<uint16_t>& indices,
    114112      VkCommandPool commandPool, VkQueue graphicsQueue) {
    115    cout << "Adding object to pipeline..." << endl;
    116113
    117114   if (numVertices + vertices.size() > vertexCapacity) {
    118       cout << "ERROR: Need to resize vertex buffers" << endl;
     115      throw runtime_error("ERROR: Need to resize vertex buffers");
    119116   } else if (numIndices + indices.size() > indexCapacity) {
    120       cout << "ERROR: Need to resize index buffers" << endl;
     117      throw runtime_error("ERROR: Need to resize index buffers");
    121118   } else {
    122       cout << "Added object to scene" << endl;
    123 
    124119      for (uint16_t& idx : indices) {
    125120         idx += numVertices;
Note: See TracChangeset for help on using the changeset viewer.