Nuklear icon indicating copy to clipboard operation
Nuklear copied to clipboard

Windows (GDI): Native like nuklear windows

Open Ohjurot opened this issue 3 years ago • 7 comments

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.

Ohjurot avatar Feb 25 '22 10:02 Ohjurot

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!

dumblob avatar Feb 25 '22 10:02 dumblob

@Ohjurot any further plans with this? Shall I merge it as "under construction" piece of code?

dumblob avatar Apr 11 '22 09:04 dumblob

@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.

Ohjurot avatar Apr 11 '22 11:04 Ohjurot

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):

  1. Replace <Windows.h> include with <windows.h>. MSVC compiler is case-insensitive in this regard, while all other compilers are not.
  2. Consider using regular WinMain instead of wWinMain or at least use the _tWinMain trick.

lockie avatar May 28 '22 06:05 lockie

_tWinMain sounds least problematic to me.

dumblob avatar May 28 '22 14:05 dumblob

@lockie Thank you!

  1. Windows.h should 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 of Windows.h that is lowercase. However, since MSVC doesn't really care and all the other nuklear samples are using windows.h with lowercase I'm going to change this for consistency.
  2. Since I'm explicitly using Unicode through the whole demo (inside window.h) I think using wWinMain is ok. You can adopt this to your entry point of choice when using the example.

Ohjurot avatar May 29 '22 00:05 Ohjurot

  1. Since I'm explicitly using Unicode through the whole demo (inside window.h) I think using wWinMain is 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!

dumblob avatar May 29 '22 12:05 dumblob

Wow, this took me long. I am sorry. But it is finally merged.

Thanks a lot for waiting and all the hard work!

dumblob avatar Oct 06 '22 14:10 dumblob