zengine-old/engine/3rdparty/zlib/test/refl/vertex.h
2024-04-25 21:45:41 +08:00

54 lines
1.1 KiB
C++

#include <iostream>
#include "refl/refl.h"
using namespace std;
using namespace refl;
struct vec3_parent {
virtual int norm(int x1, int& x2) {
x2 = x1 * x2;
return x2;
//cout << x2 << "vec3_parent::norm" << endl;
}
};
struct vec4 {
string name{ "hello" };
};
struct vec3_Meta;
struct vec3 : public vec3_parent {
using MyMeta = vec3_Meta;
__cppast(Meta = { 0.f})
float x = 1;
__cppast(Meta = { 0.f})
float y = 2;
__cppast(Meta = { 0.f})
float z = 3;
__cppast(Meta = { "hello meta"})
string name = "???";
__cppast(Meta = { {3,4} })
int norm(int x1, int& x2)override {
int tmp = x1 * 2 + 1;
x1 = x2;
x2 = tmp;
return x2;
//cout << x2 << "vec3::norm" << endl;
}
__cppast(Meta = {})
virtual float norm1(int& x1) {
x1 = x1 * x * y * z;
x = x1;
y = x1 - 1;
//z = x1 - 10;
//cout << x1 << "::norm1" << endl;
return x1;
}
__cppast(Meta = {})
static void norm2(int x1 = 10) {
cout << x1 << "::norm2" << endl;
}
__cppast(Meta = {})
static void norm3(int x1 = 10) {
x1 = x1 * 10;
cout << x1 << "::norm3" << endl;
}
};
#include "meta_vertex_gen.inl"