CogDemoImgui - Cabinet of Games

Goals

CogDemoImgui is a starting base point for a 3D graphics program.

Live Demo (Updated 05/08/2021)

http://www.parzall.com/cogdemo/CogDemoImgui.html

Source Code (Updated 05/08/2021)

http://www.parzall.com/cogdemo/CogDemoImgui.7z

Requirements

  • Execute on the web browser platform using WebGL.
  • Execute on the Microsoft Windows platform using DirectX.
  • Use the C++ programming language.
  • Use existing open source libraries when possible.
  • Identify a library for 3D graphics rendering.
  • Identify a library for audio output and sound mixing.
  • Identify a library for input processing of mouse, keyboard, and touch.
  • Identify a library for matrix math associated with 3D graphics.
  • Identify a library for the main application window.
  • Identify a library for user interface controls.

Result - Sokol is Great!

https://github.com/floooh/sokol
https://github.com/floooh/sokol-samples
  • Using Sokol for 3D graphics rendering (sokol_gfx.h).
  • Using Sokol for audio output (sokol_audio.h).
  • Using Sokol for input processing of mouse, keyboard, and touch (sokol_app.h).
  • Using Sokol for the main application window (sokol_app.h).

Result - Dear ImGui is Great!

https://github.com/ocornut/imgui

  • Using Dear ImGui for user interface controls.

Result - OpenGL Mathematics (GLM) is Great!

https://github.com/g-truc/glm

  • Using GLM for matrix math associated with 3D graphics.

Result - Write Some Code

  • Using our own source code for sound mixing.

Notes on Sokol Build FIPS

On Windows - Windows Build Debug DirectX 11 (Microsoft Visual Studio)

  • Make a directory "build_debug".
  • Copy the CogDemoImgui source code into the directory "build_debug".
  • Start a Windows PowerShell shell.
  • Change directory to "build_debug/CogDemoImgui" (in shell).
  • Execute "./fips set config sapp-d3d11-win64-vstudio-debug" (in shell).
  • Execute "./fips build" (in shell).
  • Result is "build_debug\fips-deploy\CogDemoImgui\sapp-d3d11-win64-vstudio-debug\CogDemoImgui.exe".

On Windows - Windows Build Release DirectX 11 (Microsoft Visual Studio)

  • Make a directory "build_release".
  • Copy the CogDemoImgui source code into the directory "build_release".
  • Start a Windows PowerShell shell.
  • Change directory to "build_release/CogDemoImgui" (in shell).
  • Execute "./fips set config sapp-d3d11-win64-vstudio-release" (in shell).
  • Execute "./fips build" (in shell).
  • Result is "build_release\fips-deploy\CogDemoImgui\sapp-d3d11-win64-vstudio-release\CogDemoImgui.exe".

On Windows Subsystem for Linux Ubuntu - Web Browser Build (Emscripten)

update packages

  • Start a Windows Subsystem for Linux Ubuntu shell.
  • sudo apt update
  • sudo apt upgrade
  • sudo apt install git
  • sudo apt install make
  • sudo apt install cmake
  • sudo apt install ninja-build
  • sudo apt install python3
  • sudo apt install python-is-python3

redo drive mount for git chmod problem

  • sudo umount /mnt/f
  • sudo mount -t drvfs F: /mnt/f -o metadata

build .html .wasm .js

  • Make a directory "build_wasm".
  • Copy the CogDemoImgui source code into the directory "build_wasm".
  • Change directory to "build_wasm/CogDemoImgui" (in shell).
  • Execute "./fips setup emscripten" (in shell).
  • Execute "./fips set config sapp-webgl2-emsc-ninja-release" (in shell).
  • Execute "./fips build" (in shell).
  • Result is "build_wasm\fips-deploy\CogDemoImgui\sapp-webgl2-emsc-ninja-release\CogDemoImgui.html".
  • Result is "build_wasm\fips-deploy\CogDemoImgui\sapp-webgl2-emsc-ninja-release\CogDemoImgui.wasm".
  • Result is "build_wasm\fips-deploy\CogDemoImgui\sapp-webgl2-emsc-ninja-release\CogDemoImgui.js".
  • Deploy to a web server.