04/22/2023

I had previously changed my code to use C++20 modules. As much hope that I had for modules, I've been supremely disappointed in them. Seems like everytime I upgrade Visual Studio, my entire code base will no longer compile due to the use of modules. In the most recent upgrade, while trying to compile my JSon library, I get the following error:

4>C:\Program Files\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(703,5): error MSB6006: "CL.exe" exited with code -1073741571.

No other useful information is available as to what the issue is. The more I use other modern languages (C#, Rust) the less and less I like using C++. It's become a mess of a language.

07/18/2022

I recently upgraded my MeshView application to use the Dear ImGui dockable windows branch. Overall, it was a fairly simple process to add into my app three dockable windows: a scene hierarchy window, an property inspector window, and the final rendered view window. I did have a few issues with getting mouse events working but managed to get ImGui to ignore events inside the render view so that my renderer can use those mouse events to update the camera position. I ended up using the InvisibleButton approach outlined in the ImGui demo code. I also had to change my renderer to render to a texture which I then have ImGui draw using ImGui::Image(). This does mean there is an unnecessary copy occurring and I would have prefered to be able to just set the final renderer's viewport to be the same as the ImGui window I want to render to, but such is life. Here is a link showing the final implementation (ignoring some outstanding bugs I still have to fix around keyboard support):

https://youtu.be/V0fx4hBqbhc

03/18/2022

I have been looking at NERF rendering here at work. There is code on github from the original paper, but in order to provide it a custom scene you need to provide the camera poses written out in NumPy format. As I have written in other posts, I am not a big fan of Python. So, I wanted to convert some existing RoomAlive data so that I could run it through the NERF training. So I wrote a tiny C# app to convert the camera poses from RoomAlive into numpys format using NumSharp. NumSharp is pretty cool. It allows you to write numpy like code but directly in C#. No Python required:

GitHub - SciSharp/NumSharp: High Performance Computation for N-D Tensors in .NET, similar API to NumPy.

06/08/2022

This is just a note to myself, since it took me a while to find this. If you want to make a nonsquare window in GDI, you can use SetWindowRgn. You can also use WS_EX_LAYERED to make the window transparent. Below is sample code. I found this on: https://blog.karatos.in/a?ID=00750-fc6e0241-fb3f-4986-945d-578f83091a28


HRGN rgn = CreateEllipticRgn(100, 100, 500, 500);
HWND hWnd = CreateWindowEx(WS_EX_LAYERED | WS_EX_TOOLWINDOW, szWindowClass, szTitle, 0,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr);

if (!hWnd)
{
return FALSE;
}
SetWindowLongW(hWnd, GWL_STYLE, 0);
SetWindowRgn(hWnd, rgn, true);
SetLayeredWindowAttributes(hWnd, RGB(255, 0, 0), 180, LWA_ALPHA);

ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

09/10/2021

This is just a note to myself: I recently had to generate an MPEG file from a series of images on iOS. What a PITA. I googled around for documentation showing examples of how to use VideoToolkit under Xamarin without finding an good examples. Then I found this stack overflow article:

ios - How Does VideoToolbox.framework work? - Stack Overflow

It has a link to a good video presented a WWDC 2014.