Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
69e1a47
Fixes the issue that font size is inconsistent.
olliwang Feb 10, 2020
b2337d9
Merge pull request #558 from olliwang/font
memononen Feb 10, 2020
8851f02
Support for loading a certain font face from a font file.
olliwang Feb 16, 2020
4ae538b
Merge pull request #559 from olliwang/font
memononen Feb 25, 2020
5a006cd
Pass fringe parameter to renderTriangles, fixes bad clipping of t…
olilarkin Feb 26, 2020
528dc4e
Fixes the issue that line gap may ruin the text layout.
olliwang Feb 28, 2020
f3825a0
Merge pull request #561 from olilarkin/rendertriangles_fringe
memononen Feb 28, 2020
c519ae5
Support for resetting fallback fonts.
olliwang Feb 25, 2020
492df63
Merge pull request #560 from olliwang/font
memononen Feb 28, 2020
79561dc
Fixes demo’s font sizes.
olliwang Feb 28, 2020
db50e12
Merge pull request #563 from olliwang/linegap
memononen Feb 28, 2020
6570b56
Merge pull request #564 from olliwang/demo
memononen Feb 28, 2020
d98041b
Bind a dummy texture in setUniforms when compiling with emscripten
olilarkin Mar 2, 2020
3e986cd
call glnvg__renderCreateTexture() in glnvg__renderCreate
olilarkin Mar 5, 2020
e281ffc
Fixed nvgTextBreakLines returning bad minx
memononen Mar 7, 2020
35dbc98
modify to use dummy texture even without emscripten
olilarkin Mar 6, 2020
bff4734
Merge pull request #567 from olilarkin/fix-webgl-warning
memononen Mar 11, 2020
426aa3f
Fix for #570: round glyph positions to pixels using floor
memononen Mar 18, 2020
52265fe
Fixed Signed/Unsigned Comparison Warning
geoffthemedio Mar 20, 2020
2bead03
Merge pull request #573 from geoffthemedio/patch-1
memononen Mar 20, 2020
4c7eb2f
Added a preprocessor definition to disable the use of stb_image + Add…
xqueezeme Sep 15, 2020
0fa06d9
Removed CMakeLists.txt
xqueezeme Sep 16, 2020
e628d62
Merge pull request #587 from christophe-f8/master
memononen Sep 16, 2020
30b9f3e
Squashed wonky FT kerning via FT_Load_Glyph flag FT_LOAD_TARGET_LIGHT
d4tocchini Oct 1, 2020
a90ccc2
Merge pull request #588 from d4tocchini/freetype-hint-fix
memononen Oct 1, 2020
fb78593
Single-byte typo fix
Iniquitatis Nov 5, 2020
c35e80c
Merge pull request #591 from Iniquitatis/patch-1
memononen Nov 5, 2020
621e0b8
Fixed text vanishing when the transform is vertically flipped
mulle-nat Dec 20, 2020
0faac6f
less whitespace
codeon-nat Dec 21, 2020
e906c5b
Merge pull request #601 from mulle-nat/fxingtabs
memononen Dec 21, 2020
0bfd2c2
New ci.yml. Build nanovg on every push on ubuntu.
mulle-nat Dec 25, 2020
077b65e
Merge pull request #604 from mulle-nat/ci
memononen Dec 25, 2020
ba85215
Update fontstash.h
mulle-nat Oct 31, 2021
e75cf72
Merge pull request #620 from mulle-nat/mulle-nat-patch-fonsDeleteInte…
memononen Nov 1, 2021
0b37350
Fixes FreeType errors when dealing with multiple NVGcontext objects.
olliwang Dec 2, 2021
645e914
Merge pull request #621 from olliwang/freetype
memononen Dec 2, 2021
2615db0
Fixes stbtt implemention.
olliwang Jan 9, 2022
5f65b43
Merge pull request #623 from olliwang/stbtt
memononen Jan 9, 2022
19ccd37
Fix GL3 example build. Add submodule deps
nidefawl Feb 10, 2022
6dde2b3
Add single CMakeLists.txt and fix MSVC build.
nidefawl Feb 10, 2022
29881ab
Add glad, use instead of glew.
nidefawl Feb 10, 2022
e847cb6
Keep exe in binary dir (MSVC)
nidefawl Feb 10, 2022
3a8bb9d
Enable VK_EXT_debug_utils validatino layer in DEBUG builds
nidefawl Feb 10, 2022
67f3a25
Fix stencil strokes
nidefawl Feb 10, 2022
ede605a
Render normal demo. Toggle stacked mode with spacebar
nidefawl Feb 10, 2022
63296d1
Fix warnings
nidefawl Feb 10, 2022
aeb045d
Always define build switches. Fixes toggling with CMAKE
nidefawl Feb 10, 2022
e88241e
Fix GL3 demo antialias
nidefawl Feb 10, 2022
cfc287e
Don't enable Validation Layer in debug builds.
nidefawl Feb 11, 2022
5e54ab7
Update examples cmake
nidefawl Feb 11, 2022
ce266ea
Vulkan performance improvements.
nidefawl Feb 11, 2022
0ef71b5
Merge branch 'master' of https://github.com/memononen/nanovg into upg…
nidefawl Feb 11, 2022
bddcb83
Merge latest nanovg
nidefawl Feb 11, 2022
5bb4852
Fix DEMO_STENCIL_STROKES in vulkan demo
nidefawl Feb 11, 2022
0ae220f
VK_ACCESS_NONE_KHR (0) is Vulkan 1.3
nidefawl Feb 11, 2022
4827a03
Fix MSAA flag in GL3
nidefawl Feb 12, 2022
95993ef
Whitespace
nidefawl Feb 12, 2022
d52aee4
Add cmake targets for GL2 and FBO examples
nidefawl Feb 12, 2022
6e08375
Disable CI
nidefawl Feb 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "glew-cmake"]
path = glew-cmake
url = https://github.com/Perlmint/glew-cmake
[submodule "glfw"]
path = glfw
url = https://github.com/glfw/glfw
25 changes: 0 additions & 25 deletions build_gl3/CMakeLists.txt

This file was deleted.

43 changes: 0 additions & 43 deletions build_vulkan/CMakeLists.txt

This file was deleted.

144 changes: 144 additions & 0 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
cmake_minimum_required(VERSION 3.1)

project(nanovg_example)

set (BUILD_SHARED_LIBS OFF)
set( GLFW_BUILD_DOCS OFF CACHE BOOL "" )
set( GLFW_BUILD_TESTS OFF CACHE BOOL "" )
set( GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" )
set( GLFW_BUILD_INSTALL OFF CACHE BOOL "" )

add_subdirectory(../glfw glfw)

option(BUILD_USE_GLAD "Use glad instead of glew" ON)

option(BUILD_EXAMPLE_FBO "Build FBO Example (GL3)" OFF)
option(BUILD_EXAMPLE_GL2 "Build Example using OpenGL2" OFF)
option(BUILD_EXAMPLE_GL3 "Build Example using OpenGL3" ON)
option(BUILD_EXAMPLE_VULKAN "Build Example using Vulkan" ON)

option(DEMO_ANTIALIAS "Use NVG_ANTIALIAS" ON)
option(DEMO_MSAA "Use MSAA instead of NVG_ANTIALIAS" OFF)
option(DEMO_STENCIL_STROKES "NVG_STENCIL_STROKES" ON)

add_compile_definitions(DEMO_MSAA=$<BOOL:${DEMO_MSAA}>)
add_compile_definitions(DEMO_ANTIALIAS=$<BOOL:${DEMO_ANTIALIAS}>)
add_compile_definitions(DEMO_STENCIL_STROKES=$<BOOL:${DEMO_STENCIL_STROKES}>)

set(COMMON_INCLUDE ../src)

set(COMMON_SRC
../src/fontstash.h
../src/nanovg.c
../src/nanovg.h
../src/stb_image.h
../src/stb_truetype.h
../src/nanovg.c
demo.c
perf.c
)


if (BUILD_EXAMPLE_VULKAN)

find_package(Vulkan)

if (Vulkan_FOUND)
message(STATUS "Vulkan found ${Vulkan_LIBRARIES}")
else()
message(FATAL "Vulkan not found")
endif()

add_executable(
example-vk
${COMMON_SRC}
../src/nanovg_vk.h
example_vulkan.c
vulkan_util.h
)

target_include_directories(example-vk PRIVATE ${COMMON_INCLUDE} ${Vulkan_INCLUDE_DIR})
target_compile_definitions(example-vk PRIVATE NANOVG_VULKAN_IMPLEMENTATION)
target_link_libraries(example-vk PRIVATE glfw ${Vulkan_LIBRARY})
endif()

set(GL_EXAMPLE_SRC
${COMMON_SRC}
../src/nanovg_gl.h
../src/nanovg_gl_utils.h
)
set(GL_EXAMPLE_LIBS glfw)
set(GL_EXAMPLE_INCLUDES ${COMMON_INCLUDE})

if (BUILD_EXAMPLE_GL3 OR BUILD_EXAMPLE_GL2)
if (BUILD_USE_GLAD)
set(GL_EXAMPLE_DEFS NANOVG_GLAD)
list(APPEND GL_EXAMPLE_SRC ../glad-3.2-compat/src/glad.c)
list(APPEND GL_EXAMPLE_INCLUDES ../glad-3.2-compat/include)
else()
# Build glew
set( ONLY_LIBS ON CACHE BOOL "" )
set( glew-cmake_BUILD_SHARED OFF CACHE BOOL "" )
set( glew-cmake_BUILD_STATIC ON CACHE BOOL "" )
set(GL_EXAMPLE_DEFS NANVG_GLEW)
add_subdirectory(glew-cmake glew)
list(APPEND GL_EXAMPLE_LIBS libglew_static)
endif()
endif()

if (BUILD_EXAMPLE_GL3)
add_executable(
example-gl3
example_gl3.c
${GL_EXAMPLE_SRC}
)
target_include_directories(example-gl3 PRIVATE ${GL_EXAMPLE_INCLUDES})
target_compile_definitions(example-gl3 PRIVATE ${GL_EXAMPLE_DEFS})
target_link_libraries(example-gl3 PRIVATE ${GL_EXAMPLE_LIBS})
endif()

if (BUILD_EXAMPLE_GL2)
add_executable(
example-gl2
example_gl2.c
${GL_EXAMPLE_SRC}
)
target_include_directories(example-gl2 PRIVATE ${GL_EXAMPLE_INCLUDES})
target_compile_definitions(example-gl2 PRIVATE ${GL_EXAMPLE_DEFS})
target_link_libraries(example-gl2 PRIVATE ${GL_EXAMPLE_LIBS})
endif()

if (BUILD_EXAMPLE_FBO)
add_executable(
example-fbo
example_fbo.c
${GL_EXAMPLE_SRC}
)
target_include_directories(example-fbo PRIVATE ${GL_EXAMPLE_INCLUDES})
target_compile_definitions(example-fbo PRIVATE ${GL_EXAMPLE_DEFS})
target_link_libraries(example-fbo PRIVATE ${GL_EXAMPLE_LIBS})
endif()

if (MSVC)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS )
set_source_files_properties(
example_vulkan.c
example_gl3.c
example_gl2.c
example_fbo.c
demo.c
PROPERTIES COMPILE_FLAGS
/wd4244
)
set(BUILD_EXE_POSTFIX "-$<LOWER_CASE:${CMAKE_CXX_COMPILER_ID}-$<CONFIG>>" CACHE STRING "Append to executable name")

set(ALL_TARGETS example-vk example-gl3 example-gl2)
foreach(TARGET_NAME ${ALL_TARGETS})
if (TARGET ${TARGET_NAME})
set_property(TARGET ${TARGET_NAME} PROPERTY OUTPUT_NAME ${TARGET_NAME}${BUILD_EXE_POSTFIX})
set_property(TARGET ${TARGET_NAME} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}$<0:...>)
endif()
endforeach()
endif()

set(CMAKE_VERBOSE_MAKEFILE ON)
Loading