All Projects → mnmly → Swift-imgui

mnmly / Swift-imgui

Licence: other
Dear ImGui Swift Wrapper API for macOS and iOS

Programming Languages

swift
15916 projects
Objective-C++
1391 projects
c
50402 projects - #5 most used programming language
objective c
16641 projects - #2 most used programming language
C++
36643 projects - #6 most used programming language

Labels

Projects that are alternatives of or similar to Swift-imgui

ButOSX
CSGO Cheat Base for MacOSX. Written in C++ & Objective C. Menu Powered by ImGui. Includes Apple TouchBar API.
Stars: ✭ 58 (-1.69%)
Mutual labels:  imgui
ImGui Widgets
my imgui widgets/skin including custom UI on openFrameworks
Stars: ✭ 24 (-59.32%)
Mutual labels:  imgui
GLGame
A Tiny 2D OpenGL based C++ Game Engine that is fast, lightweight and comes with a level editor.
Stars: ✭ 49 (-16.95%)
Mutual labels:  imgui
s7-imgui
Using s7 scheme alongside Dear ImGui to (interactively) build (cross platform) GUI apps.
Stars: ✭ 29 (-50.85%)
Mutual labels:  imgui
RCCpp-DearImGui-GLFW-example
Add Runtime Compiled C++ to the Dear ImGui example using the GLFW and OpenGL backend - with power saving
Stars: ✭ 61 (+3.39%)
Mutual labels:  imgui
nuklear4j
Java binding for nuklear
Stars: ✭ 61 (+3.39%)
Mutual labels:  imgui
ParsecSoda
Parsec Soda is a custom open-source game streaming app that integrates with Parsec API and is focused in Host experience.
Stars: ✭ 135 (+128.81%)
Mutual labels:  imgui
BezierCurves2D
An implementation of 2D Bezier Curves in C++ using OpenGL, gl3w, glfw3 and imgui.
Stars: ✭ 41 (-30.51%)
Mutual labels:  imgui
LiteGui
Immediate Mode GUI From Scratch
Stars: ✭ 15 (-74.58%)
Mutual labels:  imgui
hlimgui
No description or website provided.
Stars: ✭ 28 (-52.54%)
Mutual labels:  imgui
imgui-rs-vulkan-renderer
A Vulkan renderer for imgui-rs using Ash
Stars: ✭ 44 (-25.42%)
Mutual labels:  imgui
ebiten-imgui
Dear ImGui renderer for Ebitengine
Stars: ✭ 82 (+38.98%)
Mutual labels:  imgui
HalfPayne
No description or website provided.
Stars: ✭ 33 (-44.07%)
Mutual labels:  imgui
imgui entt entity editor
A drop-in entity editor for EnTT with Dear ImGui
Stars: ✭ 146 (+147.46%)
Mutual labels:  imgui
imgui-flame-graph
A Dear ImGui Widget for displaying Flame Graphs.
Stars: ✭ 93 (+57.63%)
Mutual labels:  imgui
wave-gui
Yet another data-over-sound tool
Stars: ✭ 64 (+8.47%)
Mutual labels:  imgui
surface splatting
OpenGL demo of a point rendering and texture filtering technique called Surface Splatting.
Stars: ✭ 125 (+111.86%)
Mutual labels:  imgui
CSMoE
NO MORE OFFLINE UPDATES
Stars: ✭ 150 (+154.24%)
Mutual labels:  imgui
tnt
A 2d Game Engine written in C++20.
Stars: ✭ 30 (-49.15%)
Mutual labels:  imgui
uimgui
UImGui (Unity ImGui) is an UPM package for the immediate mode GUI library using ImGui.NET. This project is based on RG.ImGui project.
Stars: ✭ 143 (+142.37%)
Mutual labels:  imgui

Swift-imgui

Personal WIP

Immediate mode GUI Library from Omar Cornut wrapped for use with Swift, inspired from Cinder-ImGui

Installation with Carthage

Add following to Cartfile:

github "mnmly/Swift-imgui" "master"

Then follow the standard carthage installation process.

Usage

import UIKit
import ImGui

class ViewController: UIViewController {
    
    var myView: UIView = UIView(frame: CGRect(x: 0, y: 0, width: 20, height: 20))
    var viewOffset: CGPoint = CGPoint.zero
    
    override func viewDidLoad() {
        
        super.viewDidLoad()
        
        myView.backgroundColor = UIColor(hue:0.592, saturation:0.904, brightness:0.980, alpha:1.000)
        
        myView.center = view.center
        
        view.addSubview(myView)
        
        // Initialize with Metal Graphics API for drawing
        ImGui.initialize(.metal)
        
        if let vc = ImGui.vc {
            // Add viewController and view to scene
            addChildViewController(vc)
            view.addSubview(vc.view)
            vc.view.frame = CGRect(x: 0, y: view.frame.height * 0.7, width: view.frame.width, height: view.frame.height * 0.3)
        }
        
        ImGui.draw { (imgui) in
            
            // Setting Window Position and window size
            imgui.setNextWindowPos(CGPoint.zero, cond: .always)
            imgui.setNextWindowSize(self.view.frame.size)

            imgui.begin("Hello ImGui on Swift")

            // Setting the font scale
            imgui.setWindowFontScale(UIScreen.main.scale)
            
            
            // When button is clicked...
            if imgui.button("rotate me") {
                // rotate me
                self.myView.transform = CGAffineTransform.identity
                UIViewPropertyAnimator(duration: 1.0, dampingRatio: 0.9, animations: {
                    self.myView.transform = CGAffineTransform.init(rotationAngle: 180.0)
                }).startAnimation()
            }
            
            imgui.sliderFloat("cornerRadius", v: &self.myView.layer.cornerRadius, minV: 0.0, maxV: 10.0)
            imgui.sliderFloat2("offset", v: &self.viewOffset, minV: -100.0, maxV: 100.0)
            imgui.sliderFloat2("size", v: &self.myView.bounds.size, minV: 5.0, maxV: 100.0)
            imgui.colorEdit("backgroundColor", color: &(self.myView.backgroundColor)!)
            imgui.end()
            
            var center = self.view.center
            center.x += self.viewOffset.x
            center.y += self.viewOffset.y
            self.myView.center = center
        }
    }
}

Todo

  • Keyboard Events on iOS
  • Exposing more API to Swift

ImGui Credits (from ImGui README)


(ImGui is free but Omar needs your support to sustain development and maintenance. If you work for a company, please consider financial support)

Patreon PayPal

ImGui is a bloat-free graphical user interface library for C++. It outputs vertex buffers that you can render in your 3D-pipeline enabled application. It is portable, renderer agnostic and self-contained (no external dependencies). It is based on an "immediate mode" graphical user interface paradigm which enables you to build user interfaces with ease.

ImGui is designed to enable fast iteration and empower programmers to create content creation tools and visualization/debug tools (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal, and thus lacks certain features normally found in more high-level libraries.

ImGui is particularly suited to integration in realtime 3D applications, fullscreen applications, embedded applications, games, or any applications on consoles platforms where operating system features are non-standard.


Developed by Omar Cornut and every direct or indirect contributors to the GitHub. The early version of this library was developed with the support of Media Molecule and first used internally on the game Tearaway.

I first discovered imgui principles at Q-Games where Atman had dropped his own simple imgui implementation in the codebase, which I spent quite some time improving and thinking about. It turned out that Atman was exposed to the concept directly by working with Casey. When I moved to Media Molecule I rewrote a new library trying to overcome the flaws and limitations of the first one I've worked with. It became this library and since then I have spent an unreasonable amount of time iterating on it.

Embeds ProggyClean.ttf font by Tristan Grimmer (MIT license).

Embeds stb_textedit.h, stb_truetype.h, stb_rectpack.h by Sean Barrett (public domain).

Inspiration, feedback, and testing for early versions: Casey Muratori, Atman Binstock, Mikko Mononen, Emmanuel Briney, Stefan Kamoda, Anton Mikhailov, Matt Willis. And everybody posting feedback, questions and patches on the GitHub.

Ongoing ImGui development is financially supported on Patreon.

Double-chocolate sponsors:

  • Media Molecule
  • Mobigame
  • Insomniac Games (sponsored the gamepad/keyboard navigation branch)
  • Aras Pranckevičius

Salty caramel supporters:

  • Jetha Chan, Wild Sheep Studio, Pastagames, Mārtiņš Možeiko, Daniel Collin, Recognition Robotics, Chris Genova, ikrima, Glenn Fiedler, Geoffrey Evans, Dakko Dakko.

Caramel supporters:

  • Michel Courtine, César Leblic, Dale Kim, Alex Evans, Rui Figueira, Paul Patrashcu, Jerome Lanquetot, Ctrl Alt Ninja, Paul Fleming, Neil Henning, Stephan Dilly, Neil Blakey-Milner, Aleksei, NeiloGD, Justin Paver, FiniteSol, Vincent Pancaldi, James Billot, Robin Hübner, furrtek, Eric, Simon Barratt, Game Atelier, Julian Bosch, Simon Lundmark, Vincent Hamm, Farhan Wali, Jeff Roberts, Matt Reyer, Colin Riley, Victor Martins, Josh Simmons, Garrett Hoofman, Sergio Gonzales, Andrew Berridge, Roy Eltham, Game Preservation Society, Kit framework, Josh Faust, Martin Donlon, Quinton, Felix.

And other supporters; thanks!

License

Dear ImGui is licensed under the MIT License, see LICENSE for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].