### Setup and build with Meson Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/zstd-1.5.0/build/meson/README.md Run these commands from the build/meson directory to configure and build zstandard. The setup command enables the bin_programs and bin_contrib options. Then ninja builds and ninja install installs the library. ```sh meson setup -Dbin_programs=true -Dbin_contrib=true builddir cd builddir ninja # to build ninja install # to install ``` -------------------------------- ### Install and run PyBullet Gym environments Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/docs/pybullet_quickstartguide.pdf Install pybullet, tensorflow, and gym, then run pre-trained examples for the HumanoidBulletEnv and KukaGymEnvTest. ```bash pip install pybullet, tensorflow, gym python -m pybullet_envs.examples.enjoy_TF_HumanoidBulletEnv_v0_2017may python -m pybullet_envs.examples.kukaGymEnvTest ``` -------------------------------- ### Install the project Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/freetype-2.12.1/CMakeLists.txt Installs the built project, optionally with sudo. ```bash (sudo) cmake --build build --target install ``` -------------------------------- ### Build on Windows with Visual Studio's CLI Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_allegro5/README.md Compile the example using cl.exe, setting ALLEGRODIR to the Allegro installation path and defining IMGUI_USER_CONFIG. Links against the Allegro monolith library. ```batch set ALLEGRODIR=path_to_your_allegro5_folder cl /Zi /MD /I %ALLEGRODIR%\include /DIMGUI_USER_CONFIG=\"examples/example_allegro5/imconfig_allegro5.h\" /I .. /I ..\.. main.cpp ..\..\backends\imgui_impl_allegro5.cpp ..\..\imgui*.cpp /link /LIBPATH:%ALLEGRODIR%\lib allegro-5.0.10-monolith-md.lib user32.lib ``` -------------------------------- ### Example: Determining table length and loading with FT_Load_Sfnt_Table Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/freetype-2.12.1/docs/reference/ft2-truetype_tables.html Shows the recommended two-step process: first call with *length set to 0 to get the table size, then allocate a buffer and load the table. The example includes error handling for missing table and memory allocation failure. ```c FT_ULong length = 0; error = FT_Load_Sfnt_Table( face, tag, 0, NULL, &length ); if ( error ) { ... table does not exist ... } buffer = malloc( length ); if ( buffer == NULL ) { ... not enough memory ... } error = FT_Load_Sfnt_Table( face, tag, 0, buffer, &length ); if ( error ) { ... could not load table ... } ``` -------------------------------- ### Build on Ubuntu 14.04+ and macOS Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_allegro5/README.md Compile the example with g++, defining IMGUI_USER_CONFIG to use the provided imconfig_allegro5.h. On macOS, install Allegro with homebrew first. ```bash g++ -DIMGUI_USER_CONFIG="examples/example_allegro5/imconfig_allegro5.h" -I .. -I ../.. main.cpp ../../backends/imgui_impl_allegro5.cpp ../../imgui*.cpp -lallegro -lallegro_main -lallegro_primitives -o allegro5_example ``` -------------------------------- ### qvoronoi - one line descriptions of all options Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/eg/q_test-ok.txt Invoke qvoronoi with a dash to get one-line descriptions of all options. This is a command-line usage example. ```bash qvoronoi - ``` -------------------------------- ### qhalf example commands Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/eg/q_test-ok.txt Three example command lines using qhalf with different options and inputs. ```text rbox d | qconvex FQ n | qhalf s H0,0,0 Fp ``` ```text rbox c | qconvex FQ FV n | qhalf s i ``` ```text rbox c | qconvex FQ FV n | qhalf s o ``` -------------------------------- ### Example integration using Win32 and DX11 backends Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/docs/EXAMPLES.md Complete example of integrating Dear ImGui with Win32 and DX11 backends. It shows context creation, backend initialization, the main loop with frame calls, rendering, and shutdown. This is a concrete example of the generic steps above. ```cpp // Create a Dear ImGui context, setup some options ImGui::CreateContext(); ImGuiIO& io = ImGui::GetIO(); io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable some options // Initialize Platform + Renderer backends (here: using imgui_impl_win32.cpp + imgui_impl_dx11.cpp) ImGui_ImplWin32_Init(my_hwnd); ImGui_ImplDX11_Init(my_d3d_device, my_d3d_device_context); // Application main loop while (true) { // Beginning of frame: update Renderer + Platform backend, start Dear ImGui frame ImGui_ImplDX11_NewFrame(); ImGui_ImplWin32_NewFrame(); ImGui::NewFrame(); // Any application code here ImGui::Text("Hello, world!"); // End of frame: render Dear ImGui ImGui::Render(); ImGui_ImplDX11_RenderDrawData(ImGui::GetDrawData()); // Swap g_pSwapChain->Present(1, 0); } // Shutdown ImGui_ImplDX11_Shutdown(); ImGui_ImplWin32_Shutdown(); ImGui::DestroyContext(); ``` -------------------------------- ### Install the serial library Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/examples/ThirdPartyLibs/serial/README.md Installs the library to the system. ```bash make install ``` -------------------------------- ### qvoronoi example commands Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/eg/q_test-ok.txt A list of example command lines for qvoronoi with various options. Each command pipes rbox output into qvoronoi. ```bash rbox c P0 D2 | qvoronoi s o rbox c P0 D2 | qvoronoi Fi rbox c P0 D2 | qvoronoi Fo rbox c P0 D2 | qvoronoi Fv rbox c P0 D2 | qvoronoi s Qu Fv rbox c P0 D2 | qvoronoi Qu Fo rbox c G1 d D2 | qvoronoi s p rbox c P0 D2 | qvoronoi s Fv QV0 ``` -------------------------------- ### Define C++ classes for settings (WindowSettings, ConnectionSettings, AppSettings) Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/tinyxml/docs/tutorial0.html Defines basic classes for window, connection, and application settings, including a demo method to set example values. This is the starting point for the XML serialization example. ```cpp #include #include using namespace std; typedef std::map MessageMap; // a basic window abstraction - demo purposes only class WindowSettings { public: int x,y,w,h; string name; WindowSettings() : x(0), y(0), w(100), h(100), name("Untitled") { } WindowSettings(int x, int y, int w, int h, const string& name) { this->x=x; this->y=y; this->w=w; this->h=h; this->name=name; } }; class ConnectionSettings { public: string ip; double timeout; }; class AppSettings { public: string m_name; MessageMap m_messages; list m_windows; ConnectionSettings m_connection; AppSettings() {} void save(const char* pFilename); void load(const char* pFilename); // just to show how to do it void setDemoValues() { m_name="MyApp"; m_messages.clear(); m_messages["Welcome"]="Welcome to "+m_name; m_messages["Farewell"]="Thank you for using "+m_name; m_windows.clear(); m_windows.push_back(WindowSettings(15,15,400,250,"Main")); m_connection.ip="Unknown"; m_connection.timeout=123.456; } }; ``` -------------------------------- ### Install Allegro with vcpkg on Windows Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_allegro5/README.md Clone vcpkg, bootstrap it, and install Allegro for win32 or win64. Then integrate the libraries into Visual Studio. ```bash git clone https://github.com/Microsoft/vcpkg cd vcpkg bootstrap-vcpkg.bat vcpkg install allegro5 --triplet=x86-windows ; for win32 vcpkg install allegro5 --triplet=x64-windows ; for win64 vcpkg integrate install ; register include / libs in Visual Studio ``` -------------------------------- ### Build from tarball: configure, make, install Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/libogg-1.3.3/README.md Standard build steps for libogg from a tarball distribution. Run ./configure and make, then optionally make install as root to install libraries into /usr/local/lib, headers into /usr/local/include, and API docs into /usr/local/share/doc. ```shell ./configure make ``` ```shell make install ``` -------------------------------- ### Execute qconvex for synopsis and examples Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/README.txt Run qconvex to display a synopsis and examples of its usage. ```bash qconvex ``` -------------------------------- ### Install ruamel.yaml Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/examples/pybullet/gym/pybullet_envs/minitaur/envs/README.md Install the ruamel.yaml package, a prerequisite for running the simulated Minitaur environments. ```bash pip install ruamel.yaml ``` -------------------------------- ### Run galloping PPO agent example Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/examples/pybullet/gym/pybullet_envs/minitaur/envs/README.md Run a pre-trained PPO agent that performs the galloping gait using the reactive environment example. ```bash python minitaur_reactive_env_example.py ``` -------------------------------- ### qvoronoi synopsis and examples Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/html/qvoronoi.htm Shows the qvoronoi command synopsis, including input format, options, and output options, followed by several example command lines using rbox and qvoronoi. ```text qvoronoi- compute the Voronoi diagram. input (stdin): dimension, number of points, point coordinates comments start with a non-numeric character options (qh-voron.htm): Qu - compute furthest-site Voronoi diagram Tv - verify result: structure, convexity, and in-circle test . - concise list of all options - - one-line description of all options output options (subset): s - summary of results (default) p - Voronoi vertices o - OFF file format (dim, Voronoi vertices, and Voronoi regions) FN - count and Voronoi vertices for each Voronoi region Fv - Voronoi diagram as Voronoi vertices between adjacent input sites Fi - separating hyperplanes for bounded regions, 'Fo' for unbounded G - Geomview output (2-d only) QVn - Voronoi vertices for input point n, -n if not TO file- output results to file, may be enclosed in single quotes examples: rbox c P0 D2 | qvoronoi s o rbox c P0 D2 | qvoronoi Fi rbox c P0 D2 | qvoronoi Fo rbox c P0 D2 | qvoronoi Fv rbox c P0 D2 | qvoronoi s Qu Fv rbox c P0 D2 | qvoronoi Qu Fo rbox c G1 d D2 | qvoronoi s p rbox c P0 D2 | qvoronoi s Fv QV0 ``` -------------------------------- ### Install dependencies on Ubuntu Source: https://github.com/wolfiregames/overgrowth/blob/main/COMPILING.md Installs all required build dependencies for Overgrowth on Ubuntu using apt. ```bash sudo apt install build-essential cmake mesa-common-dev libsdl2-dev libsdl2-net-dev libgtk2.0-dev libogg-dev libvorbis-dev libopenal-dev libjpeg-dev libbz2-dev libfreetype-dev ``` -------------------------------- ### Build and install Mesa for DirectFB Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/SDL2-2.0.20/docs/README-directfb.md Commands to build Mesa, install it to /usr/local/dfb_GL, and build the DirectFB driver. ```bash make linux-directfb make echo Installing - please enter sudo pw. sudo make install INSTALL_DIR=/usr/local/dfb_GL cd src/mesa/drivers/directfb make sudo make install INSTALL_DIR=/usr/local/dfb_GL ``` -------------------------------- ### Install OpenAI gym Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/examples/pybullet/gym/pybullet_envs/minitaur/envs/README.md Install the OpenAI gym package, a prerequisite for running the simulated Minitaur environments. ```bash pip install gym ``` -------------------------------- ### Run trotting PPO agent example Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/examples/pybullet/gym/pybullet_envs/minitaur/envs/README.md Run a pre-trained PPO agent that performs the trotting gait using the trotting environment example. ```bash python minitaur_trotting_env_example.py ``` -------------------------------- ### Install VideoCore packages for EGL and OpenGL ES Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/SDL2-2.0.20/docs/README-raspberrypi.md Install the VideoCore binary packages needed for EGL and OpenGL ES 2.x support. ```bash sudo apt-get install libraspberrypi0 libraspberrypi-bin libraspberrypi-dev ``` -------------------------------- ### Qhull command-line examples for learning Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/html/qh-faq.htm A list of command-line examples to try out Qhull programs on small inputs. These cover convex hulls, Delaunay triangulations, Voronoi diagrams, and various options like Qt and QJ. ```shell rbox c ``` ```shell rbox c | qconvex ``` ```shell rbox c | qconvex o ``` ```shell rbox c | qconvex Qt o ``` ```shell rbox c | qconvex QJ o ``` ```shell rbox c D2 | qconvex ``` ```shell rbox c D4 | qconvex ``` ```shell rbox 6 s D2 | qconvex p Fx ``` ```shell rbox c D2 c G2 | qdelaunay ``` ```shell rbox c D2 c G2 | qdelaunay Qt ``` ```shell rbox c D2 c G2 | qvoronoi o ``` ```shell rbox c D2 c G2 | qvoronio Fv ``` -------------------------------- ### Build with make Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_emscripten_opengl3/README.md Run make in the example_emscripten_opengl3/ directory to build the example. ```bash make ``` -------------------------------- ### Example: Creating a face from a FOND resource Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/freetype-2.12.1/docs/reference/ft2-mac_specific.html Shows how to use FT_New_Face_From_FOND to create an FT_Face from a font installed in the system. The example retrieves a FOND resource using GetResource and then calls the function. ```c fond = GetResource( 'FOND', fontName ); error = FT_New_Face_From_FOND( library, fond, 0, &face ); ``` -------------------------------- ### Command-line options for App_ExampleBrowser Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/README.md List of command-line flags to configure the demo when launching the executable. Options include starting with a specific demo, creating an MP4 movie, adjusting mouse sensitivity, setting background color, and choosing a fixed timestep. ```text [--start_demo_name="Demo Name"] Start with a selected demo [--mp4=moviename.mp4] Create a mp4 movie of the window, requires ffmpeg installed [--mouse_move_multiplier=0.400000] Set the mouse move sensitivity [--mouse_wheel_multiplier=0.01] Set the mouse wheel sensitivity [--background_color_red= 0.9] Set the red component for background color. Same for green and blue [--fixed_timestep= 0.0] Use either a real-time delta time (0.0) or a fixed step size (0.016666) ``` -------------------------------- ### submitProfileTiming Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/docs/pybullet_quickstartguide.pdf Allows to insert start and stop timings to profile Python code. See the `profileTiming.py` example. ```APIDOC ## submitProfileTiming ### Description Allows to insert start and stop timings to profile Python code. See the `profileTiming.py` example. ### Method submitProfileTiming ### Parameters No parameters are documented in the source. ### Response No explicit response is documented. ``` -------------------------------- ### qconvex synopsis and examples Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/html/qconvex.htm Shows the full synopsis of qconvex, including input format, options, and a list of example commands using rbox and qconvex. ```text qconvex- compute the convex hull. input (stdin): dimension, number of points, point coordinates comments start with a non-numeric character options (qconvex.htm): Qt - triangulated output QJ - joggle input instead of merging facets Tv - verify result: structure, convexity, and point inclusion . - concise list of all options - - one-line description of all options output options (subset): s - summary of results (default) i - vertices incident to each facet n - normals with offsets p - vertex coordinates (includes coplanar points if 'Qc') Fx - extreme points (convex hull vertices) FA - compute total area and volume o - OFF format (dim, n, points, facets) G - Geomview output (2-d, 3-d, and 4-d) m - Mathematica output (2-d and 3-d) QVn - print facets that include point n, -n if not TO file- output results to file, may be enclosed in single quotes examples: rbox c D2 | qconvex s n rbox c D2 | qconvex i rbox c D2 | qconvex o rbox 1000 s | qconvex s Tv FA rbox c d D2 | qconvex s Qc Fx rbox y 1000 W0 | qconvex s n rbox y 1000 W0 | qconvex s QJ rbox d G1 D12 | qconvex QR0 FA Pp rbox c D7 | qconvex FA TF1000 ``` -------------------------------- ### Build with Visual Studio CLI (64-bit) Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_sdl_opengl2/README.md Compile the example for 64-bit Windows using Visual Studio's command line. Set SDL2_DIR to your SDL2 folder, then run the cl command with the include paths, source files, and libraries. The output executable is placed in Debug/example_sdl_opengl2.exe. ```batch cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console ``` -------------------------------- ### STACK CFI record example Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/breakpad/docs/symbol_files.md Example of STACK CFI records showing the INIT form and a subsequent record. The INIT record specifies the starting address, size, and initial rules for .cfa and $eip; the following record updates the rules at a later address. ```text STACK CFI INIT 804c4b0 40 .cfa: $esp 4 + $eip: .cfa 4 - ^ STACK CFI 804c4b1 .cfa: $esp 8 + $ebp: .cfa 8 - ^ ``` -------------------------------- ### Makefile rule to install .app bundle Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/SDL2-2.0.20/docs/README-macos.md Add this rule to your Makefile.am to install the created bundle into the Applications directory. It removes any existing app and copies the new one. ```make install-exec-hook: APP_NAME_bundle rm -rf $(DESTDIR)$(prefix)/Applications/APP_NAME.app mkdir -p $(DESTDIR)$(prefix)/Applications/ cp -r $< /$(DESTDIR)$(prefix)Applications/ ``` -------------------------------- ### Run Geomview example with rbox and qconvex Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/README.txt If you have Geomview, try 'rbox 100 | qconvex G >a' and load 'a' into Geomview. Run 'q_eg' for Geomview examples of Qhull output. ```bash rbox 100 | qconvex G >a ``` -------------------------------- ### Build on Windows with Visual Studio CLI Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_sdl_opengl3/README.md Build the example on Windows using Visual Studio's command-line compiler. Set SDL2_DIR to your SDL2 folder, then run the cl command for 32-bit or 64-bit (the 64-bit variant uses /libpath:%SDL2_DIR%\lib\x64). The command compiles main.cpp, the SDL and OpenGL3 backends, and all imgui*.cpp files, linking against SDL2.lib, SDL2main.lib, and opengl32.lib. ```batch set SDL2_DIR=path_to_your_sdl2_folder cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries # or for 64-bit: cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_opengl3.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console ``` -------------------------------- ### Use property accessors like ordinary properties Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/angelscript_2_32_0_sdk/docs/manual/doc_script_class_prop.html Shows how to set and get a property with accessors. The compiler automatically expands the expressions to calls to set_prop and get_prop. The example includes a comment that the set call is converted to set_prop(10000) and the get call to get_prop(). ```angelscript void Func() { MyObj obj; ``` ```angelscript // Set the property value just like a normal property. // The compiler will convert this to a call to set_prop(10000). obj.prop = 10000; ``` ```angelscript // Get the property value just a like a normal property. // The compiler will convert this to a call to get_prop(). assert( obj.prop == 1000 ); } ``` -------------------------------- ### Serve with make serve Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_emscripten_opengl3/README.md Run make serve to spawn a local webserver using Python3, then browse http://localhost:8000. ```bash make serve ``` -------------------------------- ### Creating a test group in test.cpp Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/tut-framework/doc/htdocs/index.html A minimal TUT test group example. It defines a data struct, a test_group typedef, and registers the group with the name "my first test". This is the starting point for writing tests. ```cpp // test.cpp #include namespace tut { struct data // (1) { }; typedef test_group tg; // (2) tg test_group("my first test"); // (3) }; ``` -------------------------------- ### Main function with Windows binary mode setup Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/libvorbis-1.3.6/doc/vorbisfile/example.html Declares the OggVorbis_File structure and variables for tracking progress, and sets stdin/stdout to binary mode on Windows. ```c int main(int argc, char **argv){ OggVorbis_File vf; int eof=0; int current_section; #ifdef _WIN32 _setmode( _fileno( stdin ), _O_BINARY ); _setmode( _fileno( stdout ), _O_BINARY ); #endif ``` -------------------------------- ### Integration steps for Dear ImGui with standard backends Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/docs/EXAMPLES.md Shows the minimal steps to integrate Dear ImGui into an existing application using standard backends. It covers initialization, per-frame calls, and shutdown. The steps are generic and apply to any backend pair. ```text At initialization: call ImGui::CreateContext() call ImGui_ImplXXXX_Init() for each backend. At the beginning of your frame: call ImGui_ImplXXXX_NewFrame() for each backend. call ImGui::NewFrame() At the end of your frame: call ImGui::Render() call ImGui_ImplXXXX_RenderDrawData() for your Renderer backend. At shutdown: call ImGui_ImplXXXX_Shutdown() for each backend. call ImGui::DestroyContext() ``` -------------------------------- ### Sample 3D input for Qhull Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/html/index.htm Example input data for Qhull: first line is dimension, second line is number of points, remaining lines are coordinates. Comments start with a non-numeric character. End input with control-D. ```plaintext 3 #sample 3-d input 5 0.4 -0.5 1.0 1000 -1e-5 -100 0.3 0.2 0.1 1.0 1.0 1.0 0 0 0 ``` -------------------------------- ### ImTextureID types per graphics API backend Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/docs/FAQ.md Lists the ImTextureID representation used by each example backend (OpenGL, DirectX9, DirectX11, DirectX12) and the corresponding RenderDrawData function. These are the default types suggested when starting with a graphics API. ```cpp OpenGL: - ImTextureID = GLuint - See ImGui_ImplOpenGL3_RenderDrawData() function in imgui_impl_opengl3.cpp ``` ```cpp DirectX9: - ImTextureID = LPDIRECT3DTEXTURE9 - See ImGui_ImplDX9_RenderDrawData() function in imgui_impl_dx9.cpp ``` ```cpp DirectX11: - ImTextureID = ID3D11ShaderResourceView* - See ImGui_ImplDX11_RenderDrawData() function in imgui_impl_dx11.cpp ``` ```cpp DirectX12: - ImTextureID = D3D12_GPU_DESCRIPTOR_HANDLE - See ImGui_ImplDX12_RenderDrawData() function in imgui_impl_dx12.cpp ``` -------------------------------- ### GLM extension usage with matrix_transform Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/glm-0.9.4.2/doc/glm.pdf Example of using a GLM extension (gtc/matrix_transform.hpp) to create a translation matrix. The code is split across two blocks in the source; the first block includes the headers and starts the function, the second block completes the glm::translate call and the rest of the function. ```cpp #include #include int foo() { glm::vec4 Position = glm::vec4(glm:: vec3(0.0f), 1.0f); glm::mat4 Model = glm::translate( ``` ```cpp glm::mat4(1.0f), glm::vec3(1.0f)); glm::vec4 Transformed = Model * Position; … return 0; } ``` -------------------------------- ### Example XML file: example4.xml Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/tinyxml/docs/tutorial0.html An XML file with settings for MyApp, including messages, windows, and a connection. ```xml Welcome to MyApp Thank you for using MyApp ``` -------------------------------- ### Basic TUT test file Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/tut-framework/README.md A minimal TUT test file that defines a test group named 'basic test' and a single test case. It uses the ensure_equals macro to verify that 2+2 equals 4. This example shows the required includes, namespace setup, and test registration. ```cpp #include namespace tut { struct basic{}; typedef test_group factory; typedef factory::object object; } namespace { tut::factory tf("basic test"); } namespace tut { template<> template<> void object::test<1>() { ensure_equals("2+2=?", 2+2, 4); } } ``` -------------------------------- ### Constant bitrate (CBR) encoding with vorbis_encode_init Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/libvorbis-1.3.6/doc/vorbisenc/examples.html Configures a vorbis_info structure for constant bitrate (CBR) encoding using vorbis_encode_init. The example sets 44kHz stereo with a constant bitrate of 128000 bps for minimum, nominal, and maximum. If setup fails, the function returns OV_EIMPL and the code exits. ```c vorbis_info_init(&vi); /********************************************************************* Encoding using a constant bitrate mode (CBR). example: 44kHz stereo coupled, average 128kbps CBR *********************************************************************/ ret = vorbis_encode_init(&vi,2,44100,128000,128000,128000); /********************************************************************* do not continue if setup failed; this can happen if we ask for a mode that libVorbis does not support (eg, too low a bitrate, etc, will return 'OV_EIMPL') *********************************************************************/ if(ret) exit(1); ``` -------------------------------- ### Build the project Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/freetype-2.12.1/CMakeLists.txt Builds the configured project. ```bash cmake --build build ``` -------------------------------- ### Example: Setting up incremental loading with FT_Open_Face Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/freetype-2.12.1/docs/reference/ft2-incremental.html Shows how to configure FT_Incremental_InterfaceRec and FT_Parameter with FT_PARAM_TAG_INCREMENTAL, then pass them to FT_Open_Face to open a font with incremental loading. The example uses my_funcs, my_object, my_font_pathname, and an index variable that must be defined elsewhere. ```c FT_Incremental_InterfaceRec inc_int; FT_Parameter parameter; FT_Open_Args open_args; // set up incremental descriptor inc_int.funcs = my_funcs; inc_int.object = my_object; // set up optional parameter parameter.tag = FT_PARAM_TAG_INCREMENTAL; parameter.data = &inc_int; // set up FT_Open_Args structure open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS; open_args.pathname = my_font_pathname; open_args.num_params = 1; open_args.params = ¶meter; // we use one optional argument // open the font error = FT_Open_Face( library, &open_args, index, &face ); ... ``` -------------------------------- ### Average bitrate (ABR) encoding with vorbis_encode_init Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/libvorbis-1.3.6/doc/vorbisenc/examples.html Configures a vorbis_info structure for average bitrate (ABR) encoding using vorbis_encode_init. The example sets 44kHz stereo with an average bitrate of 128000 bps, passing -1 for minimum and maximum bitrate. If setup fails, the function returns OV_EIMPL and the code exits. ```c vorbis_info_init(&vi); /********************************************************************* Encoding using an average bitrate mode (ABR). example: 44kHz stereo coupled, average 128kbps ABR *********************************************************************/ ret = vorbis_encode_init(&vi,2,44100,-1,128000,-1); /********************************************************************* do not continue if setup failed; this can happen if we ask for a mode that libVorbis does not support (eg, too low a bitrate, etc, will return 'OV_EIMPL') *********************************************************************/ if(ret) exit(1); ``` -------------------------------- ### VBR quality mode encoding with vorbis_encode_init_vbr Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/libvorbis-1.3.6/doc/vorbisenc/examples.html Initializes a vorbis_info structure and configures it for VBR encoding using vorbis_encode_init_vbr. The quality parameter ranges from -0.1 (lowest quality, smallest file) to 1.0 (highest quality, largest file); the example uses 0.4 for roughly 128kbps at 44kHz stereo. If setup fails, the function returns OV_EIMPL and the code exits. ```c vorbis_info_init(&vi); /********************************************************************* Encoding using a VBR quality mode. The usable range is -.1 (lowest quality, smallest file) to 1.0 (highest quality, largest file). Example quality mode .4: 44kHz stereo coupled, roughly 128kbps VBR *********************************************************************/ ret = vorbis_encode_init_vbr(&vi,2,44100,.4); /********************************************************************* do not continue if setup failed; this can happen if we ask for a mode that libVorbis does not support (eg, too low a quality mode, etc, will return 'OV_EIMPL') *********************************************************************/ if(ret) exit(1); ``` -------------------------------- ### Example usage: ogda Source: https://github.com/wolfiregames/overgrowth/blob/main/Docs/Markdown/Deployment Assistant.md Shows the basic command to run the deployment assistant. ```text ogda ``` -------------------------------- ### Hello SDL2 sample program Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/SDL2-2.0.20/docs/README-visualc.md A minimal SDL2 program that initializes video, creates a window and renderer, then cleans up. Use it to verify your SDL setup in Visual C++. ```cpp #include "SDL.h" int main( int argc, char* argv[] ) { const int WIDTH = 640; const int HEIGHT = 480; SDL_Window* window = NULL; SDL_Renderer* renderer = NULL; SDL_Init(SDL_INIT_VIDEO); window = SDL_CreateWindow("SDL2 Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WIDTH, HEIGHT, SDL_WINDOW_SHOWN); renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); SDL_Quit(); return 0; } ``` -------------------------------- ### Basic main() to save and load settings Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/tinyxml/docs/tutorial0.html Creates a default AppSettings object, saves it to 'appsettings2.xml', then loads it back. This is the minimal usage of the save() and load() methods. ```cpp int main(void) { AppSettings settings; settings.save("appsettings2.xml"); settings.load("appsettings2.xml"); return 0; } ``` -------------------------------- ### glm::row (get) Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/glm-0.9.4.2/doc/api/a00148.html Function to get a specific row from a matrix. ```APIDOC ## glm::row (get) ### Description Gets a specific row of a matrix. ### Function Signature ```cpp template genType::row_type glm::row(genType const & m, int index); ``` ### Parameters - **m** (genType const &) - The matrix from which to extract the row. - **index** (int) - The index of the row to retrieve. ### Returns - **genType::row_type** - The row at the specified index. ### See Also - GLM_GTC_matrix_access ``` -------------------------------- ### Main function with Windows binary mode setup Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/libvorbis-1.3.6/doc/vorbisfile/seekingexample.html Declares the OggVorbis_File structure and sets stdin/stdout to binary on Windows. ```c int main(int argc, char **argv){ OggVorbis_File vf; int eof=0; int current_section; #ifdef _WIN32 _setmode( _fileno( stdin ), _O_BINARY ); #endif ``` -------------------------------- ### glm::column (get) Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/glm-0.9.4.2/doc/api/a00148.html Function to get a specific column from a matrix. ```APIDOC ## glm::column (get) ### Description Gets a specific column of a matrix. ### Function Signature ```cpp template genType::col_type glm::column(genType const & m, int index); ``` ### Parameters - **m** (genType const &) - The matrix from which to extract the column. - **index** (int) - The index of the column to retrieve. ### Returns - **genType::col_type** - The column at the specified index. ### See Also - GLM_GTC_matrix_access ``` -------------------------------- ### Build on Windows with Visual Studio CLI (32-bit) Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_sdl_sdlrenderer/README.md Sets SDL2_DIR and compiles the example with cl, linking SDL2.lib and SDL2main.lib for x86. Use this for 32-bit builds. ```batch set SDL2_DIR=path_to_your_sdl2_folder cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl.cpp ..\..\backends\imgui_impl_sdlrenderer.cpp ..\..\imgui*.cpp /FeDebug/example_sdl_sdlrenderer.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /subsystem:console # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries ``` -------------------------------- ### Install Bullet using vcpkg Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/bullet3-2.89/README.md Commands to clone the vcpkg repository, bootstrap it, integrate it, and install the bullet3 package. This is the recommended way to install Bullet on Windows, Linux, or macOS. ```bash git clone https://github.com/Microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg integrate install vcpkg install bullet3 ``` -------------------------------- ### Compile and install AngelScript with MinGW Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/angelscript_2_32_0_sdk/angelscript/projects/mingw/readme.txt Run 'make' to compile the library and 'make install' to install it. Requires the MINGDIR environment variable to be set to the MinGW directory, e.g., 'C:\MINGW'. ```bash make make install ``` -------------------------------- ### column (get) Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/glm-0.9.4.2/doc/api/a00052_source.html Gets a specific column of a matrix. Returns the column as a col_type vector. ```APIDOC ## column (get) ### Description Gets a specific column of a matrix. Returns the column as a col_type vector. ### Method Function ### Signature ```cpp template typename genType::col_type column(genType const & m, int index); ``` ### Parameters - **m** (genType const &) - The matrix from which to extract the column. - **index** (int) - The index of the column to get. ### Returns - **typename genType::col_type** - The column at the specified index. ``` -------------------------------- ### Build on Linux with c++ and sdl2-config Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/imgui-1.85/examples/example_sdl_opengl2/README.md Compile the example on Linux and similar Unixes using c++ and sdl2-config. The command includes the necessary include paths, source files, and links against SDL2 and OpenGL. ```bash c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL ``` -------------------------------- ### row (get) Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/glm-0.9.4.2/doc/api/a00052_source.html Gets a specific row of a matrix. Returns the row as a row_type vector. ```APIDOC ## row (get) ### Description Gets a specific row of a matrix. Returns the row as a row_type vector. ### Method Function ### Signature ```cpp template typename genType::row_type row(genType const & m, int index); ``` ### Parameters - **m** (genType const &) - The matrix from which to extract the row. - **index** (int) - The index of the row to get. ### Returns - **typename genType::row_type** - The row at the specified index. ``` -------------------------------- ### Start a command shell with adb shell Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/SDL2-2.0.20/docs/README-android.md Start a command shell on the default device. ```bash adb shell ``` -------------------------------- ### Build JsonCpp documentation with doxybuild.py Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/jsoncpp-0.y.z/README.md Run the Python script `doxybuild.py` from the top directory to build documentation. Options are available via `--help`. ```bash python doxybuild.py --doxygen=$(which doxygen) --open --with-dot ``` -------------------------------- ### C++ example: Create and pass a script array to the script Source: https://github.com/wolfiregames/overgrowth/blob/main/Projects/angelscript_2_32_0_sdk/docs/manual/doc_addon_array.html This function creates a script array of type 'array' from the application and passes it to the script. It uses the active context to get the engine, obtains the type info, creates the array with an initial size of 3, sets each element to the string 'test', and returns the array handle. The ref count for the returned handle is already set in the array's constructor. ```cpp // Registered with AngelScript as 'array @CreateArrayOfString()' CScriptArray *CreateArrayOfStrings() { // If called from the script, there will always be an active // context, which can be used to obtain a pointer to the engine. asIScriptContext *ctx = asGetActiveContext(); if( ctx ) { asIScriptEngine* engine = ctx->GetEngine(); // The script array needs to know its type to properly handle the elements. // Note that the object type should be cached to avoid performance issues // if the function is called frequently. asITypeInfo* t = engine->GetTypeInfoByDecl("array"); // Create an array with the initial size of 3 elements CScriptArray* arr = CScriptArray::Create(t, 3); for( asUINT i = 0; i < arr->GetSize(); i++ ) { // Set the value of each element string val("test"); arr->SetValue(i, &val); } // The ref count for the returned handle was already set in the array's constructor return arr; } return 0; } ``` -------------------------------- ### Example XML file: example1.xml Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/tinyxml/docs/tutorial0.html A minimal XML file with a root element containing text 'World'. ```xml World ``` -------------------------------- ### Build Qhull and libqhullstatic.a from src/libqhull Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/README.txt Extract Qhull, change to src/libqhull, and run make to build Qhull and the static library libqhullstatic.a. ```bash cd src/libqhull ``` ```bash make ``` -------------------------------- ### qhull output options examples Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/html/qhull.htm These examples show how to use qhull to compute convex hulls, Delaunay triangulations, Voronoi diagrams, and halfspace intersections. Each example uses a specific option and is described in the surrounding text. ```text qhull ``` ```text qhull d Qbb ``` ```text qhull v Qbb ``` ```text qhull H ``` -------------------------------- ### qvoronoi . - list all options Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/qhull_git_22feb2012/eg/q_test-ok.txt Invoke qvoronoi with a period to list all available options. This is a command-line usage example. ```bash qvoronoi . ``` -------------------------------- ### Install Raspbian build dependencies Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/SDL2-2.0.20/docs/README-raspberrypi.md Install the required development packages for building SDL on Raspbian. ```bash sudo apt-get install libudev-dev libasound2-dev libdbus-1-dev ``` -------------------------------- ### Main() to customize, save, and load settings Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/tinyxml/docs/tutorial0.html Shows creation, modification, saving, and then loading of a settings structure. The first block customizes and saves, the second block loads and prints the values. ```cpp int main(void) { // block: customise and save settings { AppSettings settings; settings.m_name="HitchHikerApp"; settings.m_messages["Welcome"]="Don't Panic"; settings.m_messages["Farewell"]="Thanks for all the fish"; settings.m_windows.push_back(WindowSettings(15,25,300,250,"BookFrame")); settings.m_connection.ip="192.168.0.77"; settings.m_connection.timeout=42.0; settings.save("appsettings2.xml"); } // block: load settings { AppSettings settings; settings.load("appsettings2.xml"); printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Welcome"].c_str()); WindowSettings & w=settings.m_windows.front(); printf("%s: Show window '%s' at %d,%d (%d x %d)\n", settings.m_name.c_str(), w.name.c_str(), w.x, w.y, w.w, w.h); printf("%s: %s\n", settings.m_name.c_str(), settings.m_messages["Farewell"].c_str()); } return 0; } ``` -------------------------------- ### Install evtest utility Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/SDL2-2.0.20/docs/README-linux.md Install the evtest utility on Ubuntu/Debian to debug joystick detection issues. ```bash sudo apt-get install evtest ``` -------------------------------- ### Install dependencies on Fedora Source: https://github.com/wolfiregames/overgrowth/blob/main/COMPILING.md Installs all required build dependencies for Overgrowth on Fedora using dnf. ```bash sudo dnf install gcc-c++ cmake make 'pkgconfig(gl)' 'pkgconfig(glu)' 'pkgconfig(sdl2)' 'pkgconfig(SDL2_net)' 'pkgconfig(gtk+-2.0)' 'pkgconfig(ogg)' 'pkgconfig(vorbis)' 'pkgconfig(openal)' 'pkgconfig(libjpeg)' 'pkgconfig(bzip2)' 'pkgconfig(freetype2)' ``` -------------------------------- ### Binn C example: writing an object Source: https://github.com/wolfiregames/overgrowth/blob/main/Libraries/binn-3.0/README.md Shows how to create a Binn object, add integer, string, and double values, then send the serialized buffer over a network or save to a file, and finally release the buffer. ```c binn *obj; // create a new object obj = binn_object(); // add values to it binn_object_set_int32(obj, "id", 123); binn_object_set_str(obj, "name", "John"); binn_object_set_double(obj, "total", 2.55); // send over the network or save to a file... send(sock, binn_ptr(obj), binn_size(obj)); // release the buffer binn_free(obj); ```