AlgebraMaster

Modern C++ 创造非凡 . 改变世界

导航

2024年2月2日 #

C++ Runtime Reflection

摘要: 参考: 1. A Flexible Reflection System in C++: Part 1 (preshing.com) 2. C++ Reflection | Austin Brunkhorst 2做的更好。反射的代码是自动生成的。 其实还有个做法,C++ 代码里嵌个pythonVM,天 阅读全文

posted @ 2024-02-02 10:30 gearslogy 阅读(7) 评论(0) 推荐(0) 编辑

2023年8月15日 #

QML NextQT

摘要: 2017 年我写了一篇QML从入门到放弃 如今2023年,过去6年了。QML是我认为真正革命GUI技术 拥抱QML,拥抱声明式GUI. QWidget彻底成为过去式了 1. Property Binding 比如画布有2个盒子AB,A盒子变化大小,B盒子跟着一起干,这个在Qt就直接绑定完事 Rect 阅读全文

posted @ 2023-08-15 15:30 gearslogy 阅读(30) 评论(0) 推荐(0) 编辑

2023年6月19日 #

随手 HDK门格海绵

摘要: 阅读全文

posted @ 2023-06-19 03:56 gearslogy 阅读(48) 评论(0) 推荐(0) 编辑

2023年4月2日 #

clang reflection

摘要: 生成注释 假设有下面的源码: struct Vec3 { float x, y, z; }; struct Vec4 { float x, y, z, w; }; 生成这样的代码: //[[CLASS INFO]] class:Vec3, is pod:true, is aggregate:true 阅读全文

posted @ 2023-04-02 10:01 gearslogy 阅读(95) 评论(0) 推荐(0) 编辑

2023年3月13日 #

Master LLVM GEP

摘要: 主要参考<< LLVM Essentials>> 结果发现这书内容太老了,无法编译。 然后某种情况下写对了,各种崩溃。 丝滑解决: 1. 先从C来看起来 如果一个函数参数是指针意味着下面: #include <iostream> struct Foo{ int f{0}; }; void acces 阅读全文

posted @ 2023-03-13 00:28 gearslogy 阅读(224) 评论(0) 推荐(0) 编辑

2023年2月12日 #

类型擦除TypeErase

摘要: 来自CppCON2022 通过极其简单的方法实现: 头文件: #pragma once #include <iostream> #include <memory> #include <vector> struct CommandConcept { virtual ~CommandConcept() 阅读全文

posted @ 2023-02-12 22:53 gearslogy 阅读(39) 评论(0) 推荐(0) 编辑

2022年12月26日 #

Qt问题记录

摘要: 1. Q_OBJECT 对std::unique_ptr<A>的前置声明不支持。 需要完整的A type 2. Q_OBJECT不支持C++20 module 3. hpp 如果没有.cpp 编译不支持Q_OBJECT 如下:vmenu.h class PCG_VNodeContextMenu : 阅读全文

posted @ 2022-12-26 14:56 gearslogy 阅读(37) 评论(0) 推荐(0) 编辑

2022年12月11日 #

现代CPP设计模式

摘要: 所有的都是实验品,也有可能是用来对原作者的表达的另一种见解(反驳)。 开闭原则(参考Design pattern in Modern C++ 20): 我的方案吊打原书。面向对象有时候效率极其低下(当然这里只单纯针对filter,如果工程另外一回事)。下面强迫转换成指针为了保证跟原书那个操作一样,f 阅读全文

posted @ 2022-12-11 03:11 gearslogy 阅读(191) 评论(0) 推荐(0) 编辑

2022年11月23日 #

CPP2nd CRTP Facade 模式

摘要: 书中源码不全,看看我这个? #include <iostream> #include <type_traits> #include <vector> #include <iterator> template<typename Derived, typename Value, typename Cat 阅读全文

posted @ 2022-11-23 04:12 gearslogy 阅读(44) 评论(0) 推荐(0) 编辑

2022年10月27日 #

billboard暴力实现

摘要: 也就游戏用这种垃圾技术。(主要我还玩不好这个....) 实现billboard时候,用到了maps_baker节点。 这节点有2大傻逼问题 1,不支持采样(19是通过升分辨率,然后再降),主要在cop做一套这玩意还确实麻烦 2,不支持diffuse透贴alpha 解决2的问题: Diffuse节点里 阅读全文

posted @ 2022-10-27 16:39 gearslogy 阅读(62) 评论(0) 推荐(0) 编辑