This removes the old `DrawEngineType` and use the new `DrawEngine` virtual class instead. This removes a lot of boilerplate functions that were only there for legacy reason. To this end, some engines that were based on static functions have been refactored into `Instance` classes. This was particularly cumbersome for the Grease pencil engine which needed some more refactoring. The `Engine` class that is in each namespace is a workaround to isolate the internal implementation (i.e. the `Instance`) to the engine modules. Without this, the whole engine is getting included in each compile unit that includes the `Instance` class. Eventually, if we get rid of these intricate dependencies, we could remove the `Engine` class. Pull Request: https://projects.blender.org/blender/blender/pulls/136001
29 lines
525 B
C++
29 lines
525 B
C++
/* SPDX-FileCopyrightText: 2023 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/** \file
|
|
* \ingroup select
|
|
*/
|
|
|
|
#include "DRW_render.hh"
|
|
|
|
#include "select_engine.hh"
|
|
|
|
#include "../overlay/overlay_next_instance.hh"
|
|
#include "select_instance.hh"
|
|
|
|
namespace blender::draw::select {
|
|
|
|
class Instance : public overlay::Instance {
|
|
public:
|
|
Instance() : overlay::Instance(SelectionType::ENABLED){};
|
|
};
|
|
|
|
DrawEngine *Engine::create_instance()
|
|
{
|
|
return new Instance();
|
|
}
|
|
|
|
} // namespace blender::draw::select
|