Hi guys,

Was curious about bgfx and saw some examples on the website https://bkaradzic.github.io/bgfx/examples.html

I wanted to see if I could compile the examples from the included 3rdparty bgfx


[Linked Image from i.imgur.com]

[Linked Image from i.imgur.com]




3rdparty/bgfx$ make
Available targets:
clean Clean all intermediate files.
projgen Generate project files for all configurations.
idl Generate code from IDL.
android-arm-debug Build - Android ARM Debug
android-arm-release Build - Android ARM Release
android-arm Build - Android ARM Debug and Release
android-arm64-debug Build - Android ARM64 Debug
android-arm64-release Build - Android ARM64 Release
android-arm64 Build - Android ARM64 Debug and Release
android-x86-debug Build - Android x86 Debug and Release
android-x86-release Build - Android x86 Debug and Release
android-x86 Build - Android x86 Debug and Release
wasm2js-debug Build - Emscripten Debug
wasm2js-release Build - Emscripten Release
wasm2js Build - Emscripten Debug and Release
wasm-debug Build - Emscripten Debug
wasm-release Build - Emscripten Release
wasm Build - Emscripten Debug and Release
linux-debug64 Build - Linux x64 Debug
linux-release64 Build - Linux x64 Release
linux Build - Linux x86/x64 Debug and Release
freebsd-debug32 Build - FreeBSD x86 Debug
freebsd-release32 Build - FreeBSD x86 Release
freebsd-debug64 Build - FreeBSD x86 Debug
freebsd-release64 Build - FreeBSD x86 Release
freebsd Build - FreeBSD x86/x64 Debug and Release
mingw-gcc-debug32 Build - MinGW GCC x86 Debug
mingw-gcc-release32 Build - MinGW GCC x86 Release
mingw-gcc-debug64 Build - MinGW GCC x64 Debug
mingw-gcc-release64 Build - MinGW GCC x64 Release
mingw-gcc Build - MinGW GCC x86/x64 Debug and Release
mingw-clang-debug32 Build - MinGW Clang x86 Debug
mingw-clang-release32 Build - MinGW Clang x86 Release
mingw-clang-debug64 Build - MinGW Clang x64 Debug
mingw-clang-release64 Build - MinGW Clang x64 Release
mingw-clang Build - MinGW Clang x86/x64 Debug and Release
vs2017-debug32 Build - vs2017 x86 Debug
vs2017-release32 Build - vs2017 x86 Release
vs2017-debug64 Build - vs2017 x64 Debug
vs2017-release64 Build - vs2017 x64 Release
vs2017 Build - vs2017 x86/x64 Debug and Release
vs2017-winstore100-debug32 Build - vs2017-winstore100 x86 Debug
vs2017-winstore100-release32 Build - vs2017-winstore100 x86 Release
vs2017-winstore100-debug64 Build - vs2017-winstore100 x64 Debug
vs2017-winstore100-release64 Build - vs2017-winstore100 x64 Release
vs2017-winstore100 Build - vs2017-winstore100 x86/x64 Debug and Release
osx-debug Build - macOS Universal Debug
osx-release Build - macOS Universal Release
osx Build - macOS Universal Debug and Release
osx-x64-debug Build - macOS x64 Debug
osx-x64-release Build - macOS x64 Release
osx-x64 Build - macOS x64 Debug and Release
osx-arm64-debug Build - macOS ARM Debug
osx-arm64-release Build - macOS ARM Release
osx-arm64 Build - macOS ARM Debug and Release
ios-arm-debug Build - iOS ARM Debug
ios-arm-release Build - iOS ARM Release
ios-arm Build - iOS ARM Debug and Release
ios-arm64-debug Build - iOS ARM64 Debug
ios-arm64-release Build - iOS ARM64 Release
ios-arm64 Build - iOS ARM64 Debug and Release
ios-simulator-debug Build - iOS Simulator Debug
ios-simulator-release Build - iOS Simulator Release
ios-simulator Build - iOS Simulator Debug and Release
ios-simulator64-debug Build - iOS Simulator Debug
ios-simulator64-release Build - iOS Simulator Release
ios-simulator64 Build - iOS Simulator Debug and Release
rpi-debug Build - RasberryPi Debug
rpi-release Build - RasberryPi Release
rpi Build - RasberryPi Debug and Release
geometryc Build geometryc tool.
geometryv Build geometryv tool.
shaderc Build shaderc tool.
texturec Build texturec tool.
texturev Build texturev tool.
tools Build tools.
clean-tools Clean tools projects.




Since I'm on linux, I'll do make linux-release64


bgfx$ make linux-release64
make -R -C .build/projects/gmake-linux config=release64
==== Building bx (release64) ====
==== Building bgfx (release64) ====
==== Building bimg (release64) ====
==== Building bgfx-shared-lib (release64) ====
==== Building bimg_decode (release64) ====
==== Building bimg_encode (release64) ====
==== Building example-glue (release64) ====
==== Building example-common (release64) ====
==== Building example-17-drawstress (release64) ====
==== Building example-25-c99 (release64) ====
==== Building examples (release64) ====
Linking examples
Running post-build commands
Stripping symbols.
==== Building fcpp (release64) ====
==== Building geometryc (release64) ====
==== Building geometryv (release64) ====
==== Building glsl-optimizer (release64) ====
==== Building glslang (release64) ====
==== Building spirv-opt (release64) ====
==== Building spirv-cross (release64) ====
==== Building shaderc (release64) ====
==== Building texturec (release64) ====
==== Building texturev (release64) ====



and to run the examples you have to be in the examples/runtime directory and launch it with running the examplesRelease executable in the .build directory

mame/3rdparty/bgfx/examples/runtime$ ../../.build/linux64_gcc/bin/examplesRelease

Some of those examples are extremely impressive:

There's around 40 or so examples, a few crashed but most work.

mame/3rdparty/bgfx/examples/runtime$ ../../.build/linux64_gcc/bin/geometryvRelease meshes/bunny.bin

[Linked Image from i.imgur.com]


I wonder how hard it would be to render mame's output to a texture and put it on a 3d model.