Files
test/source/blender/draw/engines/select/select_engine.hh
Clément Foucault 92968c23fe Refactor: DRW: Make DrawEngine a virtual class
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
2025-03-17 10:31:22 +01:00

53 lines
1.0 KiB
C++

/* SPDX-FileCopyrightText: 2019 Blender Authors
*
* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup draw_engine
*/
#pragma once
#include "DRW_render.hh"
/* `select_engine.cc` */
#ifdef WITH_DRAW_DEBUG
/* `select_debug_engine.cc` */
namespace blender::draw::edit_select_debug {
struct Engine : public DrawEngine::Pointer {
DrawEngine *create_instance() final;
static void free_static();
};
} // namespace blender::draw::edit_select_debug
#endif
struct SELECTID_Context *DRW_select_engine_context_get();
struct GPUFrameBuffer *DRW_engine_select_framebuffer_get();
struct GPUTexture *DRW_engine_select_texture_get();
/* select_instance.cc */
namespace blender::draw::select {
struct Engine : public DrawEngine::Pointer {
DrawEngine *create_instance() final;
};
} // namespace blender::draw::select
namespace blender::draw::edit_select {
struct Engine : public DrawEngine::Pointer {
DrawEngine *create_instance() final;
static void free_static();
};
} // namespace blender::draw::edit_select