allow using custom class for window in application
This commit is contained in:
parent
9b2655beb2
commit
55b19a3834
2 changed files with 5 additions and 5 deletions
|
@ -17,9 +17,9 @@ public:
|
|||
int turn();
|
||||
int run();
|
||||
|
||||
template<class... Args>
|
||||
std::shared_ptr<Window> add_window(Args&&... args) {
|
||||
std::shared_ptr<Window> child = std::make_shared<Window>(std::forward<Args>(args)...);
|
||||
template<typename T, class... Args>
|
||||
std::shared_ptr<T> add_window(Args&&... args) {
|
||||
std::shared_ptr<T> child = std::make_shared<T>(std::forward<Args>(args)...);
|
||||
add_window(child);
|
||||
return child;
|
||||
}
|
||||
|
|
|
@ -23,8 +23,8 @@
|
|||
int main() {
|
||||
Raven::Application application {};
|
||||
|
||||
auto window = application.add_window();
|
||||
auto test_window = application.add_window();
|
||||
auto window = application.add_window<Raven::Window>();
|
||||
auto test_window = application.add_window<Raven::Window>();
|
||||
|
||||
window->spawn_window();
|
||||
test_window->spawn_window();
|
||||
|
|
Loading…
Reference in a new issue