Created
January 21, 2019 04:43
-
-
Save cleak/2dc3b67229f2bbf5e1886ddbda8a3876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SceneObject { | |
public: | |
virtual ~SceneObject() {} | |
virtual void Update() {} | |
virtual void LateUpdate() {} | |
virtual void PhysicsUpdate() {} | |
virtual void DrawImmediate() {} | |
}; | |
struct SceneObject_VTable { | |
void* dtor; | |
UpdateFn* update; | |
UpdateFn* late_update; | |
UpdateFn* physics_update; | |
UpdateFn* draw_immediate; | |
}; | |
SceneObject_VTable* GetVtable(SceneObject* obj) { | |
SceneObject_VTable** vtable_ptr = (SceneObject_VTable**)obj; | |
return *vtable_ptr; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment