Code Monkey home page Code Monkey logo

cmakesdl2cimgui's Introduction

cmakesdl2cimgui

Packages:

Information:

This was tested in window 10 64 bit build. This for imgui that is coded in c lanuage test build with cmake. It is branch off from https://github.com/ocornut/imgui to https://github.com/cimgui/cimgui that worked on to 1.82 version.

Build:

Install CMake and chose of build tool compiler. Note that opengl required other packages depend on the operating system.

The next part is tricky. Is to chose which opengl package to used. GL3W, GLEW, GLAD and GLAD2.

#CMakeLists.txt
add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GL3W=0) # imgui_impl_opengl3.h # imgui Default to GL3W embedded in our repository
#add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GLEW=0)
#add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GLAD=0)
#add_definitions(-DIMGUI_IMPL_OPENGL_LOADER_GLAD2=0)

You need to comment them out but one must be uncomment to used opengl.

#CMakeLists.txt
set(ENABLE_GL3W ON) # works #default from imgui
set(ENABLE_GLEW OFF) # work
set(ENABLE_GLAD OFF) # work
set(ENABLE_GLAD2 OFF) # work

As well for this settings.

Once that is done. But note that gl3w to build files with python 3.9.4.

Command Line:

mkdir build
cd build
cmake ..
cmake --build .

Please note that currently set to window and it not config for other platform.

Note:

  • The CMakeList.txt will download the SDL 2.0 files from github and other add ons for easy to access. As well auto build the dlls, include, src and other setting on CMakeLists.txt.
  • If on window and with firewall or security that will block compile build commands.
if (NOT freetype_FOUND)
...
add_library(Freetype::Freetype ALIAS freetype)
...
endif()

add_library(SDL2::SDL2 ALIAS SDL2) # required to set for window
add_library(SDL2::SDL2-static ALIAS SDL2-static)

Dev Notes:

Download first time. Then set not to recheck when connect to internet or recompile. This will speed things up.

# https://bewagner.net/programming/2020/05/02/cmake-fetchcontent/
#set(FETCHCONTENT_FULLY_DISCONNECTED ON) # When this option is enabled, no attempt is made to download or update any content.
set(FETCHCONTENT_UPDATES_DISCONNECTED ON) # Skip Update
//some code will error on main
#include <SDL.h>
#define main SDL_main
#undef main

c in vulkan:

Not much src or example files for c language setup. There are few but it take time to look at how it works. From vulkan, sdl and other yet look into yet. There one example file each but it a lot in one file.

Credits:

cmakesdl2cimgui's People

Contributors

lightnet avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.