Changeset 98f06d9 in opengl-game for new-game.cpp


Ignore:
Timestamp:
May 24, 2019, 8:01:34 PM (5 years ago)
Author:
Dmitry Portnoy <dmitry.portnoy@…>
Branches:
feature/imgui-sdl, master, points-test
Children:
a23fc08
Parents:
d9b6a1c
Message:

Add support for ofstream to logger.cpp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • new-game.cpp

    rd9b6a1c r98f06d9  
    346346   gl_log("starting GLFW\n%s", glfwGetVersionString());
    347347
     348   open_log();
     349   get_log() << "starting GLFW" << endl;
     350   get_log() << glfwGetVersionString() << endl;
     351
    348352   glfwSetErrorCallback(glfw_error_callback);
    349353   if (!glfwInit()) {
    350354      gl_log_err("ERROR: could not start GLFW3");
     355      cerr << "ERROR: could not start GLFW3" << endl;
     356      get_log() << "ERROR: could not start GLFW3" << endl;
    351357      return 1;
    352358   }
     
    380386   if (!window) {
    381387      gl_log_err("ERROR: could not open window with GLFW3");
     388      cerr << "ERROR: could not open window with GLFW3" << endl;
     389      get_log() << "ERROR: could not open window with GLFW3" << endl;
    382390      glfwTerminate();
    383391      return 1;
     
    449457   gl_log("Renderer: %s", renderer);
    450458   gl_log("Supported OpenGL version: %s", version);
     459
     460   get_log() << "Renderer: " << renderer << endl;
     461   get_log() << "Supported OpenGL version: " << version << endl;
    451462
    452463   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
     
    10111022   glfwTerminate();
    10121023
     1024   close_log();
     1025
    10131026   // free memory
    10141027
     
    10341047void glfw_error_callback(int error, const char* description) {
    10351048   gl_log_err("GLFW ERROR: code %i msg: %s", error, description);
     1049   cerr << "GLFW ERROR: code " << error << " msg: " << description << endl;
     1050   get_log() << "GLFW ERROR: code " << error << " msg: " << description << endl;
    10361051}
    10371052
     
    12751290  if (!image_data) {
    12761291    gl_log_err("ERROR: could not load %s", file_name.c_str());
     1292    cerr << "ERROR: could not load " << file_name << endl;
     1293    get_log() << "ERROR: could not load " << file_name << endl;
    12771294  }
    12781295
     
    12801297  if ((*x & (*x - 1)) != 0 || (*y & (*y - 1)) != 0) {
    12811298     gl_log_err("WARNING: texture %s is not power-of-2 dimensions", file_name.c_str());
     1299     cerr << "WARNING: texture " << file_name << " is not power-of-2 dimensions" << endl;
     1300     get_log() << "WARNING: texture " << file_name << " is not power-of-2 dimensions" << endl;
    12821301  }
    12831302
Note: See TracChangeset for help on using the changeset viewer.