packages feed

dear-imgui-impl-sdl2-1.0.0: cbits/dcimgui_impl_sdl2.cpp

// THIS FILE HAS BEEN AUTO-GENERATED BY THE 'DEAR BINDINGS' GENERATOR.
// **DO NOT EDIT DIRECTLY**
// https://github.com/dearimgui/dear_bindings

#include "imgui.h"
#include "imgui_impl_sdl2.h"

#include <stdio.h>

// Wrap this in a namespace to keep it separate from the C++ API
// This define prevents #defines in the header getting defined again (as they are already in the normal header above),
// and thus generating redefinition warnings
#define DEAR_BINDINGS_INTERNAL_GLUE_CODE
namespace cimgui
{
#include "dcimgui_impl_sdl2.h"
}
#undef DEAR_BINDINGS_INTERNAL_GLUE_CODE

// By-value struct conversions

static inline cimgui::ImVec2 ConvertFromCPP_ImVec2(const ::ImVec2& src)
{
    cimgui::ImVec2 dest;
    dest.x = src.x;
    dest.y = src.y;
    return dest;
}

static inline ::ImVec2 ConvertToCPP_ImVec2(const cimgui::ImVec2& src)
{
    ::ImVec2 dest;
    dest.x = src.x;
    dest.y = src.y;
    return dest;
}

static inline cimgui::ImVec4 ConvertFromCPP_ImVec4(const ::ImVec4& src)
{
    cimgui::ImVec4 dest;
    dest.x = src.x;
    dest.y = src.y;
    dest.z = src.z;
    dest.w = src.w;
    return dest;
}

static inline ::ImVec4 ConvertToCPP_ImVec4(const cimgui::ImVec4& src)
{
    ::ImVec4 dest;
    dest.x = src.x;
    dest.y = src.y;
    dest.z = src.z;
    dest.w = src.w;
    return dest;
}

static inline cimgui::ImTextureRef ConvertFromCPP_ImTextureRef(const ::ImTextureRef& src)
{
    cimgui::ImTextureRef dest;
    dest._TexData = reinterpret_cast<cimgui::ImTextureData*>(src._TexData);
    dest._TexID = src._TexID;
    return dest;
}

static inline ::ImTextureRef ConvertToCPP_ImTextureRef(const cimgui::ImTextureRef& src)
{
    ::ImTextureRef dest;
    dest._TexData = reinterpret_cast<::ImTextureData*>(src._TexData);
    dest._TexID = src._TexID;
    return dest;
}

static inline cimgui::ImColor ConvertFromCPP_ImColor(const ::ImColor& src)
{
    cimgui::ImColor dest;
    dest.Value.x = src.Value.x;
    dest.Value.y = src.Value.y;
    dest.Value.z = src.Value.z;
    dest.Value.w = src.Value.w;
    return dest;
}

static inline ::ImColor ConvertToCPP_ImColor(const cimgui::ImColor& src)
{
    ::ImColor dest;
    dest.Value.x = src.Value.x;
    dest.Value.y = src.Value.y;
    dest.Value.z = src.Value.z;
    dest.Value.w = src.Value.w;
    return dest;
}

// Function stubs

#ifndef IMGUI_DISABLE

CIMGUI_IMPL_API bool cimgui::cImGui_ImplSDL2_InitForOpenGL(cimgui::SDL_Window* window, void* sdl_gl_context)
{
    return ::ImGui_ImplSDL2_InitForOpenGL(reinterpret_cast<::SDL_Window*>(window), sdl_gl_context);
}

CIMGUI_IMPL_API bool cimgui::cImGui_ImplSDL2_InitForVulkan(cimgui::SDL_Window* window)
{
    return ::ImGui_ImplSDL2_InitForVulkan(reinterpret_cast<::SDL_Window*>(window));
}

CIMGUI_IMPL_API bool cimgui::cImGui_ImplSDL2_InitForD3D(cimgui::SDL_Window* window)
{
    return ::ImGui_ImplSDL2_InitForD3D(reinterpret_cast<::SDL_Window*>(window));
}

CIMGUI_IMPL_API bool cimgui::cImGui_ImplSDL2_InitForMetal(cimgui::SDL_Window* window)
{
    return ::ImGui_ImplSDL2_InitForMetal(reinterpret_cast<::SDL_Window*>(window));
}

CIMGUI_IMPL_API bool cimgui::cImGui_ImplSDL2_InitForSDLRenderer(cimgui::SDL_Window* window, cimgui::SDL_Renderer* renderer)
{
    return ::ImGui_ImplSDL2_InitForSDLRenderer(reinterpret_cast<::SDL_Window*>(window), reinterpret_cast<::SDL_Renderer*>(renderer));
}

CIMGUI_IMPL_API bool cimgui::cImGui_ImplSDL2_InitForOther(cimgui::SDL_Window* window)
{
    return ::ImGui_ImplSDL2_InitForOther(reinterpret_cast<::SDL_Window*>(window));
}

CIMGUI_IMPL_API void cimgui::cImGui_ImplSDL2_Shutdown(void)
{
    ::ImGui_ImplSDL2_Shutdown();
}

CIMGUI_IMPL_API void cimgui::cImGui_ImplSDL2_NewFrame(void)
{
    ::ImGui_ImplSDL2_NewFrame();
}

CIMGUI_IMPL_API bool cimgui::cImGui_ImplSDL2_ProcessEvent(const SDL_Event* event)
{
    return ::ImGui_ImplSDL2_ProcessEvent(event);
}

CIMGUI_IMPL_API float cimgui::cImGui_ImplSDL2_GetContentScaleForWindow(cimgui::SDL_Window* window)
{
    return ::ImGui_ImplSDL2_GetContentScaleForWindow(reinterpret_cast<::SDL_Window*>(window));
}

CIMGUI_IMPL_API float cimgui::cImGui_ImplSDL2_GetContentScaleForDisplay(int display_index)
{
    return ::ImGui_ImplSDL2_GetContentScaleForDisplay(display_index);
}

CIMGUI_IMPL_API void cimgui::cImGui_ImplSDL2_SetGamepadMode(cimgui::ImGui_ImplSDL2_GamepadMode mode, cimgui::_SDL_GameController** manual_gamepads_array, int manual_gamepads_count)
{
    ::ImGui_ImplSDL2_SetGamepadMode(static_cast<::ImGui_ImplSDL2_GamepadMode>(mode), reinterpret_cast<struct ::_SDL_GameController**>(manual_gamepads_array), manual_gamepads_count);
}

CIMGUI_IMPL_API void cimgui::cImGui_ImplSDL2_SetMouseCaptureMode(cimgui::ImGui_ImplSDL2_MouseCaptureMode mode)
{
    ::ImGui_ImplSDL2_SetMouseCaptureMode(static_cast<::ImGui_ImplSDL2_MouseCaptureMode>(mode));
}

#endif // #ifndef IMGUI_DISABLE