Elaztek Developer Hub
Blamite Game Engine - blam!  00398.09.22.23.2015.blamite
The core library for the Blamite Game Engine.
imgui_impl_sdl.cpp File Reference
#include "../imgui.h"
#include "imgui_impl_sdl.h"
#include <sdl2/SDL.h>
#include <sdl2/SDL_syswm.h>
+ Include dependency graph for imgui_impl_sdl.cpp:

Macros

#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE   SDL_VERSION_ATLEAST(2,0,4)
 
#define SDL_HAS_VULKAN   SDL_VERSION_ATLEAST(2,0,6)
 
#define MAP_BUTTON(NAV_NO, BUTTON_NO)   { io.NavInputs[NAV_NO] = (SDL_GameControllerGetButton(game_controller, BUTTON_NO) != 0) ? 1.0f : 0.0f; }
 
#define MAP_ANALOG(NAV_NO, AXIS_NO, V0, V1)   { float vn = (float)(SDL_GameControllerGetAxis(game_controller, AXIS_NO) - V0) / (float)(V1 - V0); if (vn > 1.0f) vn = 1.0f; if (vn > 0.0f && io.NavInputs[NAV_NO] < vn) io.NavInputs[NAV_NO] = vn; }
 

Functions

bool ImGui_ImplSDL2_ProcessEvent (const SDL_Event *event)
 
bool ImGui_ImplSDL2_InitForOpenGL (SDL_Window *window, void *sdl_gl_context)
 
bool ImGui_ImplSDL2_InitForVulkan (SDL_Window *window)
 
bool ImGui_ImplSDL2_InitForD3D (SDL_Window *window)
 
bool ImGui_ImplSDL2_InitForMetal (SDL_Window *window)
 
void ImGui_ImplSDL2_Shutdown ()
 
void ImGui_ImplSDL2_NewFrame (SDL_Window *window)
 
void ImGui_ImplSDL2_SetActiveWindowOverride (bool override_state)
 Special function used to override active window checks. More...
 

Macro Definition Documentation

◆ MAP_ANALOG

#define MAP_ANALOG (   NAV_NO,
  AXIS_NO,
  V0,
  V1 
)    { float vn = (float)(SDL_GameControllerGetAxis(game_controller, AXIS_NO) - V0) / (float)(V1 - V0); if (vn > 1.0f) vn = 1.0f; if (vn > 0.0f && io.NavInputs[NAV_NO] < vn) io.NavInputs[NAV_NO] = vn; }

◆ MAP_BUTTON

#define MAP_BUTTON (   NAV_NO,
  BUTTON_NO 
)    { io.NavInputs[NAV_NO] = (SDL_GameControllerGetButton(game_controller, BUTTON_NO) != 0) ? 1.0f : 0.0f; }

◆ SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE

#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE   SDL_VERSION_ATLEAST(2,0,4)

◆ SDL_HAS_VULKAN

#define SDL_HAS_VULKAN   SDL_VERSION_ATLEAST(2,0,6)

Function Documentation

◆ ImGui_ImplSDL2_InitForD3D()

bool ImGui_ImplSDL2_InitForD3D ( SDL_Window *  window)
+ Here is the caller graph for this function:

◆ ImGui_ImplSDL2_InitForMetal()

bool ImGui_ImplSDL2_InitForMetal ( SDL_Window *  window)

◆ ImGui_ImplSDL2_InitForOpenGL()

bool ImGui_ImplSDL2_InitForOpenGL ( SDL_Window *  window,
void *  sdl_gl_context 
)
+ Here is the caller graph for this function:

◆ ImGui_ImplSDL2_InitForVulkan()

bool ImGui_ImplSDL2_InitForVulkan ( SDL_Window *  window)

◆ ImGui_ImplSDL2_NewFrame()

void ImGui_ImplSDL2_NewFrame ( SDL_Window *  window)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ImGui_ImplSDL2_ProcessEvent()

bool ImGui_ImplSDL2_ProcessEvent ( const SDL_Event event)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ImGui_ImplSDL2_SetActiveWindowOverride()

void ImGui_ImplSDL2_SetActiveWindowOverride ( bool  override_state)

Special function used to override active window checks.

When the engine is hooked using Qt (aka, when the engine is rendering to a viewport in the editing kit), SDL simply refuses to set the active window state - and there is no way to override this using SDL alone.

The solution implemented is to add an optional override check that can be called when using Qt. When this is set to true, ImGUI will always behave as though the window is focused - which may or may not cause issues. It is best to keep this state consistent with the focused state of the Qt5 widget itself.

Parameters
override_state- Whether or not to behave as though the engine viewport is focused.
+ Here is the caller graph for this function:

◆ ImGui_ImplSDL2_Shutdown()

void ImGui_ImplSDL2_Shutdown ( )
+ Here is the caller graph for this function: