Windows (GDI): Native like nuklear windows
This is a preview PR to show my progress on building a C++ class that allows a nuklear window to behave the same as any other Windows window. The class is coming from a project that I’m currently writing so it is still rough. I will spend some more time in converting the style to the nuklear style (Maybe even converting the code from C++ to C). Already looking forward for some feedback and suggestions.
I'm out of time now to look at the code, but just want to mention that in my opinion the "Nuklear style" is probably less interesting than the C++ -> C conversion itself :wink:.
But either way, I'm willing to merge it once we'll take a quick look at it.
Thanks a lot!
@Ohjurot any further plans with this? Shall I merge it as "under construction" piece of code?
@dumblob I'm still not happy with how Windows handles the nuklear window preview after minimizing... However all the rest is working as intended. So I would be OK with mergin the PR. I might come up with a followup PR when I got a fix to this issue.
I've had a look at it using mingw compiler and wine. Floating windows work really cool, great job! I have a couple of suggestions though (regarding using mingw to compile the code):
- Replace
<Windows.h>include with<windows.h>. MSVC compiler is case-insensitive in this regard, while all other compilers are not. - Consider using regular
WinMaininstead ofwWinMainor at least use the _tWinMain trick.
_tWinMain sounds least problematic to me.
@lockie Thank you!
Windows.hshould be written as it is. At least with the windows sdk version that i have installed (10.0.22567.0) the file is named with a capitalized W. I'm not aware if mingw or any other compiler on windows use any special (or older) version ofWindows.hthat is lowercase. However, since MSVC doesn't really care and all the other nuklear samples are usingwindows.hwith lowercase I'm going to change this for consistency.- Since I'm explicitly using Unicode through the whole demo (inside
window.h) I think usingwWinMainis ok. You can adopt this to your entry point of choice when using the example.
- Since I'm explicitly using Unicode through the whole demo (inside
window.h) I think usingwWinMainis ok. You can adopt this to your entry point of choice when using the example.
Sure, that makes sense. Could you add a comment to the wWinMain line hinting at the _tWinMain trick to ease adoption by others in the future?
I will then want to merge this in the upcoming days/weeks.
Thanks a lot @Ohjurot for the hard work and @lockie for the test!
Wow, this took me long. I am sorry. But it is finally merged.
Thanks a lot for waiting and all the hard work!