• Stars
    star
    16
  • Rank 1,311,288 (Top 26 %)
  • Language
    Crystal
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Crystal bindings to ImGui-SFML

crystal-imgui-sfml

Crystal bindings to ImGui-SFML

Introduction

This library makes it straightforward to
Β  use Dear ImGui (through its crystal-imgui binding)
Β  with SFML (through its CrSFML binding).

See the example.

crystal-imgui-sfml does not attempt to serve as a wrapper for all of these, rather it's just the "glue",
and so both crystal-imgui and CrSFML will still be explicit dependencies of your project.

That said, crystal-imgui-sfml does take over some parts of the installation process from crystal-imgui.

Documentation

Installation

First, install SFML.

Then add to your project's shard.yml file:

dependencies:
  crsfml:
    github: oprypin/crsfml
  imgui:
    github: oprypin/crystal-imgui
  imgui-sfml:
    github: oprypin/crystal-imgui-sfml

Resolve dependencies with Shards:

shards install

During installation this will invoke make to build the C++ wrappers as object files. SFML headers are expected to be available in the default include path.

Building a project

Try the example from inside the folder of crystal-imgui-sfml:

crystal build examples/simple.cr

Although building the example automatically added the libcimgui.so library (bundled with the project) to the search path, running it will require that addition to be done manually:

export LD_LIBRARY_PATH="$(pwd)"
./example

For your own project, crystal-imgui-sfml will be in a subdirectory, so adjust this accordingly:

export LD_LIBRARY_PATH="$(pwd)/lib/imgui-sfml"
printf 'require "crsfml"\nrequire "imgui"\nrequire "imgui-sfml"\n' >> my_project.cr
crystal run my_project.cr

Custom SFML location

If SFML's headers and libraries are not in a path where the compiler would look by default, additional steps are needed.

Before building the extensions (make) you need to configure the include path:

export CXXFLAGS="-I/full/path/to/sfml/include"
export LIBRARY_PATH="/full/path/to/sfml/lib"
make

More details at CrSFML

crystal-imgui-sfml without Shards

It's also possible to use crystal-imgui-sfml outside of Shards, as with any library. One option is to directly create a symbolic link to crystal-imgui-sfml in your project's lib folder.

mkdir lib
ln -s /full/path/to/crsfml lib/crsfml
ln -s /full/path/to/crystal-imgui lib/imgui
ln -s /full/path/to/crystal-imgui-sfml lib/imgui-sfml

Note, though, that the C bindings inside the crystal-imgui-sfml directory must be additionally built using make.

Credits

crystal-imgui-sfml was made by Oleh Prypin. It uses and is based on ImGui-SFML.

crystal-imgui-sfml is licensed under the terms and conditions of the MIT license.

More Repositories

1

nightly.link

Downloads the latest "nightly" build/artifact from a continuous testing workflow
Crystal
603
star
2

crsfml

Crystal bindings to SFML multimedia/game library
Crystal
341
star
3

mkdocs-gen-files

MkDocs plugin to programmatically generate documentation pages during the build
Python
82
star
4

nim-csfml

Nim bindings to SFML multimedia/game library
Nim
81
star
5

mkdocs-section-index

MkDocs plugin to allow clickable sections that lead to an index page
Python
68
star
6

mkdocs-literate-nav

MkDocs plugin to specify the navigation in Markdown instead of YAML
Python
67
star
7

sixcells

Level editor for Hexcells
Python
66
star
8

nim-random

Random number generation library for Nim
Nim
65
star
9

crystal-imgui

Crystal bindings to Dear ImGui
Crystal
64
star
10

crsfml-examples

Simple games made with CrSFML
Crystal
54
star
11

crystal-chipmunk

Crystal bindings to Chipmunk, a fast and lightweight 2D game physics library
Crystal
42
star
12

mkdocs-same-dir

MkDocs plugin to allow placing mkdocs.yml in the same directory as documentation
Python
33
star
13

find-latest-tag

GitHub Action: Find the latest tag in a GitHub repository
JavaScript
32
star
14

pytest-golden

Plugin for pytest that offloads expected outputs to data files
Python
22
star
15

markdown-callouts

Markdown extension: a classier syntax for admonitions
Python
20
star
16

critter

Chat bot relaying messages between IRC and Gitter
Crystal
16
star
17

crystalize.py

Generator of Crystal lib definitions
Python
12
star
18

nim-chipmunk

Nim bindings to Chipmunk, a fast and lightweight 2D game physics library
Nim
12
star
19

crystal-dbus

Crystal bindings to D-Bus
Crystal
12
star
20

crystal-raw-gl

Crystal bindings to OpenGL and GLU
Crystal
9
star
21

crystal-fuzzing

Fuzzing for Crystal programming language
Crystal
7
star
22

game-bots

Automatic solvers/clickers for puzzle video games
Crystal
5
star
23

nimception

Templating language for Nim that uses Nim syntax and can be evaluated entirely at compile time
Nim
4
star
24

userscripts

A collection of JavaScript browser extensions
LiveScript
3
star
25

slre

Super Light Regular Expression library (clone of the last MIT-licensed version)
C
3
star
26

spec-assert

Assert macro for Crystal that lets you write specs naturally without a special expectation DSL
Crystal
3
star
27

steam-notifier

System tray icon application that shows notifications from Steam Community
Python
2
star
28

oprypin

2
star
29

crystal-raw-chipmunk

Crystal bindings for Chipmunk, a fast and lightweight 2D game physics library
Crystal
2
star
30

reenable-gha

Automatically re-enable GitHub Actions scheduled workflows
Python
2
star
31

crsfml-mkdocstrings

HTML
1
star
32

python-csfml

Python bindings for SFML (using CFFI and CSFML)
Python
1
star
33

egobooster

Search GitHub for new usages of your projects
Python
1
star
34

swtg-map

Tools to create a world map of Super Win the Game
Python
1
star
35

gitbook-plugin-ungrey

Make chapters without an index page clickable instead of grey/disabled
JavaScript
1
star
36

install-sfml

GitHub Action: Install Simple and Fast Multimedia Library
JavaScript
1
star
37

mkdocs-code-validator

Checks Markdown code blocks in a MkDocs site against user-defined actions
Python
1
star
38

py-project-template

Jinja
1
star