-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add subpixel API. #861
base: master
Are you sure you want to change the base?
Add subpixel API. #861
Conversation
Thanks @itsuhane . An important question - it seems to me, that now it behaves differently than you proposed in #425:
Thinking about this further we might actually afford making
Btw please also bump version accordingly 😉. |
Thanks for your quick response! Since we changed the internal representation for Lines 1291 to 1297 in bb327b9
Effectively, the Originally, I was thinking about having a macro named If we give up the conversion, all UI rendering will no-longer be pixel-perfect. I believe it will introduce artifacts. If there are artifacts, then we cannot easily remove the conversion. Two separate set of drawing API must co-exist. I will try subpixel UI drawing first and make some screenshot. But in some sense, I agree to have only one set of implementation because my current PR contains massive code duplication. Can I create some macro ("templated C") to help elide the duplication ? |
This might be the case, but I think there is one problem which I'm reluctant to digest 😉. Namely, that Nuklear users won't have any clue which API (one of pixel-perfect and subpixel) in which case to use as they won't know how it behaves and how to combine the APIs. We must not introduce such problem at any cost.
This would be great - and once you're at it, try as many backends as you can to get some overview. This will be much appreciated.
Sure, just make some proposals a and we'll discuss it. Usually one comes with the best ideas when working with code, but not up front, so I won't comment technically on this until there is some practical demonstrations 😉. |
This PR tries to provide subpixel drawing API as discussed in #425.
In this PR, a new macro,
NK_ENABLE_SUBPIXEL_API
is proposed. User can turn-on subpixel API by defining this macro before ALL inclusion ofnuklear.h
.When this macro is defined, the following changes are made inside nuklear:
nk_command_custom
) will usefloat
instead ofshort
/unsigned short
, usenk_vec2
instead offnk_vec2i
.nk_push_custom
) will have asubpixel
counterpart. For example, in addition tonk_stroke_polyline
,nk_stroke_polyline_subpixel
will be defined. In these subpixel version, there will be no narrowing fromfloat
toshort
.No documentation is changed currently.