/sdl3_imgui_vulkan_lua

Sample project for using the imgui to lua scripting ui for quick easy build. SDL3 and Vulkan.

Primary LanguageC++

sdl3_imgui_vulkan_lua

License: MIT

Status:

  • work in progress.

Packages:

  • sdl 3.2.22
  • KhronosGroup/Vulkan-Headers
  • KhronosGroup/Vulkan-Loader
  • imgui 1.92
  • lua 5.4.8

Notes:

  • There are other packages are needed to install depend on the OS.

Goal:

Convert imgui c++ to lua for easy create widgets. As for later use for other project.

Information:

This is c++ project to use CMake build. For SDL, imgui, vulkan and lua script.

Using the lua script to build imgui widgets. The reason is not hard code imgui in c++ but in lua for easy access and change. Well be hard code back once refine UI.

This project use github repo to build this project for easy compile.

CMake:

Use msys64 windows 64 bit.

Using the SDL as base for easy cross platform inputs and others. As for the gpu is vullkan. But use vulkan header and vulkan loader to build vulkan for better update.

Lua Features:

  • Variable Flags
    • work in progress

window:

  • Begin
  • End
  • GetWindowHeight
  • GetWindowWidth
  • window child

widgets:

  • Text
  • Button
  • InputText
  • InputTextMultiline
  • SliderFloat
  • Checkbox
  • RadioButton
  • ColorEdit3
  • ProgressBar
  • Combo
  • ListBox
  • TreeNode
  • TreePop
  • BeginTabBar
  • EndTabBar
  • BeginTabItem
  • EndTabItem
  • BeginTooltip
  • EndTooltip
  • SetTooltip
  • plotlines
  • histogram
  • image (does not have load file yet)
  • image button (does not have load file yet)
  • vertical slider
  • bullet point
  • TextColored

lua api

  • [ ]

layout:

  • SameLine
  • Separator
  • Spacing
  • table
  • colums

events

  • IsItemHovered
  • IsItemActive
  • IsItemClicked

menu:

  • BeginMenuBar
  • EndMenuBar
  • BeginMenu
  • EndMenu
  • MenuItem
  • BeginMainMenuBar

theme

  • light theme
  • dark theme
  • StyleCustom (easy access not party of imgui)
  • GetStyleColor (easy access not party of imgui)
  • custom theme
    • ImGuiCol_name (testing)

vulkan:

  • image load texture.
  • image unload texture (not working real time) Simple image test.

Notes:

  • current basic widgets
  • configs flags not work on.

imgui lua:

The design will be simple to match function but need to translate to c++ to lua which work differently. Still work the same some degree but to lua to c++ will take some time to translate correctly.

Using the lua script to create imgui widgets is easy without need to compile all and save time depend on the project.

flags:

Note this is work in progress test.

local bit = require("bit32")
local flags = bit.bor(ImGui.ImGuiComboFlags_PopupAlignLeft, ImGui.ImGuiComboFlags_HeightSmall)

Credits: