OXYGENHUB
# 9120e87480a6 enhanced-x16-emulator / src / extern / imgui / backends / imgui_impl_sdlrenderer2.h
2.6 KiB · Objective-C · last changed chore(): initial commit 26 days ago source blame history raw
9120e874 Andy McCall 1
// dear imgui: Renderer Backend for SDL_Renderer for SDL2
2
// (Requires: SDL 2.0.17+)
3
4
// Note how SDL_Renderer is an _optional_ component of SDL2.
5
// For a multi-platform app consider using e.g. SDL+DirectX on Windows and SDL+OpenGL on Linux/OSX.
6
// If your application will want to render any non trivial amount of graphics other than UI,
7
// please be aware that SDL_Renderer currently offers a limited graphic API to the end-user and
8
// it might be difficult to step out of those boundaries.
9
10
// Implemented features:
11
//  [X] Renderer: User texture binding. Use 'SDL_Texture*' as ImTextureID. Read the FAQ about ImTextureID!
12
//  [X] Renderer: Large meshes support (64k+ vertices) with 16-bit indices.
13
//  [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'.
14
// Missing features:
15
//  [ ] Renderer: Multi-viewport support (multiple windows).
16
17
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
18
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
19
// Learn about Dear ImGui:
20
// - FAQ                  https://dearimgui.com/faq
21
// - Getting Started      https://dearimgui.com/getting-started
22
// - Documentation        https://dearimgui.com/docs (same as your local docs/ folder).
23
// - Introduction, links and more at the top of imgui.cpp
24
25
#pragma once
26
#ifndef IMGUI_DISABLE
27
#include "imgui.h"      // IMGUI_IMPL_API
28
29
struct SDL_Renderer;
30
31
// Follow "Getting Started" link and check examples/ folder to learn about using backends!
32
IMGUI_IMPL_API bool     ImGui_ImplSDLRenderer2_Init(SDL_Renderer* renderer);
33
IMGUI_IMPL_API void     ImGui_ImplSDLRenderer2_Shutdown();
34
IMGUI_IMPL_API void     ImGui_ImplSDLRenderer2_NewFrame();
35
IMGUI_IMPL_API void     ImGui_ImplSDLRenderer2_RenderDrawData(ImDrawData* draw_data, SDL_Renderer* renderer);
36
37
// Called by Init/NewFrame/Shutdown
38
IMGUI_IMPL_API bool     ImGui_ImplSDLRenderer2_CreateFontsTexture();
39
IMGUI_IMPL_API void     ImGui_ImplSDLRenderer2_DestroyFontsTexture();
40
IMGUI_IMPL_API bool     ImGui_ImplSDLRenderer2_CreateDeviceObjects();
41
IMGUI_IMPL_API void     ImGui_ImplSDLRenderer2_DestroyDeviceObjects();
42
43
// [BETA] Selected render state data shared with callbacks.
44
// This is temporarily stored in GetPlatformIO().Renderer_RenderState during the ImGui_ImplSDLRenderer2_RenderDrawData() call.
45
// (Please open an issue if you feel you need access to more data)
46
struct ImGui_ImplSDLRenderer2_RenderState
47
{
48
    SDL_Renderer*       Renderer;
49
};
50
51
#endif // #ifndef IMGUI_DISABLE