Changeset c559904 in opengl-game for vulkan-game.cpp


Ignore:
Timestamp:
Sep 14, 2019, 12:58:30 AM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
09e15a4
Parents:
2e77b3f
Message:

Start using the logger class to output basic debugging info to a file in both openglgame and vulkangame

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vulkan-game.cpp

    r2e77b3f rc559904  
    44
    55#include "consts.hpp"
     6#include "logger.hpp"
    67
    78using namespace std;
     
    2021   cout << "Vulkan Game" << endl;
    2122
     23   // This gets the runtime version, use SDL_VERSION() for the comppile-time version
     24   // TODO: Create a game-gui function to get the gui version and retrieve it that way
     25   SDL_GetVersion(&sdlVersion);
     26
     27   // TODO: Refactor the logger api to be more flexible,
     28   // esp. since gl_log() and gl_log_err() have issues printing anything besides stirngs
     29   restart_gl_log();
     30   gl_log("starting SDL\n%s.%s.%s",
     31      to_string(sdlVersion.major).c_str(),
     32      to_string(sdlVersion.minor).c_str(),
     33      to_string(sdlVersion.patch).c_str());
     34
     35   open_log();
     36   get_log() << "starting SDL" << endl;
     37   get_log() <<
     38      (int)sdlVersion.major << "." <<
     39      (int)sdlVersion.minor << "." <<
     40      (int)sdlVersion.patch << endl;
     41
    2242   if (initWindow(width, height, guiFlags) == RTWO_ERROR) {
    2343      return;
     
    3454   mainLoop();
    3555   cleanup();
     56
     57   close_log();
    3658}
    3759
     60// TODO: Make some more initi functions, or call this initUI if the
     61// amount of things initialized here keeps growing
    3862bool VulkanGame::initWindow(int width, int height, unsigned char guiFlags) {
     63   // TODO: Put all fonts, textures, and images in the assets folder
    3964   gui = new GameGui_SDL();
    4065
    4166   if (gui->init() == RTWO_ERROR) {
     67      // TODO: Also print these sorts of errors to the log
    4268      cout << "UI library could not be initialized!" << endl;
    4369      cout << gui->getError() << endl;
Note: See TracChangeset for help on using the changeset viewer.