- compile:
make - run particular tests:
GTEST_FILTER=SomeTest.* make tests-yourmodulename-run - run ui based tests like this:
UI_TESTFILTER=XXX make tests-voxedit-run. To get a list of the available tests, run this before:build/voxedit/vengi-tests-voxedit --imgui_list_tests. To run all tests, just omit theUI_TESTFILTERenv var. (SeeImGuiTestEngine_PassFilterfor a description of the filters) - run all tests:
make tests - check the documentation under
docsif your change would also require the documentation to be updated (or extended)
- try to avoid the STL where possible! - no exceptions, no rtti, C-style casts.
- when touching code, ensure that a test is written for it - if not, write one to test the change - and execute that test
- all vengi tools understand the
--helpparameter to print the usage for command line parameters - don't add unicode characters in comments or code - only ascii
- When doing rendering code changes, check if a visual test in
src/testsexists and implement one. If a tests exists, you can you--screenshot 5to generate a screenshot after 5 frames of lifetime. In combination with xvfb-run on linux, you can get the rendering result in a screenshot to inspect.
- when adding debug logging via
Log::debug(), make sure to use the environment variableCORE_LOGLEVEL=2in front of your vengi applications or yourmakecalls.
- the glsl shader C++ code is autogenerated by a tool called
shadertool- seedocs/ShaderTool.mdfor more details on how to use it. This is crucial when you are creating or updating shaders. The source code is in the build directory in a directory calledgenerated/shaders/<module>. Also uniform data C++ structs are auto generated. You have to runmakeas described above each time you modify a shader.
- more details on the lua scripts and the api can be found here:
docs/LUAScript.mdand thedocs/luafolder - if you are extending or modifying the api, make sure to also keep the documentation in sync - by providing the_jsonhelpfunction, too. - docs/lua is autogenerated by
make lua-apiin the project rootMakefilehelper - if you add new lua scripts, make sure to add them to the lua api test suite that is executing the scripts and reports errors.
- always try to make your scripts reusable by not hardcoding important values, but implementing them as arguments.
- if installed, run
luacheck --codes .in the directorysrc
- to get scenegraph details you can use
vengi-voxconvert --json all --input thefile.ext-all, palette, meshdetails, nodedetails, children, palettematerials, animationsare all valid--jsonparameters. Usevengi-voxconvert --helpto get more details.
When inspecting colors from palettes, you can use vengi-palconvert --input thefile --type json to get the colors listed. Also as for the other tools - check out vengi-palconvert --help if your task is about colors.
If you need to do this on a non-palette format, you can use voxconvert here, too: vengi-voxconvert --input thefile --json palette,children
Always use a git worktree while starting a refactoring to not pollute the workspace for others.