Rename the null variable to tex_null

This commit is contained in:
Rob Loach 2022-07-30 17:38:10 -04:00
parent ed3ff76d0e
commit ec4acc7cf4
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A
20 changed files with 73 additions and 71 deletions

View File

@ -137,7 +137,7 @@ nk_d3d11_render(ID3D11DeviceContext *context, enum nk_anti_aliasing AA)
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;
config.null = d3d11.null;
config.tex_null = d3d11.null;
{/* setup buffers to load vertices and elements */
struct nk_buffer vbuf, ibuf;

View File

@ -198,7 +198,7 @@ nk_d3d12_render(ID3D12GraphicsCommandList *command_list, enum nk_anti_aliasing A
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;
config.null = d3d12.null;
config.tex_null = d3d12.null;
struct nk_buffer vbuf, ibuf;
nk_buffer_init_fixed(&vbuf, &ptr_data[sizeof(float) * 4 * 4], (size_t)d3d12.max_vertex_buffer);

View File

@ -150,7 +150,7 @@ nk_d3d9_render(enum nk_anti_aliasing AA)
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;
config.null = d3d9.null;
config.tex_null = d3d9.null;
/* convert shapes into vertexes */
nk_buffer_init_default(&vbuf);

View File

@ -140,7 +140,7 @@ nk_glfw3_render(enum nk_anti_aliasing AA)
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -266,7 +266,7 @@ nk_glfw3_render(struct nk_glfw* glfw, enum nk_anti_aliasing AA, int max_vertex_b
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -407,7 +407,7 @@ nk_glfw3_render(enum nk_anti_aliasing AA)
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -120,7 +120,7 @@ nk_sdl_render(enum nk_anti_aliasing AA)
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_sdl_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_sdl_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -247,7 +247,7 @@ nk_sdl_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_sdl_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_sdl_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -245,7 +245,7 @@ nk_sdl_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_sdl_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_sdl_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -113,7 +113,7 @@ nk_sdl_render(enum nk_anti_aliasing AA)
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_sdl_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_sdl_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -118,7 +118,7 @@ nk_sfml_render(enum nk_anti_aliasing AA)
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_sfml_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_sfml_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -248,7 +248,7 @@ nk_sfml_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_sfml_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_sfml_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -153,7 +153,7 @@ nk_x11_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_x11_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_x11_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -536,7 +536,7 @@ nk_x11_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_x11_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_x11_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -262,7 +262,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -685,7 +685,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -722,7 +722,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -286,7 +286,7 @@ device_draw(struct device *dev, struct nk_context *ctx, int width, int height,
config.vertex_layout = vertex_layout;
config.vertex_size = sizeof(struct nk_glfw_vertex);
config.vertex_alignment = NK_ALIGNOF(struct nk_glfw_vertex);
config.null = dev->null;
config.tex_null = dev->null;
config.circle_segment_count = 22;
config.curve_segment_count = 22;
config.arc_segment_count = 22;

View File

@ -1127,7 +1127,7 @@ NK_API void nk_input_end(struct nk_context*);
/// cfg.curve_segment_count = 22;
/// cfg.arc_segment_count = 22;
/// cfg.global_alpha = 1.0f;
/// cfg.null = dev->null;
/// cfg.tex_null = dev->tex_null;
/// //
/// // setup buffers and convert
/// struct nk_buffer cmds, verts, idx;
@ -1177,7 +1177,7 @@ struct nk_convert_config {
unsigned circle_segment_count; /* number of segments used for circles: default to 22 */
unsigned arc_segment_count; /* number of segments used for arcs: default to 22 */
unsigned curve_segment_count; /* number of segments used for curves: default to 22 */
struct nk_draw_null_texture null; /* handle to texture with a white pixel for shape drawing */
struct nk_draw_null_texture tex_null; /* handle to texture with a white pixel for shape drawing */
const struct nk_draw_vertex_layout_element *vertex_layout; /* describes the vertex output format and packing */
nk_size vertex_size; /* sizeof one vertex for vertex packing */
nk_size vertex_alignment; /* vertex alignment: Can be obtained by NK_ALIGNOF */
@ -9563,7 +9563,7 @@ nk_draw_list_add_clip(struct nk_draw_list *list, struct nk_rect rect)
NK_ASSERT(list);
if (!list) return;
if (!list->cmd_count) {
nk_draw_list_push_command(list, rect, list->config.null.texture);
nk_draw_list_push_command(list, rect, list->config.tex_null.texture);
} else {
struct nk_draw_command *prev = nk_draw_list_command_last(list);
if (prev->elem_count == 0)
@ -9918,7 +9918,7 @@ nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *p
/* fill vertices */
for (i = 0; i < points_count; ++i) {
const struct nk_vec2 uv = list->config.null.uv;
const struct nk_vec2 uv = list->config.tex_null.uv;
vtx = nk_draw_vertex(vtx, &list->config, points[i], uv, col);
vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+0], uv, col_trans);
vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+1], uv, col_trans);
@ -9983,7 +9983,7 @@ nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *p
/* add vertices */
for (i = 0; i < points_count; ++i) {
const struct nk_vec2 uv = list->config.null.uv;
const struct nk_vec2 uv = list->config.tex_null.uv;
vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+0], uv, col_trans);
vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+1], uv, col);
vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+2], uv, col);
@ -10004,7 +10004,7 @@ nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *p
for (i1 = 0; i1 < count; ++i1) {
float dx, dy;
const struct nk_vec2 uv = list->config.null.uv;
const struct nk_vec2 uv = list->config.tex_null.uv;
const nk_size i2 = ((i1+1) == points_count) ? 0 : i1 + 1;
const struct nk_vec2 p1 = points[i1];
const struct nk_vec2 p2 = points[i2];
@ -10114,7 +10114,7 @@ nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
/* add vertices + indexes */
for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) {
const struct nk_vec2 uv = list->config.null.uv;
const struct nk_vec2 uv = list->config.tex_null.uv;
struct nk_vec2 n0 = normals[i0];
struct nk_vec2 n1 = normals[i1];
struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(n0, n1), 0.5f);
@ -10151,7 +10151,7 @@ nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
if (!vtx || !ids) return;
for (i = 0; i < vtx_count; ++i)
vtx = nk_draw_vertex(vtx, &list->config, points[i], list->config.null.uv, col);
vtx = nk_draw_vertex(vtx, &list->config, points[i], list->config.tex_null.uv, col);
for (i = 2; i < points_count; ++i) {
ids[0] = (nk_draw_index)index;
ids[1] = (nk_draw_index)(index+ i - 1);
@ -10180,8 +10180,8 @@ nk_draw_list_path_line_to(struct nk_draw_list *list, struct nk_vec2 pos)
nk_draw_list_add_clip(list, nk_null_rect);
cmd = nk_draw_list_command_last(list);
if (cmd && cmd->texture.ptr != list->config.null.texture.ptr)
nk_draw_list_push_image(list, list->config.null.texture);
if (cmd && cmd->texture.ptr != list->config.tex_null.texture.ptr)
nk_draw_list_push_image(list, list->config.tex_null.texture);
points = nk_draw_list_alloc_path(list, 1);
if (!points) return;
@ -10383,7 +10383,7 @@ nk_draw_list_fill_rect_multi_color(struct nk_draw_list *list, struct nk_rect rec
NK_ASSERT(list);
if (!list) return;
nk_draw_list_push_image(list, list->config.null.texture);
nk_draw_list_push_image(list, list->config.tex_null.texture);
index = (nk_draw_index)list->vertex_count;
vtx = nk_draw_list_alloc_vertices(list, 4);
idx = nk_draw_list_alloc_elements(list, 6);
@ -10393,10 +10393,10 @@ nk_draw_list_fill_rect_multi_color(struct nk_draw_list *list, struct nk_rect rec
idx[2] = (nk_draw_index)(index+2); idx[3] = (nk_draw_index)(index+0);
idx[4] = (nk_draw_index)(index+2); idx[5] = (nk_draw_index)(index+3);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y), list->config.null.uv, col_left);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y), list->config.null.uv, col_top);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y + rect.h), list->config.null.uv, col_right);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y + rect.h), list->config.null.uv, col_bottom);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y), list->config.tex_null.uv, col_left);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y), list->config.tex_null.uv, col_top);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y + rect.h), list->config.tex_null.uv, col_right);
vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y + rect.h), list->config.tex_null.uv, col_bottom);
}
NK_API void
nk_draw_list_fill_triangle(struct nk_draw_list *list, struct nk_vec2 a,
@ -29656,6 +29656,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
/// - [y]: Minor version with non-breaking API and library changes
/// - [z]: Patch version with no direct changes to the API
///
/// - 2022/07/30 (4.10.1) - Renamed the `null` texture variable to `tex_null`
/// - 2022/05/27 (4.10.0) - Add nk_input_has_mouse_click_in_button_rect() to fix window move bug
/// - 2022/04/18 (4.9.7) - Change button behavior when NK_BUTTON_TRIGGER_ON_RELEASE is defined to
/// only trigger when the mouse position was inside the same button on down

View File

@ -7,6 +7,7 @@
/// - [y]: Minor version with non-breaking API and library changes
/// - [z]: Patch version with no direct changes to the API
///
/// - 2022/07/30 (4.10.1) - Renamed the `null` texture variable to `tex_null`
/// - 2022/05/27 (4.10.0) - Add nk_input_has_mouse_click_in_button_rect() to fix window move bug
/// - 2022/04/18 (4.9.7) - Change button behavior when NK_BUTTON_TRIGGER_ON_RELEASE is defined to
/// only trigger when the mouse position was inside the same button on down