We use fwrite to write formated data to disk and use fread to later read them back from disk. Different data types are very different in using fwrite/fread. The following shows how to do for vector (simple), Mat, vector<Mat>, struct (simple), struct (complex).

Read more »

Upgrade the structure of all files in current folder (including sub-folders and sub-sub-folders…) by one level

1
for /r %x in (*.*) do move "%x" "%x"/../..
Read more »

using C - FILE (stdio.h)

  • 文件的类型: 二进制文件/一般文件, 只是读取和写入的方式不一样罢了

    • 读取一般文件: (写类似)

      1
      2
      FILE *fi;
      fi=fopen("15.dat","r");
    • 读取二进制文件: (写类似)

      1
      2
      FILE *fi;
      fi=fopen("15.dat","rb");
Read more »

代码组织

  • 代码: 写在 View
  • 数据: 写在 Doc
  • 变量: 在 View.h 中申明, 在 View.cpp 的构造函数中初始化, 在 View.cpp 的析构函数中释放
Read more »

Setup

Please refer to here on how to setup OpenGL.

原则

RenderScene() 函数里面只放绘制的东西, 计算的所有代码独立出去, 保证速度!

Read more »