|
| 1 | +/* |
| 2 | +** Command & Conquer Generals Zero Hour(tm) |
| 3 | +** Copyright 2025 Electronic Arts Inc. |
| 4 | +** |
| 5 | +** This program is free software: you can redistribute it and/or modify |
| 6 | +** it under the terms of the GNU General Public License as published by |
| 7 | +** the Free Software Foundation, either version 3 of the License, or |
| 8 | +** (at your option) any later version. |
| 9 | +** |
| 10 | +** This program is distributed in the hope that it will be useful, |
| 11 | +** but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | +** GNU General Public License for more details. |
| 14 | +** |
| 15 | +** You should have received a copy of the GNU General Public License |
| 16 | +** along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | +*/ |
| 18 | + |
| 19 | +// TheSuperHackers @refactor bobtista 10/04/2026 Backend-agnostic access point |
| 20 | +// for the global IRenderBackend instance. Engine-side code should include |
| 21 | +// this header (not IRenderBackend.h or DX8Backend.h directly) to use the |
| 22 | +// render backend. See RENDER_BACKEND.md. |
| 23 | + |
| 24 | +#pragma once |
| 25 | + |
| 26 | +#include "IRenderBackend.h" |
| 27 | + |
| 28 | +// The active rendering backend. Set by Init_Render_Backend() during |
| 29 | +// WW3D device initialization and cleared by Shutdown_Render_Backend() |
| 30 | +// during device teardown. Never null between those two calls. |
| 31 | +extern IRenderBackend * g_renderBackend; |
| 32 | + |
| 33 | +// Create the render backend. Called by DX8Wrapper::Do_Onetime_Device_Dependent_Inits |
| 34 | +// after the D3D device has been successfully created. |
| 35 | +// |
| 36 | +// Phase 1 always creates a DX8Backend. Phase 2 will add a compile-time |
| 37 | +// option to select between DX8Backend, BgfxBackend, and DiligentBackend. |
| 38 | +void Init_Render_Backend(); |
| 39 | + |
| 40 | +// Destroy the render backend. Called by DX8Wrapper::Do_Onetime_Device_Dependent_Shutdowns |
| 41 | +// before the D3D device is released. |
| 42 | +void Shutdown_Render_Backend(); |
0 commit comments