- 博客(9)
- 收藏
- 关注
原创 [BlackPearl引擎开发记录 6] --ImGui
完整代码:https://github.com/DXT00/LearnOpenGL_study/tree/1977d59c505868f63f718cb7d8d22c3f5176cd69ImGui selectable 菜单:const char* entityItems[] = { "Empty","PointLight","SpotLight","IronMan","Cube" ...
2019-10-30 17:04:03 1403
原创 [BlackPearl引擎开发记录 4] ---dynamic_pointer_cast 必须是多态类才能转换
类之间必须具有多态属性:即至少含有一个虚函数(非析构虚函数)!!错误例子:#include<iostream>#include<memory>#include<vector>#include<string>class Manager{public: Manager(); ~Manager();private:};...
2019-10-29 16:57:54 252
原创 c++ learning -- template 泛型编程
参考书籍:effective c++ 条款43面向对象编程:显示接口 + 运行时多态(哪一个virtual函数被绑定 - 发生在运行期)泛型编程 :隐式接口 + 编译时多态 (哪一个重载函数被调用 - 发生在编译期)template注意点1:子类不能顺利的调用模板化基类的函数Example:#include<iostream>class ...
2019-10-25 11:12:30 263
原创 [BlackPearl引擎开发记录 3] -- 对象析构注意点
记录一下今天写的bug = =:析构顺序不正确导致abort()异常 (析构了栈上的变量,这个变量含有生命周期比他长的类的成员变量)代码如下:class EntityTestLayer :public BlackPearl::Layer {public: EntityTestLayer(const std::string& name, BlackPearl::SystemM...
2019-10-24 16:05:21 219
原创 [BlackPearl引擎开发记录 2] Visual stidio 定位内存泄漏 --- 使用CTR library 定位内存泄漏
参考:https://docs.microsoft.com/en-us/visualstudio/debugger/finding-memory-leaks-using-the-crt-library?view=vs-2017定位 new 分配的内存泄漏位置:1.使用宏定义:输出内存泄漏的文件以及行数#ifdef _DEBUG#define DBG_NEW new ( _NORM...
2019-10-24 12:28:11 182
原创 [BlackPearl引擎开发记录 1] error LNK2005---static 变量定义放在.h文件导致的!
注意:static变量的定义最好放在.cpp文件,而不是.h文件否则会出现链接错误!static变量只初始化一次,如果多个类都包含这个含有static初始化的.h文件,就会出现重定义错误(error LNK2005)!!比如:BaseComponent.h#pragma oncenamespace BlackPearl { /** * Base component c...
2019-10-24 09:49:44 173
原创 c++ learning -- reinterpret_cast类型转换
参考:《More effective c++》条款2reinterpret_cast 用于函数指针类型转换:例子:把 int dosonething()函数指针强制转换为 void (*FuncPtr) :#include <iostream>typedef void(*FuncPtr)();FuncPtr funcArray[10];void x...
2019-10-16 19:36:32 194
转载 C/C 为什么static变量只初始化一次
转自:http://yuanyuanba.com/forum.php?mod=viewthread&tid=768class F {public: int Famliy(int a) { static int famliy = a; std::cout << "in Famliy famliy:" << famliy << std::...
2019-10-15 21:17:11 8176
原创 [BlackPearl引擎开发记录 0]LearnOpenGL_study -- 游戏引擎编译与链接 ,添加ImGui
完整代码:https://github.com/DXT00/LearnOpenGL_study/tree/dda2e1477666b16cb0d7e3428f68303450103ff4修改Project名字为BlackPearl --->static lib 作为游戏引擎添加游戏Demo :SandBox调用 BlackPearl添加 Layer层,Sanbox游...
2019-10-12 17:17:33 244
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人