Changeset c559904 in opengl-game for opengl-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
  • opengl-game.cpp

    r2e77b3f rc559904  
    44
    55#include "consts.hpp"
     6#include "logger.hpp"
    67
    78using namespace std;
     
    2425   cout << "OpenGL Game" << endl;
    2526
     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 GLFW\n%s", glfwGetVersionString());
     31
     32   open_log();
     33   get_log() << "starting GLFW" << endl;
     34   get_log() << glfwGetVersionString() << endl;
     35
    2636   if (initWindow(width, height, guiFlags) == RTWO_ERROR) {
    2737      return;
     
    3141   mainLoop();
    3242   cleanup();
     43
     44   close_log();
    3345}
    3446
     47// TODO: Make some more initi functions, or call this initUI if the
     48// amount of things initialized here keeps growing
    3549bool OpenGLGame::initWindow(int width, int height, unsigned char guiFlags) {
     50   // TODO: Put all fonts, textures, and images in the assets folder
    3651   gui = new GameGui_GLFW();
    3752
    3853   if (gui->init() == RTWO_ERROR) {
     54      // TODO: Also print these sorts of errors to the log
    3955      cout << "UI library could not be initialized!" << endl;
    4056      cout << gui->getError() << endl;
Note: See TracChangeset for help on using the changeset viewer.