From ed3ff76d0eb8c2db2e9127075ad666c829f14bdf Mon Sep 17 00:00:00 2001 From: ryuukk Date: Mon, 27 Jun 2022 00:15:14 +0200 Subject: [PATCH 1/4] rename null texture field to tex_null --- src/nuklear.h | 4 ++-- src/nuklear_vertex.c | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/nuklear.h b/src/nuklear.h index 67b2aa9..4ced6b9 100644 --- a/src/nuklear.h +++ b/src/nuklear.h @@ -906,7 +906,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; @@ -956,7 +956,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 */ diff --git a/src/nuklear_vertex.c b/src/nuklear_vertex.c index b98eb1e..ce1f94e 100644 --- a/src/nuklear_vertex.c +++ b/src/nuklear_vertex.c @@ -177,7 +177,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) @@ -532,7 +532,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); @@ -597,7 +597,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); @@ -618,7 +618,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]; @@ -728,7 +728,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); @@ -765,7 +765,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); @@ -794,8 +794,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; @@ -997,7 +997,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); @@ -1007,10 +1007,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, From ec4acc7cf4e6e53d604d17e6cab5019233a221cc Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 30 Jul 2022 17:38:10 -0400 Subject: [PATCH 2/4] Rename the null variable to tex_null --- demo/d3d11/nuklear_d3d11.h | 8 +++--- demo/d3d12/nuklear_d3d12.h | 24 ++++++++-------- demo/d3d9/nuklear_d3d9.h | 6 ++-- demo/glfw_opengl2/nuklear_glfw_gl2.h | 2 +- demo/glfw_opengl3/nuklear_glfw_gl3.h | 2 +- demo/glfw_opengl4/nuklear_glfw_gl4.h | 2 +- demo/sdl_opengl2/nuklear_sdl_gl2.h | 2 +- demo/sdl_opengl3/nuklear_sdl_gl3.h | 2 +- demo/sdl_opengles2/nuklear_sdl_gles2.h | 8 +++--- demo/sdl_renderer/nuklear_sdl_renderer.h | 2 +- demo/sfml_opengl2/nuklear_sfml_gl2.h | 4 +-- demo/sfml_opengl3/nuklear_sfml_gl3.h | 4 +-- demo/x11_opengl2/nuklear_xlib_gl2.h | 2 +- demo/x11_opengl3/nuklear_xlib_gl3.h | 2 +- example/canvas.c | 36 ++++++++++++------------ example/extended.c | 2 +- example/file_browser.c | 2 +- example/skinning.c | 2 +- nuklear.h | 31 ++++++++++---------- src/CHANGELOG | 1 + 20 files changed, 73 insertions(+), 71 deletions(-) diff --git a/demo/d3d11/nuklear_d3d11.h b/demo/d3d11/nuklear_d3d11.h index b716632..46c615d 100644 --- a/demo/d3d11/nuklear_d3d11.h +++ b/demo/d3d11/nuklear_d3d11.h @@ -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; @@ -373,7 +373,7 @@ nk_d3d11_clipboard_paste(nk_handle usr, struct nk_text_edit *edit) (void)usr; if (IsClipboardFormatAvailable(CF_UNICODETEXT) && OpenClipboard(NULL)) { - HGLOBAL mem = GetClipboardData(CF_UNICODETEXT); + HGLOBAL mem = GetClipboardData(CF_UNICODETEXT); if (mem) { SIZE_T size = GlobalSize(mem) - 1; @@ -393,7 +393,7 @@ nk_d3d11_clipboard_paste(nk_handle usr, struct nk_text_edit *edit) free(utf8); } } - GlobalUnlock(mem); + GlobalUnlock(mem); } } } @@ -419,7 +419,7 @@ nk_d3d11_clipboard_copy(nk_handle usr, const char *text, int len) MultiByteToWideChar(CP_UTF8, 0, text, len, wstr, wsize); wstr[wsize] = 0; GlobalUnlock(mem); - SetClipboardData(CF_UNICODETEXT, mem); + SetClipboardData(CF_UNICODETEXT, mem); } } } diff --git a/demo/d3d12/nuklear_d3d12.h b/demo/d3d12/nuklear_d3d12.h index a235d69..1660d7b 100644 --- a/demo/d3d12/nuklear_d3d12.h +++ b/demo/d3d12/nuklear_d3d12.h @@ -2,7 +2,7 @@ * Nuklear - 1.32.0 - public domain * no warrenty implied; use at your own risk. * authored from 2015-2016 by Micha Mettke - * + * * D3D12 backend created by Ludwig Fuechsl (2022) */ /* @@ -30,7 +30,7 @@ NK_API struct nk_context *nk_d3d12_init(ID3D12Device *device, int width, int hei NK_API void nk_d3d12_font_stash_begin(struct nk_font_atlas **atlas); /* * USAGE: - * - Call this function after a call to nk_d3d12_font_stash_begin(...) when all fonts have been loaded and configured. + * - Call this function after a call to nk_d3d12_font_stash_begin(...) when all fonts have been loaded and configured. * - This function will place commands on the supplied ID3D12GraphicsCommandList. * - This function will allocate temporary data that is required until the command list has finish executing. The temporary data can be free by calling nk_d3d12_font_stash_cleanup(...) */ @@ -96,7 +96,7 @@ NK_API void nk_d3d12_shutdown(void); #include "nuklear_d3d12_vertex_shader.h" #include "nuklear_d3d12_pixel_shader.h" -struct nk_d3d12_vertex +struct nk_d3d12_vertex { float position[2]; float uv[2]; @@ -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); @@ -505,7 +505,7 @@ nk_d3d12_clipboard_paste(nk_handle usr, struct nk_text_edit *edit) (void)usr; if (IsClipboardFormatAvailable(CF_UNICODETEXT) && OpenClipboard(NULL)) { - HGLOBAL mem = GetClipboardData(CF_UNICODETEXT); + HGLOBAL mem = GetClipboardData(CF_UNICODETEXT); if (mem) { SIZE_T size = GlobalSize(mem) - 1; @@ -525,7 +525,7 @@ nk_d3d12_clipboard_paste(nk_handle usr, struct nk_text_edit *edit) free(utf8); } } - GlobalUnlock(mem); + GlobalUnlock(mem); } } } @@ -551,7 +551,7 @@ nk_d3d12_clipboard_copy(nk_handle usr, const char *text, int len) MultiByteToWideChar(CP_UTF8, 0, text, len, wstr, wsize); wstr[wsize] = 0; GlobalUnlock(mem); - SetClipboardData(CF_UNICODETEXT, mem); + SetClipboardData(CF_UNICODETEXT, mem); } } } @@ -566,7 +566,7 @@ nk_d3d12_init(ID3D12Device *device, int width, int height, unsigned int max_vert D3D12_CONSTANT_BUFFER_VIEW_DESC cbv; D3D12_CPU_DESCRIPTOR_HANDLE cbv_handle; - /* Do plain object / ref copys */ + /* Do plain object / ref copys */ d3d12.max_vertex_buffer = max_vertex_buffer; d3d12.max_index_buffer = max_index_buffer; d3d12.max_user_textures = max_user_textures; @@ -679,7 +679,7 @@ nk_d3d12_init(ID3D12Device *device, int width, int height, unsigned int max_vert /* Get address of first handle (CPU and GPU) */ ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(d3d12.desc_heap, &d3d12.cpu_descriptor_handle); ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(d3d12.desc_heap, &d3d12.gpu_descriptor_handle); - + /* Get addresses of vertex & index buffers */ d3d12.gpu_vertex_buffer_address = ID3D12Resource_GetGPUVirtualAddress(d3d12.vertex_buffer); d3d12.gpu_index_buffer_address = ID3D12Resource_GetGPUVirtualAddress(d3d12.index_buffer); @@ -870,7 +870,7 @@ nk_d3d12_font_stash_end(ID3D12GraphicsCommandList *command_list) nk_style_set_font(&d3d12.ctx, &d3d12.atlas.default_font->handle); } -NK_API +NK_API void nk_d3d12_font_stash_cleanup() { if(d3d12.font_upload_buffer) @@ -880,7 +880,7 @@ void nk_d3d12_font_stash_cleanup() } } -NK_API +NK_API nk_bool nk_d3d12_set_user_texture(unsigned int index, ID3D12Resource* texture, const D3D12_SHADER_RESOURCE_VIEW_DESC* description, nk_handle* handle_out) { nk_bool result = nk_false; @@ -919,7 +919,7 @@ void nk_d3d12_shutdown(void) ID3D12Resource_Release(d3d12.const_buffer); ID3D12Resource_Release(d3d12.index_buffer); ID3D12Resource_Release(d3d12.vertex_buffer); - if(d3d12.font_texture) + if(d3d12.font_texture) ID3D12Resource_Release(d3d12.font_texture); if(d3d12.font_upload_buffer) ID3D12Resource_Release(d3d12.font_upload_buffer); diff --git a/demo/d3d9/nuklear_d3d9.h b/demo/d3d9/nuklear_d3d9.h index 9a6fe4c..1aee6ba 100644 --- a/demo/d3d9/nuklear_d3d9.h +++ b/demo/d3d9/nuklear_d3d9.h @@ -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); @@ -468,7 +468,7 @@ nk_d3d9_clipboard_paste(nk_handle usr, struct nk_text_edit *edit) } } - GlobalUnlock(mem); + GlobalUnlock(mem); CloseClipboard(); } @@ -491,7 +491,7 @@ nk_d3d9_clipboard_copy(nk_handle usr, const char *text, int len) MultiByteToWideChar(CP_UTF8, 0, text, len, wstr, wsize); wstr[wsize] = 0; GlobalUnlock(mem); - SetClipboardData(CF_UNICODETEXT, mem); + SetClipboardData(CF_UNICODETEXT, mem); } } } diff --git a/demo/glfw_opengl2/nuklear_glfw_gl2.h b/demo/glfw_opengl2/nuklear_glfw_gl2.h index 6eb43cb..97e3b6e 100644 --- a/demo/glfw_opengl2/nuklear_glfw_gl2.h +++ b/demo/glfw_opengl2/nuklear_glfw_gl2.h @@ -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; diff --git a/demo/glfw_opengl3/nuklear_glfw_gl3.h b/demo/glfw_opengl3/nuklear_glfw_gl3.h index fcc8335..573b76d 100644 --- a/demo/glfw_opengl3/nuklear_glfw_gl3.h +++ b/demo/glfw_opengl3/nuklear_glfw_gl3.h @@ -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; diff --git a/demo/glfw_opengl4/nuklear_glfw_gl4.h b/demo/glfw_opengl4/nuklear_glfw_gl4.h index 6e77627..6f1e259 100644 --- a/demo/glfw_opengl4/nuklear_glfw_gl4.h +++ b/demo/glfw_opengl4/nuklear_glfw_gl4.h @@ -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; diff --git a/demo/sdl_opengl2/nuklear_sdl_gl2.h b/demo/sdl_opengl2/nuklear_sdl_gl2.h index 93ca705..7850d65 100644 --- a/demo/sdl_opengl2/nuklear_sdl_gl2.h +++ b/demo/sdl_opengl2/nuklear_sdl_gl2.h @@ -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; diff --git a/demo/sdl_opengl3/nuklear_sdl_gl3.h b/demo/sdl_opengl3/nuklear_sdl_gl3.h index 5a89869..26036f1 100644 --- a/demo/sdl_opengl3/nuklear_sdl_gl3.h +++ b/demo/sdl_opengl3/nuklear_sdl_gl3.h @@ -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; diff --git a/demo/sdl_opengles2/nuklear_sdl_gles2.h b/demo/sdl_opengles2/nuklear_sdl_gles2.h index e2f297f..592e0db 100644 --- a/demo/sdl_opengles2/nuklear_sdl_gles2.h +++ b/demo/sdl_opengles2/nuklear_sdl_gles2.h @@ -103,7 +103,7 @@ nk_sdl_device_create(void) "}\n"; struct nk_sdl_device *dev = &sdl.ogl; - + nk_buffer_init_default(&dev->cmds); dev->prog = glCreateProgram(); dev->vert_shdr = glCreateShader(GL_VERTEX_SHADER); @@ -133,7 +133,7 @@ nk_sdl_device_create(void) dev->vp = offsetof(struct nk_sdl_vertex, position); dev->vt = offsetof(struct nk_sdl_vertex, uv); dev->vc = offsetof(struct nk_sdl_vertex, col); - + /* Allocate buffers */ glGenBuffers(1, &dev->vbo); glGenBuffers(1, &dev->ebo); @@ -214,7 +214,7 @@ nk_sdl_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_b /* Bind buffers */ glBindBuffer(GL_ARRAY_BUFFER, dev->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, dev->ebo); - + { /* buffer setup */ glEnableVertexAttribArray((GLuint)dev->attrib_pos); @@ -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; diff --git a/demo/sdl_renderer/nuklear_sdl_renderer.h b/demo/sdl_renderer/nuklear_sdl_renderer.h index bd85044..702d56c 100644 --- a/demo/sdl_renderer/nuklear_sdl_renderer.h +++ b/demo/sdl_renderer/nuklear_sdl_renderer.h @@ -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; diff --git a/demo/sfml_opengl2/nuklear_sfml_gl2.h b/demo/sfml_opengl2/nuklear_sfml_gl2.h index 728d899..1f9fcd1 100644 --- a/demo/sfml_opengl2/nuklear_sfml_gl2.h +++ b/demo/sfml_opengl2/nuklear_sfml_gl2.h @@ -59,7 +59,7 @@ nk_sfml_device_upload_atlas(const void* image, int width, int height) glBindTexture(GL_TEXTURE_2D, dev->font_tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0, GL_RGBA, GL_UNSIGNED_BYTE, image); } @@ -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; diff --git a/demo/sfml_opengl3/nuklear_sfml_gl3.h b/demo/sfml_opengl3/nuklear_sfml_gl3.h index 27d7511..0038b34 100644 --- a/demo/sfml_opengl3/nuklear_sfml_gl3.h +++ b/demo/sfml_opengl3/nuklear_sfml_gl3.h @@ -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; @@ -451,7 +451,7 @@ nk_sfml_handle_event(sf::Event* evt) return 1; } else if(evt->type == sf::Event::TextEntered) { /* 8 ~ backspace */ - if (evt->text.unicode != 8) { + if (evt->text.unicode != 8) { nk_input_unicode(ctx, evt->text.unicode); } return 1; diff --git a/demo/x11_opengl2/nuklear_xlib_gl2.h b/demo/x11_opengl2/nuklear_xlib_gl2.h index de720f4..9e1382e 100644 --- a/demo/x11_opengl2/nuklear_xlib_gl2.h +++ b/demo/x11_opengl2/nuklear_xlib_gl2.h @@ -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; diff --git a/demo/x11_opengl3/nuklear_xlib_gl3.h b/demo/x11_opengl3/nuklear_xlib_gl3.h index bc25109..85ff2ae 100644 --- a/demo/x11_opengl3/nuklear_xlib_gl3.h +++ b/demo/x11_opengl3/nuklear_xlib_gl3.h @@ -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; diff --git a/example/canvas.c b/example/canvas.c index 5f651cc..d8a1534 100644 --- a/example/canvas.c +++ b/example/canvas.c @@ -78,24 +78,24 @@ die(const char *fmt, ...) exit(EXIT_FAILURE); } -static struct nk_image -icon_load(const char *filename) -{ - int x,y,n; - GLuint tex; - unsigned char *data = stbi_load(filename, &x, &y, &n, 0); - if (!data) die("[SDL]: failed to load image: %s", filename); +static struct nk_image +icon_load(const char *filename) +{ + int x,y,n; + GLuint tex; + unsigned char *data = stbi_load(filename, &x, &y, &n, 0); + if (!data) die("[SDL]: failed to load image: %s", filename); - glGenTextures(1, &tex); - glBindTexture(GL_TEXTURE_2D, tex); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); - glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); - glGenerateMipmap(GL_TEXTURE_2D); - stbi_image_free(data); - return nk_image_id((int)tex); + glGenTextures(1, &tex); + glBindTexture(GL_TEXTURE_2D, tex); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_NEAREST); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, x, y, 0, GL_RGBA, GL_UNSIGNED_BYTE, data); + glGenerateMipmap(GL_TEXTURE_2D); + stbi_image_free(data); + return nk_image_id((int)tex); } */ @@ -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; diff --git a/example/extended.c b/example/extended.c index f1ae3c1..41f2fa2 100644 --- a/example/extended.c +++ b/example/extended.c @@ -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; diff --git a/example/file_browser.c b/example/file_browser.c index 7286d5f..60e6ac2 100644 --- a/example/file_browser.c +++ b/example/file_browser.c @@ -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; diff --git a/example/skinning.c b/example/skinning.c index 54f71e4..b54b03d 100644 --- a/example/skinning.c +++ b/example/skinning.c @@ -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; diff --git a/nuklear.h b/nuklear.h index aef8f7f..90d8b2d 100644 --- a/nuklear.h +++ b/nuklear.h @@ -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 diff --git a/src/CHANGELOG b/src/CHANGELOG index 44223af..619468c 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -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 From 54fd67bddd8aa82beed67cf29667ae403e319508 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 30 Jul 2022 17:43:46 -0400 Subject: [PATCH 3/4] Rename additional .null variables --- demo/d3d11/nuklear_d3d11.h | 6 +++--- demo/d3d12/nuklear_d3d12.h | 6 +++--- demo/d3d9/nuklear_d3d9.h | 6 +++--- demo/glfw_opengl2/nuklear_glfw_gl2.h | 4 ++-- demo/glfw_opengl3/nuklear_glfw_gl3.h | 4 ++-- demo/glfw_opengl4/nuklear_glfw_gl4.h | 4 ++-- demo/sdl_opengl2/nuklear_sdl_gl2.h | 4 ++-- demo/sdl_opengl3/nuklear_sdl_gl3.h | 4 ++-- demo/sdl_opengles2/nuklear_sdl_gles2.h | 4 ++-- demo/sdl_renderer/nuklear_sdl_renderer.h | 4 ++-- demo/sfml_opengl2/nuklear_sfml_gl2.h | 4 ++-- demo/sfml_opengl3/nuklear_sfml_gl3.h | 4 ++-- demo/x11_opengl2/nuklear_xlib_gl2.h | 4 ++-- demo/x11_opengl3/nuklear_xlib_gl3.h | 4 ++-- doc/index.html | 2 +- example/canvas.c | 4 ++-- example/extended.c | 4 ++-- example/file_browser.c | 4 ++-- example/skinning.c | 4 ++-- nuklear.h | 16 ++++++++-------- src/nuklear_font.c | 16 ++++++++-------- 21 files changed, 56 insertions(+), 56 deletions(-) diff --git a/demo/d3d11/nuklear_d3d11.h b/demo/d3d11/nuklear_d3d11.h index 46c615d..27fa2c1 100644 --- a/demo/d3d11/nuklear_d3d11.h +++ b/demo/d3d11/nuklear_d3d11.h @@ -61,7 +61,7 @@ static struct struct nk_font_atlas atlas; struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; unsigned int max_vertex_buffer; unsigned int max_index_buffer; @@ -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.tex_null = d3d11.null; + config.tex_null = d3d11.tex_null; {/* setup buffers to load vertices and elements */ struct nk_buffer vbuf, ibuf; @@ -603,7 +603,7 @@ nk_d3d11_font_stash_end(void) assert(SUCCEEDED(hr));} ID3D11Texture2D_Release(font_texture);} - nk_font_atlas_end(&d3d11.atlas, nk_handle_ptr(d3d11.font_texture_view), &d3d11.null); + nk_font_atlas_end(&d3d11.atlas, nk_handle_ptr(d3d11.font_texture_view), &d3d11.tex_null); if (d3d11.atlas.default_font) nk_style_set_font(&d3d11.ctx, &d3d11.atlas.default_font->handle); } diff --git a/demo/d3d12/nuklear_d3d12.h b/demo/d3d12/nuklear_d3d12.h index 1660d7b..5b86ea1 100644 --- a/demo/d3d12/nuklear_d3d12.h +++ b/demo/d3d12/nuklear_d3d12.h @@ -109,7 +109,7 @@ static struct struct nk_font_atlas atlas; struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; unsigned int max_vertex_buffer; unsigned int max_index_buffer; unsigned int max_user_textures; @@ -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.tex_null = d3d12.null; + config.tex_null = d3d12.tex_null; struct nk_buffer vbuf, ibuf; nk_buffer_init_fixed(&vbuf, &ptr_data[sizeof(float) * 4 * 4], (size_t)d3d12.max_vertex_buffer); @@ -863,7 +863,7 @@ nk_d3d12_font_stash_end(ID3D12GraphicsCommandList *command_list) ID3D12Device_CreateShaderResourceView(d3d12.device, d3d12.font_texture, &srv_desc, srv_handle); /* Done with nk atlas data. Atlas will be served with texture id 0 */ - nk_font_atlas_end(&d3d12.atlas, nk_handle_id(0), &d3d12.null); + nk_font_atlas_end(&d3d12.atlas, nk_handle_id(0), &d3d12.tex_null); /* Setup default font */ if (d3d12.atlas.default_font) diff --git a/demo/d3d9/nuklear_d3d9.h b/demo/d3d9/nuklear_d3d9.h index 1aee6ba..f967678 100644 --- a/demo/d3d9/nuklear_d3d9.h +++ b/demo/d3d9/nuklear_d3d9.h @@ -58,7 +58,7 @@ static struct { struct nk_font_atlas atlas; struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; D3DVIEWPORT9 viewport; D3DMATRIX projection; @@ -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.tex_null = d3d9.null; + config.tex_null = d3d9.tex_null; /* convert shapes into vertexes */ nk_buffer_init_default(&vbuf); @@ -248,7 +248,7 @@ nk_d3d9_create_font_texture() hr = IDirect3DTexture9_UnlockRect(d3d9.texture, 0); NK_ASSERT(SUCCEEDED(hr)); - nk_font_atlas_end(&d3d9.atlas, nk_handle_ptr(d3d9.texture), &d3d9.null); + nk_font_atlas_end(&d3d9.atlas, nk_handle_ptr(d3d9.texture), &d3d9.tex_null); } NK_API void diff --git a/demo/glfw_opengl2/nuklear_glfw_gl2.h b/demo/glfw_opengl2/nuklear_glfw_gl2.h index 97e3b6e..2706f11 100644 --- a/demo/glfw_opengl2/nuklear_glfw_gl2.h +++ b/demo/glfw_opengl2/nuklear_glfw_gl2.h @@ -53,7 +53,7 @@ NK_API void nk_gflw3_scroll_callback(GLFWwindow *win, double xof struct nk_glfw_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint font_tex; }; @@ -288,7 +288,7 @@ nk_glfw3_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_glfw3_device_upload_atlas(image, w, h); - nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.null); + nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex), &glfw.ogl.tex_null); if (glfw.atlas.default_font) nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle); } diff --git a/demo/glfw_opengl3/nuklear_glfw_gl3.h b/demo/glfw_opengl3/nuklear_glfw_gl3.h index 573b76d..a1e5d6c 100644 --- a/demo/glfw_opengl3/nuklear_glfw_gl3.h +++ b/demo/glfw_opengl3/nuklear_glfw_gl3.h @@ -26,7 +26,7 @@ enum nk_glfw_init_state{ struct nk_glfw_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -403,7 +403,7 @@ nk_glfw3_font_stash_end(struct nk_glfw* glfw) const void *image; int w, h; image = nk_font_atlas_bake(&glfw->atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_glfw3_device_upload_atlas(glfw, image, w, h); - nk_font_atlas_end(&glfw->atlas, nk_handle_id((int)glfw->ogl.font_tex), &glfw->ogl.null); + nk_font_atlas_end(&glfw->atlas, nk_handle_id((int)glfw->ogl.font_tex), &glfw->ogl.tex_null); if (glfw->atlas.default_font) nk_style_set_font(&glfw->ctx, &glfw->atlas.default_font->handle); } diff --git a/demo/glfw_opengl4/nuklear_glfw_gl4.h b/demo/glfw_opengl4/nuklear_glfw_gl4.h index 6f1e259..683da8c 100644 --- a/demo/glfw_opengl4/nuklear_glfw_gl4.h +++ b/demo/glfw_opengl4/nuklear_glfw_gl4.h @@ -72,7 +72,7 @@ struct nk_glfw_vertex { struct nk_glfw_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -553,7 +553,7 @@ nk_glfw3_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&glfw.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_glfw3_device_upload_atlas(image, w, h); - nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex_index), &glfw.ogl.null); + nk_font_atlas_end(&glfw.atlas, nk_handle_id((int)glfw.ogl.font_tex_index), &glfw.ogl.tex_null); if (glfw.atlas.default_font) nk_style_set_font(&glfw.ctx, &glfw.atlas.default_font->handle); } diff --git a/demo/sdl_opengl2/nuklear_sdl_gl2.h b/demo/sdl_opengl2/nuklear_sdl_gl2.h index 7850d65..eaa00e5 100644 --- a/demo/sdl_opengl2/nuklear_sdl_gl2.h +++ b/demo/sdl_opengl2/nuklear_sdl_gl2.h @@ -33,7 +33,7 @@ NK_API void nk_sdl_shutdown(void); struct nk_sdl_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint font_tex; }; @@ -226,7 +226,7 @@ nk_sdl_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_sdl_device_upload_atlas(image, w, h); - nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.null); + nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.tex_null); if (sdl.atlas.default_font) nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle); } diff --git a/demo/sdl_opengl3/nuklear_sdl_gl3.h b/demo/sdl_opengl3/nuklear_sdl_gl3.h index 26036f1..560ef69 100644 --- a/demo/sdl_opengl3/nuklear_sdl_gl3.h +++ b/demo/sdl_opengl3/nuklear_sdl_gl3.h @@ -40,7 +40,7 @@ NK_API void nk_sdl_device_create(void); struct nk_sdl_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -334,7 +334,7 @@ nk_sdl_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_sdl_device_upload_atlas(image, w, h); - nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.null); + nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.tex_null); if (sdl.atlas.default_font) nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle); diff --git a/demo/sdl_opengles2/nuklear_sdl_gles2.h b/demo/sdl_opengles2/nuklear_sdl_gles2.h index 592e0db..854c582 100644 --- a/demo/sdl_opengles2/nuklear_sdl_gles2.h +++ b/demo/sdl_opengles2/nuklear_sdl_gles2.h @@ -43,7 +43,7 @@ NK_API void nk_sdl_device_create(void); struct nk_sdl_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, ebo; GLuint prog; GLuint vert_shdr; @@ -335,7 +335,7 @@ nk_sdl_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_sdl_device_upload_atlas(image, w, h); - nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.null); + nk_font_atlas_end(&sdl.atlas, nk_handle_id((int)sdl.ogl.font_tex), &sdl.ogl.tex_null); if (sdl.atlas.default_font) nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle); diff --git a/demo/sdl_renderer/nuklear_sdl_renderer.h b/demo/sdl_renderer/nuklear_sdl_renderer.h index 702d56c..be6f0aa 100644 --- a/demo/sdl_renderer/nuklear_sdl_renderer.h +++ b/demo/sdl_renderer/nuklear_sdl_renderer.h @@ -44,7 +44,7 @@ NK_API void nk_sdl_shutdown(void); struct nk_sdl_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; SDL_Texture *font_tex; }; @@ -259,7 +259,7 @@ nk_sdl_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&sdl.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_sdl_device_upload_atlas(image, w, h); - nk_font_atlas_end(&sdl.atlas, nk_handle_ptr(sdl.ogl.font_tex), &sdl.ogl.null); + nk_font_atlas_end(&sdl.atlas, nk_handle_ptr(sdl.ogl.font_tex), &sdl.ogl.tex_null); if (sdl.atlas.default_font) nk_style_set_font(&sdl.ctx, &sdl.atlas.default_font->handle); } diff --git a/demo/sfml_opengl2/nuklear_sfml_gl2.h b/demo/sfml_opengl2/nuklear_sfml_gl2.h index 1f9fcd1..a848d27 100644 --- a/demo/sfml_opengl2/nuklear_sfml_gl2.h +++ b/demo/sfml_opengl2/nuklear_sfml_gl2.h @@ -34,7 +34,7 @@ NK_API void nk_sfml_shutdown(void); struct nk_sfml_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint font_tex; }; @@ -245,7 +245,7 @@ nk_sfml_font_stash_end() const void* img; img = nk_font_atlas_bake(&sfml.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_sfml_device_upload_atlas(img, w, h); - nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.null); + nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.tex_null); if(sfml.atlas.default_font) nk_style_set_font(&sfml.ctx, &sfml.atlas.default_font->handle); } diff --git a/demo/sfml_opengl3/nuklear_sfml_gl3.h b/demo/sfml_opengl3/nuklear_sfml_gl3.h index 0038b34..a601ce8 100644 --- a/demo/sfml_opengl3/nuklear_sfml_gl3.h +++ b/demo/sfml_opengl3/nuklear_sfml_gl3.h @@ -43,7 +43,7 @@ NK_API void nk_sfml_device_destroy(void); struct nk_sfml_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -353,7 +353,7 @@ nk_sfml_font_stash_end() int w, h; image = nk_font_atlas_bake(&sfml.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_sfml_device_upload_atlas(image, w, h); - nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.null); + nk_font_atlas_end(&sfml.atlas, nk_handle_id((int)sfml.ogl.font_tex), &sfml.ogl.tex_null); if(sfml.atlas.default_font) nk_style_set_font(&sfml.ctx, &sfml.atlas.default_font->handle); } diff --git a/demo/x11_opengl2/nuklear_xlib_gl2.h b/demo/x11_opengl2/nuklear_xlib_gl2.h index 9e1382e..209fa79 100644 --- a/demo/x11_opengl2/nuklear_xlib_gl2.h +++ b/demo/x11_opengl2/nuklear_xlib_gl2.h @@ -60,7 +60,7 @@ struct nk_x11_vertex { struct nk_x11_device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint font_tex; }; @@ -226,7 +226,7 @@ nk_x11_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&x11.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_x11_device_upload_atlas(image, w, h); - nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.null); + nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.tex_null); if (x11.atlas.default_font) nk_style_set_font(&x11.ctx, &x11.atlas.default_font->handle); } diff --git a/demo/x11_opengl3/nuklear_xlib_gl3.h b/demo/x11_opengl3/nuklear_xlib_gl3.h index 85ff2ae..e9d1fcc 100644 --- a/demo/x11_opengl3/nuklear_xlib_gl3.h +++ b/demo/x11_opengl3/nuklear_xlib_gl3.h @@ -173,7 +173,7 @@ struct nk_x11_device { struct opengl_info info; #endif struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -592,7 +592,7 @@ nk_x11_font_stash_end(void) const void *image; int w, h; image = nk_font_atlas_bake(&x11.atlas, &w, &h, NK_FONT_ATLAS_RGBA32); nk_x11_device_upload_atlas(image, w, h); - nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.null); + nk_font_atlas_end(&x11.atlas, nk_handle_id((int)x11.ogl.font_tex), &x11.ogl.tex_null); if (x11.atlas.default_font) nk_style_set_font(&x11.ctx, &x11.atlas.default_font->handle); } diff --git a/doc/index.html b/doc/index.html index bed7855..b967ac2 100644 --- a/doc/index.html +++ b/doc/index.html @@ -637,7 +637,7 @@ cfg.circle_segment_count = 22; cfg.curve_segment_count = 22; cfg.arc_segment_count = 22; cfg.global_alpha = 1.0f; -cfg.null = dev->null; +cfg.tex_null = dev->null; // // setup buffers and convert struct nk_buffer cmds, verts, idx; diff --git a/example/canvas.c b/example/canvas.c index d8a1534..d48e15c 100644 --- a/example/canvas.c +++ b/example/canvas.c @@ -52,7 +52,7 @@ struct nk_glfw_vertex { struct device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -441,7 +441,7 @@ int main(int argc, char *argv[]) font = nk_font_atlas_add_default(&atlas, 13, 0); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); - nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null); + nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null); nk_init_default(&ctx, &font->handle); glEnable(GL_TEXTURE_2D); diff --git a/example/extended.c b/example/extended.c index 41f2fa2..e12eef6 100644 --- a/example/extended.c +++ b/example/extended.c @@ -478,7 +478,7 @@ struct nk_glfw_vertex { struct device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -795,7 +795,7 @@ int main(int argc, char *argv[]) media.font_22 = nk_font_atlas_add_from_file(&atlas, "../../extra_font/Roboto-Regular.ttf", 22.0f, &cfg); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); - nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);} + nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null);} nk_init_default(&ctx, &media.font_14->handle);} /* icons */ diff --git a/example/file_browser.c b/example/file_browser.c index 60e6ac2..cd21f09 100644 --- a/example/file_browser.c +++ b/example/file_browser.c @@ -527,7 +527,7 @@ struct nk_glfw_vertex { struct device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -823,7 +823,7 @@ int main(int argc, char *argv[]) else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); - nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);} + nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null);} nk_init_default(&ctx, &font->handle);} /* icons */ diff --git a/example/skinning.c b/example/skinning.c index b54b03d..db365dc 100644 --- a/example/skinning.c +++ b/example/skinning.c @@ -79,7 +79,7 @@ struct nk_glfw_vertex { struct device { struct nk_buffer cmds; - struct nk_draw_null_texture null; + struct nk_draw_null_texture tex_null; GLuint vbo, vao, ebo; GLuint prog; GLuint vert_shdr; @@ -388,7 +388,7 @@ int main(int argc, char *argv[]) else font = nk_font_atlas_add_default(&atlas, 13.0f, NULL); image = nk_font_atlas_bake(&atlas, &w, &h, NK_FONT_ATLAS_RGBA32); device_upload_atlas(&device, image, w, h); - nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.null);} + nk_font_atlas_end(&atlas, nk_handle_id((int)device.font_tex), &device.tex_null);} nk_init_default(&ctx, &font->handle);} { /* skin */ diff --git a/nuklear.h b/nuklear.h index 90d8b2d..901d3e5 100644 --- a/nuklear.h +++ b/nuklear.h @@ -17703,20 +17703,20 @@ failed: } NK_API void nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture, - struct nk_draw_null_texture *null) + struct nk_draw_null_texture *tex_null) { int i = 0; struct nk_font *font_iter; NK_ASSERT(atlas); if (!atlas) { - if (!null) return; - null->texture = texture; - null->uv = nk_vec2(0.5f,0.5f); + if (!tex_null) return; + tex_null->texture = texture; + tex_null->uv = nk_vec2(0.5f,0.5f); } - if (null) { - null->texture = texture; - null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width; - null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height; + if (tex_null) { + tex_null->texture = texture; + tex_null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width; + tex_null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height; } for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) { font_iter->texture = texture; diff --git a/src/nuklear_font.c b/src/nuklear_font.c index 541bf48..e1ada96 100644 --- a/src/nuklear_font.c +++ b/src/nuklear_font.c @@ -1276,20 +1276,20 @@ failed: } NK_API void nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture, - struct nk_draw_null_texture *null) + struct nk_draw_null_texture *tex_null) { int i = 0; struct nk_font *font_iter; NK_ASSERT(atlas); if (!atlas) { - if (!null) return; - null->texture = texture; - null->uv = nk_vec2(0.5f,0.5f); + if (!tex_null) return; + tex_null->texture = texture; + tex_null->uv = nk_vec2(0.5f,0.5f); } - if (null) { - null->texture = texture; - null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width; - null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height; + if (tex_null) { + tex_null->texture = texture; + tex_null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width; + tex_null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height; } for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) { font_iter->texture = texture; From ca49016428aace2b19c30b87f8d2418bdfc755ca Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 30 Jul 2022 17:45:12 -0400 Subject: [PATCH 4/4] Rename more null variables to tex_null --- demo/glfw_opengl2/nuklear_glfw_gl2.h | 2 +- demo/glfw_opengl3/nuklear_glfw_gl3.h | 2 +- demo/glfw_opengl4/nuklear_glfw_gl4.h | 2 +- demo/sdl_opengl2/nuklear_sdl_gl2.h | 2 +- demo/sdl_opengl3/nuklear_sdl_gl3.h | 2 +- demo/sdl_opengles2/nuklear_sdl_gles2.h | 2 +- demo/sdl_renderer/nuklear_sdl_renderer.h | 2 +- demo/sfml_opengl2/nuklear_sfml_gl2.h | 2 +- demo/sfml_opengl3/nuklear_sfml_gl3.h | 2 +- demo/x11_opengl2/nuklear_xlib_gl2.h | 2 +- demo/x11_opengl3/nuklear_xlib_gl3.h | 2 +- doc/index.html | 2 +- example/canvas.c | 2 +- example/extended.c | 2 +- example/file_browser.c | 2 +- example/skinning.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/demo/glfw_opengl2/nuklear_glfw_gl2.h b/demo/glfw_opengl2/nuklear_glfw_gl2.h index 2706f11..fb8b31e 100644 --- a/demo/glfw_opengl2/nuklear_glfw_gl2.h +++ b/demo/glfw_opengl2/nuklear_glfw_gl2.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/glfw_opengl3/nuklear_glfw_gl3.h b/demo/glfw_opengl3/nuklear_glfw_gl3.h index a1e5d6c..663fa0b 100644 --- a/demo/glfw_opengl3/nuklear_glfw_gl3.h +++ b/demo/glfw_opengl3/nuklear_glfw_gl3.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/glfw_opengl4/nuklear_glfw_gl4.h b/demo/glfw_opengl4/nuklear_glfw_gl4.h index 683da8c..781bfc3 100644 --- a/demo/glfw_opengl4/nuklear_glfw_gl4.h +++ b/demo/glfw_opengl4/nuklear_glfw_gl4.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/sdl_opengl2/nuklear_sdl_gl2.h b/demo/sdl_opengl2/nuklear_sdl_gl2.h index eaa00e5..0c6a2fb 100644 --- a/demo/sdl_opengl2/nuklear_sdl_gl2.h +++ b/demo/sdl_opengl2/nuklear_sdl_gl2.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/sdl_opengl3/nuklear_sdl_gl3.h b/demo/sdl_opengl3/nuklear_sdl_gl3.h index 560ef69..cac8629 100644 --- a/demo/sdl_opengl3/nuklear_sdl_gl3.h +++ b/demo/sdl_opengl3/nuklear_sdl_gl3.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/sdl_opengles2/nuklear_sdl_gles2.h b/demo/sdl_opengles2/nuklear_sdl_gles2.h index 854c582..595d7a7 100644 --- a/demo/sdl_opengles2/nuklear_sdl_gles2.h +++ b/demo/sdl_opengles2/nuklear_sdl_gles2.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/sdl_renderer/nuklear_sdl_renderer.h b/demo/sdl_renderer/nuklear_sdl_renderer.h index be6f0aa..672b81b 100644 --- a/demo/sdl_renderer/nuklear_sdl_renderer.h +++ b/demo/sdl_renderer/nuklear_sdl_renderer.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/sfml_opengl2/nuklear_sfml_gl2.h b/demo/sfml_opengl2/nuklear_sfml_gl2.h index a848d27..f168bab 100644 --- a/demo/sfml_opengl2/nuklear_sfml_gl2.h +++ b/demo/sfml_opengl2/nuklear_sfml_gl2.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/sfml_opengl3/nuklear_sfml_gl3.h b/demo/sfml_opengl3/nuklear_sfml_gl3.h index a601ce8..286cfc1 100644 --- a/demo/sfml_opengl3/nuklear_sfml_gl3.h +++ b/demo/sfml_opengl3/nuklear_sfml_gl3.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/x11_opengl2/nuklear_xlib_gl2.h b/demo/x11_opengl2/nuklear_xlib_gl2.h index 209fa79..2ad2648 100644 --- a/demo/x11_opengl2/nuklear_xlib_gl2.h +++ b/demo/x11_opengl2/nuklear_xlib_gl2.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/demo/x11_opengl3/nuklear_xlib_gl3.h b/demo/x11_opengl3/nuklear_xlib_gl3.h index e9d1fcc..9dd0181 100644 --- a/demo/x11_opengl3/nuklear_xlib_gl3.h +++ b/demo/x11_opengl3/nuklear_xlib_gl3.h @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/doc/index.html b/doc/index.html index b967ac2..0312be3 100644 --- a/doc/index.html +++ b/doc/index.html @@ -637,7 +637,7 @@ cfg.circle_segment_count = 22; cfg.curve_segment_count = 22; cfg.arc_segment_count = 22; cfg.global_alpha = 1.0f; -cfg.tex_null = dev->null; +cfg.tex_null = dev->tex_null; // // setup buffers and convert struct nk_buffer cmds, verts, idx; diff --git a/example/canvas.c b/example/canvas.c index d48e15c..2456927 100644 --- a/example/canvas.c +++ b/example/canvas.c @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/example/extended.c b/example/extended.c index e12eef6..4e1211b 100644 --- a/example/extended.c +++ b/example/extended.c @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/example/file_browser.c b/example/file_browser.c index cd21f09..6bf23c2 100644 --- a/example/file_browser.c +++ b/example/file_browser.c @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22; diff --git a/example/skinning.c b/example/skinning.c index db365dc..fab9ce3 100644 --- a/example/skinning.c +++ b/example/skinning.c @@ -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.tex_null = dev->null; + config.tex_null = dev->tex_null; config.circle_segment_count = 22; config.curve_segment_count = 22; config.arc_segment_count = 22;