I think when people hear "write your own engine" they imagine a situation where they're writing specific code for each platform just to create a window and an OpenGL (or whatever 3D rendering API) context and then hooking into the message pipe and yadayadayada. I absolutely do not recommend you go around calling CreateWindowEx and doing all of that manually.
There are great free and open source libraries available to do that shit for you. SDL2, RayLib, and many other smaller and less known libraries. I use RayLib in my fantasy console project and I gave the source to a friend who, with almost no alterations, managed to get it running on a Raspberry Pi. This is a solved problem. You don't gotta do this.
When you grab SDL2 for your little game/engine you're like 90% of the way there.
At the studio I worked at, we used to roll our own window creation, input handling, etc., and it's huge pain in the ass. I've processed input directly from the Raw Input and Xinput APIs in Windows, and I'm here to tell you:
You should just let SDL2 handle that.
Not only is it a cross-platform library that works on basically anything with a CPU (GPU optional), but the library already handles the annoying platform-specific edge cases for you. And once you have created your window with SDL_CreateWindow(), you can still specify that you want an OpenGL rendering context for it, or a Vulkan one, or even a Metal one.
Now you just have to build the rest of the fucking game.
Especially for Windows, support has just gotten better over time. I haven't had to compile my own version to step into it in the debugger once in Chronicles and that's saying a lot!
Want to support..... all? Gamepads? Load this text file and it just works.
And if you want to use ImGui there's already sdl2 platform back ends written in the example folder. You can get an imgui sdl2 program window running from scratch in like 15 minutes: https://github.com/ocornut/imgui/tree/master/examples/example_sdl2_opengl3
It's low level audio interface has also vastly improved in case you wanted to do something silly like generate your own audio streams 👀
