├── .github
└── FUNDING.yml
├── .gitignore
├── .gitmodules
├── LICENSE
├── README.md
├── Startup.bat
├── generateprojects.bat
├── sharpmakes
├── APIProject.cs
├── DemoProject.cs
├── common.cs
└── main.cs
├── src
├── api
│ ├── dear_widgets.cpp
│ └── dear_widgets.h
└── demo
│ ├── demo.cpp
│ └── demo.h
└── workingdir
├── IconsFontAwesome6.h
├── IconsFontAwesome6Brands.h
├── astro.png
├── camera-542784_1280.png
├── clock.png
├── fa-brands-400.ttf
├── fa-regular-400.ttf
├── fa-solid-900.ttf
├── generate_glsl.bat
├── generate_msl.bat
├── generate_shaders_all.bat
├── generate_wgpu.bat
├── generate_wgsl.bat
├── img_000.png
├── imgui.ini
├── man.png
├── pexels-fotoaibe-1571453.jpg
├── pexels-robert-bogdan-156165-1152351.jpg
├── shader_ps.hlsl
├── shader_vs.hlsl
└── shaders
├── glsl
├── markers_ps.glsl
└── markers_vs.glsl
├── hlsl_src
└── markers.hlsl
├── msl
├── markers_ps.msl
└── markers_vs.msl
├── wgpu
├── markers_ps.wgpu
└── markers_vs.wgpu
└── wgsl
├── markers_ps.wgsl
└── markers_vs.wgsl
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4 | patreon: SoufianeKHIAT
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
13 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Compiled Object files
5 | *.slo
6 | *.lo
7 | *.o
8 | *.obj
9 |
10 | # Precompiled Headers
11 | *.gch
12 | *.pch
13 |
14 | # Compiled Dynamic libraries
15 | *.so
16 | *.dylib
17 | *.dll
18 |
19 | # Fortran module files
20 | *.mod
21 | *.smod
22 |
23 | # Compiled Static libraries
24 | *.lai
25 | *.la
26 | *.a
27 | *.lib
28 |
29 | # Executables
30 | *.exe
31 | *.out
32 | *.app
33 | .vs
34 | projects
35 | *.sln
36 | *.pdb
37 | WorkingDir/dearwidgetsdemo.map
38 | tmp
39 | sharpmakes/bin
40 | workingdir/bin/slang
41 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "extern/Sharpmake"]
2 | path = extern/Sharpmake
3 | url = https://github.com/ubisoft/Sharpmake.git
4 | [submodule "extern/imgui"]
5 | path = extern/imgui
6 | url = https://github.com/ocornut/imgui.git
7 | [submodule "extern/FiraCode"]
8 | path = extern/FiraCode
9 | url = https://github.com/tonsky/FiraCode
10 | [submodule "extern/ImPlatform"]
11 | path = extern/ImPlatform
12 | url = https://github.com/soufianekhiat/ImPlatform.git
13 | [submodule "extern/stb"]
14 | path = extern/stb
15 | url = https://github.com/nothings/stb.git
16 | [submodule "extern/IconFontCppHeaders"]
17 | path = extern/IconFontCppHeaders
18 | url = https://github.com/juliettef/IconFontCppHeaders.git
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Creative Commons Legal Code
2 |
3 | CC0 1.0 Universal
4 |
5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
12 | HEREUNDER.
13 |
14 | Statement of Purpose
15 |
16 | The laws of most jurisdictions throughout the world automatically confer
17 | exclusive Copyright and Related Rights (defined below) upon the creator
18 | and subsequent owner(s) (each and all, an "owner") of an original work of
19 | authorship and/or a database (each, a "Work").
20 |
21 | Certain owners wish to permanently relinquish those rights to a Work for
22 | the purpose of contributing to a commons of creative, cultural and
23 | scientific works ("Commons") that the public can reliably and without fear
24 | of later claims of infringement build upon, modify, incorporate in other
25 | works, reuse and redistribute as freely as possible in any form whatsoever
26 | and for any purposes, including without limitation commercial purposes.
27 | These owners may contribute to the Commons to promote the ideal of a free
28 | culture and the further production of creative, cultural and scientific
29 | works, or to gain reputation or greater distribution for their Work in
30 | part through the use and efforts of others.
31 |
32 | For these and/or other purposes and motivations, and without any
33 | expectation of additional consideration or compensation, the person
34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she
35 | is an owner of Copyright and Related Rights in the Work, voluntarily
36 | elects to apply CC0 to the Work and publicly distribute the Work under its
37 | terms, with knowledge of his or her Copyright and Related Rights in the
38 | Work and the meaning and intended legal effect of CC0 on those rights.
39 |
40 | 1. Copyright and Related Rights. A Work made available under CC0 may be
41 | protected by copyright and related or neighboring rights ("Copyright and
42 | Related Rights"). Copyright and Related Rights include, but are not
43 | limited to, the following:
44 |
45 | i. the right to reproduce, adapt, distribute, perform, display,
46 | communicate, and translate a Work;
47 | ii. moral rights retained by the original author(s) and/or performer(s);
48 | iii. publicity and privacy rights pertaining to a person's image or
49 | likeness depicted in a Work;
50 | iv. rights protecting against unfair competition in regards to a Work,
51 | subject to the limitations in paragraph 4(a), below;
52 | v. rights protecting the extraction, dissemination, use and reuse of data
53 | in a Work;
54 | vi. database rights (such as those arising under Directive 96/9/EC of the
55 | European Parliament and of the Council of 11 March 1996 on the legal
56 | protection of databases, and under any national implementation
57 | thereof, including any amended or successor version of such
58 | directive); and
59 | vii. other similar, equivalent or corresponding rights throughout the
60 | world based on applicable law or treaty, and any national
61 | implementations thereof.
62 |
63 | 2. Waiver. To the greatest extent permitted by, but not in contravention
64 | of, applicable law, Affirmer hereby overtly, fully, permanently,
65 | irrevocably and unconditionally waives, abandons, and surrenders all of
66 | Affirmer's Copyright and Related Rights and associated claims and causes
67 | of action, whether now known or unknown (including existing as well as
68 | future claims and causes of action), in the Work (i) in all territories
69 | worldwide, (ii) for the maximum duration provided by applicable law or
70 | treaty (including future time extensions), (iii) in any current or future
71 | medium and for any number of copies, and (iv) for any purpose whatsoever,
72 | including without limitation commercial, advertising or promotional
73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
74 | member of the public at large and to the detriment of Affirmer's heirs and
75 | successors, fully intending that such Waiver shall not be subject to
76 | revocation, rescission, cancellation, termination, or any other legal or
77 | equitable action to disrupt the quiet enjoyment of the Work by the public
78 | as contemplated by Affirmer's express Statement of Purpose.
79 |
80 | 3. Public License Fallback. Should any part of the Waiver for any reason
81 | be judged legally invalid or ineffective under applicable law, then the
82 | Waiver shall be preserved to the maximum extent permitted taking into
83 | account Affirmer's express Statement of Purpose. In addition, to the
84 | extent the Waiver is so judged Affirmer hereby grants to each affected
85 | person a royalty-free, non transferable, non sublicensable, non exclusive,
86 | irrevocable and unconditional license to exercise Affirmer's Copyright and
87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the
88 | maximum duration provided by applicable law or treaty (including future
89 | time extensions), (iii) in any current or future medium and for any number
90 | of copies, and (iv) for any purpose whatsoever, including without
91 | limitation commercial, advertising or promotional purposes (the
92 | "License"). The License shall be deemed effective as of the date CC0 was
93 | applied by Affirmer to the Work. Should any part of the License for any
94 | reason be judged legally invalid or ineffective under applicable law, such
95 | partial invalidity or ineffectiveness shall not invalidate the remainder
96 | of the License, and in such case Affirmer hereby affirms that he or she
97 | will not (i) exercise any of his or her remaining Copyright and Related
98 | Rights in the Work or (ii) assert any associated claims and causes of
99 | action with respect to the Work, in either case contrary to Affirmer's
100 | express Statement of Purpose.
101 |
102 | 4. Limitations and Disclaimers.
103 |
104 | a. No trademark or patent rights held by Affirmer are waived, abandoned,
105 | surrendered, licensed or otherwise affected by this document.
106 | b. Affirmer offers the Work as-is and makes no representations or
107 | warranties of any kind concerning the Work, express, implied,
108 | statutory or otherwise, including without limitation warranties of
109 | title, merchantability, fitness for a particular purpose, non
110 | infringement, or the absence of latent or other defects, accuracy, or
111 | the present or absence of errors, whether or not discoverable, all to
112 | the greatest extent permissible under applicable law.
113 | c. Affirmer disclaims responsibility for clearing rights of other persons
114 | that may apply to the Work or any use thereof, including without
115 | limitation any person's Copyright and Related Rights in the Work.
116 | Further, Affirmer disclaims responsibility for obtaining any necessary
117 | consents, permissions or other rights required for any use of the
118 | Work.
119 | d. Affirmer understands and acknowledges that Creative Commons is not a
120 | party to this document and has no duty or obligation with respect to
121 | this CC0 or use of the Work.
122 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # DearWidgets
2 | DearWidgets aim to produce useful Widgets particulary useful on Graphics (Image Processing, 3D, ...).
3 | DearWidgets aim to provide helper to simplify creation of custom widgets.
4 |
5 | DearWidgets is 6 collections of helpers:
6 | - DrawLists
7 | - Interactions
8 | - Widgets
9 | - Math Helpers
10 | - 'Shape' (2D Geometry)
11 | - Helpers to have type independent "Scalar"
12 |
13 | Dear Widgets is a collection of help to simplify the develoment of application.
14 |
15 | DearWidgets add some helpers which allow us to create Custom Widget independently of the try. A Scalar is stored as an ImU64, which is a memcpy of any type supported by ImGui {Im{U|S}{8, 16, 32, 64} | bool | float | double}.
16 | * bool IsNegativeScalar
17 | * void EqualScalar
18 | * float ScalarToFloat
19 | * ImU64 FloatToScalar
20 | * ImU64 AddScalar
21 | * ImU64 SubScalar
22 | * ImU64 MulScalar
23 | * ImU64 DivScalar
24 | * ImU64 Normalize01
25 | * ...
26 |
27 | DearWidgets is using ImPlatform.
28 |
29 | ### Incentivise development:
30 |
31 | [
](https://www.patreon.com/SoufianeKHIAT)
32 |
33 | https://www.patreon.com/SoufianeKHIAT
34 |
35 | PR & Discussion are open.
36 |
37 | ## What's new?
38 |
39 | ### More linked to DearImGui styles:
40 | 
41 |
42 | ### Interactions
43 |
44 | * Is Hovered
45 |
46 | Convex
47 | ```cpp
48 | bool IsPolyConvexContains( ImVec2* pts, int pts_count, ImVec2 p );
49 | bool IsMouseHoveringPolyConvex( const ImVec2& r_min, const ImVec2& r_max, ImVec2* pts, int pts_count, bool clip = true );
50 | bool ItemHoverablePolyConvex( const ImRect& bb, ImGuiID id, ImVec2* pts, int pts_count, ImGuiItemFlags item_flags );
51 | ```
52 |
53 |
54 | Concave
55 | ```cpp
56 | bool IsPolyConcaveContains( ImVec2* pts, int pts_count, ImVec2 p );
57 | bool IsMouseHoveringPolyConcave( const ImVec2& r_min, const ImVec2& r_max, ImVec2* pts, int pts_count, bool clip = true );
58 | bool ItemHoverablePolyConcave( const ImRect& bb, ImGuiID id, ImVec2* pts, int pts_count, ImGuiItemFlags item_flags );
59 | ```
60 |
61 |
62 | With Hole (warning rely on 'thick' scanline)
63 | ```cpp
64 | bool IsPolyWithHoleContains( ImVec2* pts, int pts_count, ImVec2 p, ImRect* p_bb = NULL, int gap = 1, int strokeWidth = 1 );
65 | bool IsMouseHoveringPolyWithHole( const ImVec2& r_min, const ImVec2& r_max, ImVec2* pts, int pts_count, bool clip = true );
66 | bool ItemHoverablePolyWithHole( const ImRect& bb, ImGuiID id, ImVec2* pts, int pts_count, ImGuiItemFlags item_flags );
67 | ```
68 |
69 |
70 | ### Window
71 |
72 | * Background
73 | ```cpp
74 | void SetCurrentWindowBackgroundImage( ImTextureID id, ImVec2 imgSize, bool fixedSize = false, ImU32 col = IM_COL32( 255, 255, 255, 255 ) );
75 | ```
76 |
77 |
78 | ### DrawList
79 | * Triangle Pointer
80 |
81 | Used internally for HueSelector
82 | ```cpp
83 | void DrawTriangleCursor( ImDrawList* pDrawList, ImVec2 targetPoint, float angle, float size, float thickness, ImU32 col );
84 | void DrawTriangleCursorFilled( ImDrawList* pDrawList, ImVec2 targetPoint, float angle, float size, ImU32 col );
85 | ```
86 |
87 |
88 | * Signet Pointer
89 | ```cpp
90 | void DrawSignetCursor( ImDrawList* pDrawList, ImVec2 targetPoint, float width, float height, float height_ratio, float align01, float angle, float thickness, ImU32 col );
91 | void DrawSignetFilledCursor( ImDrawList* pDrawList, ImVec2 targetPoint, float width, float height, float height_ratio, float align01, float angle, ImU32 col );
92 | ```
93 |
94 |
95 | * Hue Band
96 | * Luminance Band
97 | * Saturation Band
98 |
99 | Used Internally to implement HueSelector.
100 |
101 | ```cpp
102 | void DrawHueBand( ImDrawList* pDrawList, ImVec2 const vpos, ImVec2 const size, int division, float alpha, float gamma, float offset );
103 | void DrawHueBand( ImDrawList* pDrawList, ImVec2 const vpos, ImVec2 const size, int division, float colorStartRGB[ 3 ], float alpha, float gamma );
104 | void DrawLumianceBand( ImDrawList* pDrawList, ImVec2 const vpos, ImVec2 const size, int division, ImVec4 const& color, float gamma );
105 | void DrawSaturationBand( ImDrawList* pDrawList, ImVec2 const vpos, ImVec2 const size, int division, ImVec4 const& color, float gamma );
106 | ```
107 |
108 |
109 | * Graduations
110 |
111 | Linear Line
112 | ```cpp
113 | void DrawLinearLineGraduation( ImDrawList* drawlist, ImVec2 start, ImVec2 end, float mainLineThickness, ImU32 mainCol,
114 | int division0, float height0, float thickness0, float angle0, ImU32 col0,
115 | int division1 = -1, float height1 = -1.0f, float thickness1 = -1.0f, float angle1 = -1.0f, ImU32 col1 = 0u,
116 | int division2 = -1, float height2 = -1.0f, float thickness2 = -1.0f, float angle2 = -1.0f, ImU32 col2 = 0u );
117 | ```
118 |
119 |
120 | Linear Circular
121 | ```cpp
122 | void DrawLinearCircularGraduation( ImDrawList* drawlist, ImVec2 center, float radius, float start_angle, float end_angle, int num_segments,
123 | float mainLineThickness, ImU32 mainCol,
124 | int division0, float height0, float thickness0, float angle0, ImU32 col0,
125 | int division1 = -1, float height1 = -1.0f, float thickness1 = -1.0f, float angle1 = -1.0f, ImU32 col1 = 0u,
126 | int division2 = -1, float height2 = -1.0f, float thickness2 = -1.0f, float angle2 = -1.0f, ImU32 col2 = 0u );
127 | ```
128 |
129 |
130 | Log Line
131 | ```cpp
132 | void DrawLogLineGraduation( ImDrawList* drawlist, ImVec2 start, ImVec2 end,
133 | float mainLineThickness, ImU32 mainCol,
134 | int division0, float height0, float thickness0, float angle0, ImU32 col0,
135 | int division1 = -1, float height1 = -1.0f, float thickness1 = -1.0f, float angle1 = -1.0f, ImU32 col1 = 0u );
136 | ```
137 |
138 |
139 | Log Circular
140 | ```cpp
141 | void DrawLogCircularGraduation( ImDrawList* drawlist, ImVec2 center, float radius, float start_angle, float end_angle, int num_segments,
142 | float mainLineThickness, ImU32 mainCol,
143 | int division0, float height0, float thickness0, float angle0, ImU32 col0,
144 | int division1 = -1, float height1 = -1.0f, float thickness1 = -1.0f, float angle1 = -1.0f, ImU32 col1 = 0u );
145 | ```
146 |
147 |
148 | * Shape
149 |
150 | Tesselation:
151 | ```cpp
152 | #ifdef DEAR_WIDGETS_TESSELATION
153 | void ShapeTesselationUniform( ImShape& shape );
154 | #endif
155 | ```
156 |
157 |
158 | ```cpp
159 | void DrawImageShape( ImDrawList* pDrawList, ImTextureID tex, ImShape& shape );
160 | ```
161 | Convex
162 |
163 |
164 | Concave
165 |
166 |
167 | ** Gradients
168 |
169 | Linear
170 | ```cpp
171 | void ShapeSRGBLinearGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
172 | void ShapeOkLabLinearGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
173 | void ShapeOkLchLinearGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
174 | void ShapeLinearSRGBLinearGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
175 | void ShapeHSVLinearGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
176 | ```
177 |
178 |
179 |
180 | Radial
181 | ```cpp
182 | void ShapeSRGBRadialGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
183 | void ShapeOkLabRadialGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
184 | void ShapeOkLchRadialGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
185 | void ShapeLinearSRGBRadialGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
186 | void ShapeHSVRadialGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
187 | ```
188 |
189 |
190 | Diamond
191 | ```cpp
192 | void ShapeSRGBDiamondGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
193 | void ShapeOkLabDiamondGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
194 | void ShapeOkLchDiamondGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
195 | void ShapeLinearSRGBDiamondGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
196 | void ShapeHSVDiamondGradient( ImShape& shape, ImVec2 uv_start, ImVec2 uv_end, ImU32 col0, ImU32 col1 );
197 | ```
198 |
199 |
200 | * Color Ring
201 |
202 | TODO: Ring HueSelector
203 |
204 | TODO: Add support for 2D (angle, radius)
205 |
206 | ```cpp
207 | void DrawColorRing( ImDrawList* pDrawList, ImVec2 const curPos, ImVec2 const size, float thickness_, ImColor1DCallback func, void* pUserData, int division, float colorOffset, bool bIsBilinear );
208 | ```
209 |
210 |
211 | * Custom Color Ring
212 |
213 |
214 |
215 | * Chromatic Plot{Bilinear, Nearest}
216 | * Chromatic Point
217 | * Chromatic Line
218 |
219 | ```cpp
220 | void DrawChromaticityPlot( ... );
221 | ```
222 |
223 |
224 |
225 |
226 | ```cpp
227 | void DrawChromaticityPoints( ... );
228 | void DrawChromaticityLines( ... );
229 | ```
230 |
231 |
232 | * DrawColorDensityPlot (aka ShaderToy)
233 |
234 | Use carefully that can have impact on your performances for HighRes canvas or/and expensive lambda.
235 |
236 | ```cpp
237 | void DrawProceduralColor2DNearest( ImDrawList* pDrawList, ImColor2DCallback func, void* pUserData, float minX, float maxX, float minY, float maxY, ImVec2 position, ImVec2 size, int resolutionX, int resolutionY );
238 | void DrawProceduralColor2DBilinear( ImDrawList* pDrawList, ImColor2DCallback func, void* pUserData, float minX, float maxX, float minY, float maxY, ImVec2 position, ImVec2 size, int resolutionX, int resolutionY );
239 | ```
240 |
241 |
242 |
243 |
244 | ### Widgets
245 |
246 | * Button
247 |
248 | Convex
249 | ```cpp
250 | bool ButtonBehaviorConvex( ImVec2* pts, int pts_count, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags );
251 | ```
252 |
253 |
254 | Concave
255 | ```cpp
256 | bool ButtonBehaviorConcave( ImVec2* pts, int pts_count, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags );
257 | ```
258 |
259 |
260 | With Hole
261 | ```cpp
262 | bool ButtonBehaviorWithHole( ImVec2* pts, int pts_count, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags );
263 | ```
264 |
265 |
266 | * Hue Selector
267 |
268 | ```cpp
269 | bool HueSelector( char const* label, float hueHeight, float cursorHeight, float* hueCenter, float* hueWidth, float* featherLeft, float* featherRight, int division = 32, float alpha = 1.0f, float hideHueAlpha = 0.75f, float offset = 0.0f );
270 | ```
271 |
272 |
273 | * Slider 2D Float
274 | A version for Slider2DScaler is available for (Im{S|U}{8,16,32,64}, Float and Double)
275 |
276 | ```cpp
277 | bool Slider2DScalar( char const* pLabel, ImGuiDataType data_type, void* pValueX, void* pValueY, void* p_minX, void* p_maxX, void* p_minY, void* p_maxY );
278 | bool Slider2DFloat( char const* pLabel, float* pValueX, float* pValueY, float v_minX, float v_maxX, float v_minY, float v_maxY );
279 | ```
280 |
281 |
282 | * Slider 2D Int
283 |
284 | ```cpp
285 | bool Slider2DInt( char const* pLabel, int* pValueX, void* pValueY, int v_minX, int v_maxX, int v_minY, int v_maxY );
286 | ```
287 |
288 |
289 | * SliderN
290 | ```cpp
291 | bool SliderNScalar( char const* label, ImGuiDataType data_type, void* ordered_value, int value_count, void* p_min, void* p_max, float cursor_width, bool show_hover_by_region );
292 | bool SliderNFloat( char const* label, ImGuiDataType data_type, float* ordered_value, int value_count, float v_min, float v_max, float cursor_width, bool show_hover_by_region );
293 | bool SliderNInt( char const* label, ImGuiDataType data_type, int* ordered_value, int value_count, int v_min, int v_max, float cursor_width, bool show_hover_by_region );
294 | ```
295 | 
296 |
297 | ## Performance Considerations
298 | Notice some DrawList are purely calling DrawList from Dear ImGui. So based on your parameters a non-negligeable impact on performance can be notice. Do not put an unreasonable resolution.
299 |
300 | The Gradient rely on the vertex blending with the default shader. So to have a smooth gradient it may require lot of vertices via tesselation, that may impact performance and limit of vertices and imply a use of ImDrawIdx in 32 bits.
301 |
302 | ## Constrains
303 | C++ features (optionaly) **used** internally:
304 | * std::map used for ImTesselator can be enabled with #define DEAR_WIDGETS_TESSELATION
305 |
306 | ## Legacy
307 | **Removed** feature:
308 | * AnalyticalPlotEx
309 | * AnalyticalPlot Just explode the number of vertices
310 | * CenterNextItem
311 | * DragFloatLog TBD
312 | * RangeSelect2D didn't find a proper control
313 | * Slider3D no real use case
314 |
315 | **Removed** C++ feature dependencies:
316 | * template
317 | * constexpr
318 | * if constexpr
319 | * Lambda from template
320 | * auto
321 | * std::vector<float>, std::vector<bool> for isoline
322 |
323 | ## Contributor
324 | Future feature:
325 | * Add more color space for gradient
326 | * Hue Ring select
327 | * Slider2DWithRingConstraint // Only only a circular region on the 2D selector
328 | * InputFloatUnit cf. History of Dear Widgets
329 | * Add Shape from SDF with ImShader cd ImPlatform (only if IM_SUPPORT_CUSTOM_SHADER)
330 | * Guizmo2D{Translate, Rotate, Scale}
331 | * Gauge
332 |
--------------------------------------------------------------------------------
/Startup.bat:
--------------------------------------------------------------------------------
1 | @ECHO OFF
2 | xcopy extern\Sharpmake\Sharpmake\bin\Release\net6.0\*.* sharpmakes\bin\*.*
3 | xcopy extern\Sharpmake\Sharpmake.Generators\bin\Release\net6.0\*.* sharpmakes\bin\*.*
4 | xcopy extern\Sharpmake\Sharpmake.Generators\bin\Release\net6.0\*.* sharpmakes\bin\*.*
5 | xcopy extern\Sharpmake\Sharpmake.Platforms\Sharpmake.CommonPlatforms\bin\Release\net6.0\*.* sharpmakes\bin\*.*
6 | xcopy extern\Sharpmake\Sharpmake.Application\bin\Release\net6.0\*.* sharpmakes\bin\*.*
7 |
--------------------------------------------------------------------------------
/generateprojects.bat:
--------------------------------------------------------------------------------
1 | .\sharpmakes\bin\Sharpmake.Application.exe /sources( @'./sharpmakes/main.cs' ) /verbose
--------------------------------------------------------------------------------
/sharpmakes/APIProject.cs:
--------------------------------------------------------------------------------
1 | using Sharpmake;
2 |
3 | [module: Sharpmake.Include("common.cs")]
4 |
5 | namespace DearWidgets
6 | {
7 | [Sharpmake.Generate]
8 | public class APIProject : CommonProject
9 | {
10 | public APIProject()
11 | {
12 | Name = "DearWidgets";
13 | SourceRootPath = RootPath + @"\src\api";
14 | }
15 |
16 | [Configure()]
17 | public void ConfigureAPI(Configuration conf, DearTarget target)
18 | {
19 | conf.Output = Configuration.OutputType.Lib;
20 | //conf.AddPrivateDependency(target);
21 | //conf.AddPrivateDependency(target);
22 |
23 | //conf.Defines.Add("IMGUI_DEFINE_MATH_OPERATORS");
24 | //conf.IncludePaths.Add(@"[project.RootPath]/extern/Clipper/cpp/");
25 | //conf.IncludePaths.Add(@"[project.ExternPath]/glad/include");
26 | conf.IncludePaths.Add(@"[project.RootPath]/extern/ImPlatform/ImPlatform/");
27 | }
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/sharpmakes/DemoProject.cs:
--------------------------------------------------------------------------------
1 | using Sharpmake;
2 |
3 | [module: Sharpmake.Include("common.cs")]
4 |
5 | [module: Sharpmake.Include("APIProject.cs")]
6 |
7 | namespace DearWidgets
8 | {
9 | [Sharpmake.Generate]
10 | public class DemoProject : CommonProject
11 | {
12 | public DemoProject()
13 | {
14 | Name = "DearWidgetsDemo";
15 | SourceRootPath = RootPath + @"\src\demo";
16 |
17 | SourceFiles.Add("[project.ExternPath]/imgui/imgui.cpp");
18 | SourceFiles.Add("[project.ExternPath]/imgui/imgui_tables.cpp");
19 | SourceFiles.Add("[project.ExternPath]/imgui/imgui_widgets.cpp");
20 | SourceFiles.Add("[project.ExternPath]/imgui/misc/cpp/imgui_stdlib.cpp");
21 | SourceFiles.Add("[project.ExternPath]/imgui/imgui_draw.cpp");
22 | SourceFiles.Add("[project.ExternPath]/ImPlatform/ImPlatform/ImPlatform.h");
23 | }
24 |
25 | [Configure()]
26 | public void ConfigureDemo(Configuration conf, DearTarget target)
27 | {
28 | conf.Output = Configuration.OutputType.Exe;
29 | conf.AddPrivateDependency(target);
30 | conf.TargetPath = RootPath + "/WorkingDir";
31 |
32 | conf.IncludePaths.Add(@"[project.RootPath]/src/demo/");
33 | conf.IncludePaths.Add(@"[project.RootPath]/extern/stb/");
34 | conf.IncludePaths.Add(@"[project.RootPath]/extern/imgui/");
35 | conf.IncludePaths.Add(@"[project.RootPath]/extern/imgui/examples/libs/glfw/include/");
36 | conf.LibraryPaths.Add(@"[project.RootPath]/extern/imgui/examples/libs/glfw/");
37 | conf.IncludePaths.Add(@"[project.RootPath]/extern/imgui/backends/");
38 | conf.IncludePaths.Add(@"[project.RootPath]/extern/ImPlatform/ImPlatform/");
39 | //conf.IncludePrivatePaths.Add(@"[project.RootPath]\codebase\SpanMultipleSrcDirs\dir_individual_files");
40 | //conf.AddPrivateDependency(target);
41 |
42 | //if (target.Api == TargetAPI.D3D9)
43 | //{
44 | // conf.LibraryFiles.Add("opengl32.lib");
45 | //}
46 | //if (target.Api == TargetAPI.D3D9)
47 | //{
48 | // conf.LibraryFiles.Add("d3d9.lib");
49 | //}
50 | //if (target.Api == TargetAPI.D3D10)
51 | //{
52 | // conf.LibraryFiles.Add("d3d10.lib");
53 | // conf.LibraryFiles.Add("d3dcompiler.lib");
54 | // conf.LibraryFiles.Add("dxgi.lib");
55 | //}
56 | //if (target.Api == TargetAPI.D3D11)
57 | //{
58 | // conf.LibraryFiles.Add("d3d11.lib");
59 | // conf.LibraryFiles.Add("d3dcompiler.lib");
60 | // conf.LibraryFiles.Add("dxgi.lib");
61 | //}
62 | //if (target.Api == TargetAPI.D3D11)
63 | //{
64 | // conf.LibraryFiles.Add("d3d12.lib");
65 | // conf.LibraryFiles.Add("d3dcompiler.lib");
66 | // conf.LibraryFiles.Add("dxgi.lib");
67 | //}
68 |
69 | conf.VcxprojUserFile = new Configuration.VcxprojUserFileSettings();
70 | conf.VcxprojUserFile.LocalDebuggerWorkingDirectory = @"[project.RootPath]/WorkingDir/";
71 | //@"$(SolutionDir)WorkingDir";
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/sharpmakes/common.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Sharpmake;
3 | using Microsoft.Win32;
4 | using System.IO;
5 | using System.Collections.Generic;
6 |
7 | namespace DearWidgets
8 | {
9 | static class Extern
10 | {
11 | static public string RootPath = @"[project.SharpmakeCsPath]";
12 | static public string ExternPath = RootPath + @"\extern";
13 | }
14 |
15 | [Fragment, Flags]
16 | public enum TargetAPI
17 | {
18 | D3D9 = (1 << 0),
19 | D3D10 = (1 << 1),
20 | D3D11 = (1 << 2),
21 | D3D12 = (1 << 3),
22 | Vulkan = (1 << 4),
23 | OpenGL2 = (1 << 5),
24 | OpenGL3 = (1 << 6),
25 | Metal = (1 << 7),
26 | WGPU = (1 << 8),
27 | }
28 |
29 | [Fragment, Flags]
30 | public enum BuildType
31 | {
32 | APIOnly = (1 << 0),
33 | DemoOnly = (1 << 1),
34 | Full = (1 << 2)
35 | }
36 |
37 | public class DearTarget : Target
38 | {
39 | public DearTarget()
40 | : base()
41 | { }
42 |
43 | public DearTarget(Platform platform, TargetAPI api, Optimization optimization, BuildType buildType)
44 | : base(platform, DevEnv.vs2022, optimization)
45 | {
46 | Api = api;
47 | Build = buildType;
48 | }
49 |
50 | public TargetAPI Api;
51 | public BuildType Build;
52 | }
53 |
54 | public class CommonSolution : Sharpmake.Solution
55 | {
56 | public string SolutionRootPath = @"[solution.SharpmakeCsPath]\..";
57 |
58 | public CommonSolution()
59 | : base( typeof( DearTarget ) )
60 | { }
61 | }
62 |
63 | public class CommonProject : Sharpmake.Project
64 | {
65 | public string ProjectRootPath = @"[project.SharpmakeCsPath]\..";
66 | public string TmpPath = @"[project.RootPath]\tmp";
67 | public string ExternPath = @"[project.RootPath]\extern";
68 | public string ProjectsPath = @"[project.RootPath]\projects";
69 | public string OutputPath = @"[project.RootPath]\WorkingDir";
70 |
71 | public CommonProject()
72 | : base( typeof( DearTarget ) )
73 | {
74 | RootPath = ProjectRootPath;
75 | CustomProperties.Add( "VcpkgEnabled", "false" );
76 |
77 | AddTargets(new DearTarget( Platform.win64 | Platform.linux,// | Platform.mac,
78 | TargetAPI.OpenGL3 | TargetAPI.D3D9 | TargetAPI.D3D10 | TargetAPI.D3D11 | TargetAPI.D3D12,
79 | Optimization.Debug | Optimization.Release,
80 | BuildType.APIOnly | BuildType.DemoOnly | BuildType.Full ) );
81 | }
82 |
83 | [Configure()]
84 | public virtual void ConfigureAll(Configuration conf, DearTarget target)
85 | {
86 | AddPlatformSourceExclusion(conf, target);
87 |
88 | conf.Name = "[target.Api]_[target.Optimization]";
89 | conf.ProjectFileName = "[project.Name]_[target.DevEnv]_[target.Platform]";
90 | conf.ProjectPath = ProjectsPath + @"\[target.Platform]\[target.Build]\[project.Name]";
91 | conf.IntermediatePath = @"[project.TmpPath]\[target.Api]\[target.Platform]\[project.Name]\[target.Optimization]";
92 | conf.TargetPath = @"[project.OutputPath]";
93 | conf.TargetLibraryPath = @"[project.RootPath]\tmp\lib\[target.Platform]_[target.Api]_[target.Optimization]";
94 |
95 | conf.IncludePaths.Add(@"[project.RootPath]\src\api");
96 | conf.IncludePaths.Add(@"[project.RootPath]\");
97 | conf.IncludePaths.Add(@"[project.ExternPath]");
98 |
99 | conf.Defines.Add("ImDrawIdx=ImU32");
100 | conf.Defines.Add("IMGUI_DEFINE_MATH_OPERATORS");
101 | conf.Defines.Add("IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
102 | conf.Defines.Add( "NOMINMAX" );
103 | conf.Defines.Add( "DEAR_WIDGETS_TESSELATION" );
104 | //conf.IncludePaths.Add(@"[project.ExternPath]/imgui/");
105 | conf.IncludePaths.Add(@"[project.RootPath]/extern/imgui/");
106 | conf.IncludePaths.Add(@"[project.ExternPath]/glad/include");
107 |
108 | //conf.Defines.Add("_CRT_SECURE_NO_WARNINGS");
109 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.Inline.Disable);
110 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.CppLanguageStandard.Latest);
111 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.CompileAsWinRT.Disable);
112 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.RTTI.Disable);
113 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.FloatingPointExceptions.Disable);
114 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.FloatingPointModel.Fast);
115 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.EnhancedInstructionSet.AdvancedVectorExtensions);
116 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.Exceptions.Enable);
117 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.Intrinsic.Enable);
118 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.ConformanceMode.Enable);
119 |
120 | conf.AdditionalCompilerOptions.Add("/Zo");
121 | conf.Options.Add(new Sharpmake.Options.Vc.Librarian.DisableSpecificWarnings(
122 | "4221" // This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
123 | ));
124 |
125 | //conf.Options.Add(new Sharpmake.Options.Vc.Compiler.DisableSpecificWarnings(
126 | // //"4100", // unreferenced formal parameter
127 | // "4324" // structure was padded due to alignment specifier
128 | // ));
129 |
130 |
131 | if (target.Optimization == Optimization.Debug)
132 | conf.Defines.Add("__DEAR_DEBUG__");
133 | else
134 | conf.Defines.Add("__DEAR_RELEASE__");
135 | //conf.Defines.Add("ImDrawIdx=unsigned int");
136 | if (target.Platform == Platform.win64)
137 | {
138 | if (target.Optimization == Optimization.Debug)
139 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.RuntimeLibrary.MultiThreadedDebug);
140 | else
141 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.RuntimeLibrary.MultiThreaded);
142 | }
143 |
144 | if (target.Platform == Platform.win64)
145 | //conf.Options.Add(Sharpmake.Options.Vc.General.NativeEnvironment.Enable);
146 | conf.Options.Add(Options.Vc.General.PreferredToolArchitecture.x64);
147 | }
148 |
149 | [Configure(Platform.mac)]
150 | public virtual void ConfigureMax(Configuration conf, DearTarget target)
151 | {
152 | conf.Defines.Add("__DEAR_MAC__");
153 | }
154 |
155 | [Configure(Platform.linux)]
156 | public virtual void ConfigureLinux(Configuration conf, DearTarget target)
157 | {
158 | conf.Defines.Add("__DEAR_LINUX__");
159 | }
160 |
161 | [Configure(Platform.win64)]
162 | public virtual void ConfigureWindows(Configuration conf, DearTarget target)
163 | {
164 | conf.Defines.Add("__DEAR_WIN__");
165 | conf.LibraryFiles.Add("Wtsapi32"); // Enables applications to receive WTS messages from windows
166 | conf.AdditionalLinkerOptions.Add("/ignore:4098,4099,4217,4221");
167 | conf.Defines.Add("WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP");
168 | conf.Defines.Add("_WIN32_WINNT=0x0600");
169 | conf.Options.Add(Sharpmake.Options.Vc.Linker.RandomizedBaseAddress.Disable);
170 | conf.LibraryFiles.Add("winmm.lib");
171 | conf.LibraryFiles.Add("comctl32.lib");
172 | conf.LibraryFiles.Add("msvcrt.lib");
173 | conf.LibraryFiles.Add("msvcmrt.lib");
174 | conf.Defines.Add("_CRT_SECURE_NO_WARNINGS");
175 | }
176 |
177 | [Configure(Optimization.Debug)]//, ConfigurePriority(2)]
178 | public virtual void ConfigureDebug(Configuration conf, DearTarget target)
179 | {
180 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.Inline.Disable);
181 | }
182 |
183 | [Configure(Optimization.Release)]//, ConfigurePriority(3)]
184 | public virtual void ConfigureRelease(Configuration conf, DearTarget target)
185 | {
186 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.Optimization.MaximizeSpeed);
187 | conf.Options.Add(Sharpmake.Options.Vc.General.WholeProgramOptimization.LinkTime);
188 | conf.Options.Add(Sharpmake.Options.Vc.Linker.LinkTimeCodeGeneration.UseLinkTimeCodeGeneration);
189 | conf.Options.Add(Sharpmake.Options.Vc.Linker.EnableCOMDATFolding.RemoveRedundantCOMDATs);
190 | conf.Options.Add(Sharpmake.Options.Vc.Linker.Reference.EliminateUnreferencedData);
191 | }
192 |
193 | [Configure(TargetAPI.D3D9)]
194 | public virtual void ConfigureD3D9(Configuration conf, DearTarget target)
195 | {
196 | conf.Defines.Add("__DEAR_GFX_DX9__");
197 | }
198 |
199 | [Configure(TargetAPI.D3D10)]
200 | public virtual void ConfigureD3D10(Configuration conf, DearTarget target)
201 | {
202 | conf.Defines.Add("__DEAR_GFX_DX10__");
203 | }
204 |
205 | [Configure(TargetAPI.D3D11)]
206 | public virtual void ConfigureD3D11(Configuration conf, DearTarget target)
207 | {
208 | conf.Defines.Add("__DEAR_GFX_DX11__");
209 | }
210 |
211 | [Configure(TargetAPI.D3D12)]
212 | public virtual void ConfigureD3D12(Configuration conf, DearTarget target)
213 | {
214 | conf.Defines.Add("__DEAR_GFX_DX12__");
215 | }
216 |
217 | [Configure(TargetAPI.OpenGL2)]
218 | public virtual void ConfigureOpenGL2(Configuration conf, DearTarget target)
219 | {
220 | conf.Defines.Add("__DEAR_GFX_OGL2__");
221 | }
222 |
223 | [Configure(TargetAPI.OpenGL3)]
224 | public virtual void ConfigureOpenGL3(Configuration conf, DearTarget target)
225 | {
226 | conf.Defines.Add("__DEAR_GFX_OGL3__");
227 | }
228 |
229 | [Configure(TargetAPI.Vulkan)]
230 | public virtual void ConfigureVulkan(Configuration conf, DearTarget target)
231 | {
232 | conf.Defines.Add("__DEAR_GFX_VULKAN__");
233 | }
234 |
235 | [Configure(TargetAPI.Metal)]
236 | public virtual void ConfigureMetal(Configuration conf, DearTarget target)
237 | {
238 | conf.Defines.Add("__DEAR_METAL__");
239 | }
240 |
241 | [Configure(TargetAPI.WGPU)]
242 | public virtual void ConfigureWGPU(Configuration conf, DearTarget target)
243 | {
244 | conf.Defines.Add("__DEAR_WGPU__");
245 | }
246 |
247 | void AddPlatformSourceExclusion(Configuration conf, DearTarget target)
248 | {
249 | var excludedFileSuffixes = new List< string >();
250 | var excludedFolders = new List< string >();
251 |
252 | if (target.Api != TargetAPI.D3D12)
253 | {
254 | excludedFileSuffixes.Add("dx12");
255 | //excludedFolders.Add("dx12");
256 | }
257 |
258 | if (target.Api != TargetAPI.Vulkan)
259 | {
260 | excludedFileSuffixes.Add("vulkan");
261 | //excludedFolders.Add("vulkan");
262 | }
263 |
264 | if (target.Api != TargetAPI.D3D11)
265 | {
266 | excludedFileSuffixes.Add("dx11");
267 | //excludedFolders.Add("dx11");
268 | }
269 |
270 | if (target.Api != TargetAPI.OpenGL3)
271 | {
272 | excludedFileSuffixes.Add("opengl3");
273 | //excludedFolders.Add("opengl3");
274 | }
275 |
276 | if (target.Api != TargetAPI.WGPU)
277 | {
278 | excludedFileSuffixes.Add("wgpu");
279 | //excludedFolders.Add("wgpu");
280 | }
281 |
282 | conf.SourceFilesBuildExcludeRegex.Add(@"\.*_(" + string.Join("|", excludedFileSuffixes.ToArray()) + @")\.cpp$");
283 | //conf.SourceFilesBuildExcludeRegex.Add(@"\.*_(" + string.Join("|", excludedFileSuffixes.ToArray()) + @")\.h$");
284 | //conf.SourceFilesBuildExcludeRegex.Add(@"\.*\\(" + string.Join("|", excludedFolders.ToArray()) + @")\\");
285 | }
286 |
287 | [Configure(OutputType.Lib)]
288 | public virtual void OutputTypeLib(Configuration conf, DearTarget target)
289 | {
290 | if (target.Platform == Platform.win64)
291 | {
292 | if (target.Optimization == Optimization.Debug)
293 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.RuntimeLibrary.MultiThreadedDebug);
294 | else
295 | conf.Options.Add(Sharpmake.Options.Vc.Compiler.RuntimeLibrary.MultiThreaded);
296 | }
297 |
298 | if (target.Platform == Platform.win64)
299 | //conf.Options.Add(Sharpmake.Options.Vc.General.NativeEnvironment.Enable);
300 | conf.Options.Add(Options.Vc.General.PreferredToolArchitecture.x64);
301 | }
302 | }
303 | }
304 |
--------------------------------------------------------------------------------
/sharpmakes/main.cs:
--------------------------------------------------------------------------------
1 | using Sharpmake;
2 |
3 | [module: Sharpmake.Include("common.cs")]
4 |
5 | [module: Sharpmake.Include("APIProject.cs")]
6 | [module: Sharpmake.Include("DemoProject.cs")]
7 |
8 | namespace DearWidgets
9 | {
10 | [Sharpmake.Generate]
11 | public class DearWidgetsSolution : CommonSolution
12 | {
13 | public DearWidgetsSolution()
14 | {
15 | Name = "DearWidgets";
16 | //AddTargets(new DearTarget(Platform.linux,// | Platform.mac,
17 | // TargetAPI.OpenGL3,
18 | // Optimization.Debug | Optimization.Release,
19 | // BuildType.APIOnly | BuildType.DemoOnly | BuildType.Full));
20 |
21 | AddTargets(new DearTarget(Platform.win64,// | Platform.mac,
22 | TargetAPI.OpenGL3 | TargetAPI.D3D9 | TargetAPI.D3D10 | TargetAPI.D3D11 | TargetAPI.D3D12,
23 | Optimization.Debug | Optimization.Release,
24 | BuildType.APIOnly | BuildType.DemoOnly | BuildType.Full));
25 | }
26 |
27 | [Configure()]
28 | public void ConfigureAll(Configuration conf, DearTarget target)
29 | {
30 | conf.Name = "[target.Api]_[target.Optimization]";
31 |
32 | //conf.SolutionFileName = "[solution.Name]_[target.Build]_[target.Platform]_[target.Api]";
33 | conf.SolutionFileName = "[solution.Name]_[target.Build]";
34 |
35 | conf.SolutionPath = SolutionRootPath;
36 |
37 | if (target.Build == BuildType.APIOnly || target.Build == BuildType.Full)
38 | {
39 | conf.AddProject< APIProject >(target);
40 | }
41 | if (target.Build == BuildType.DemoOnly || target.Build == BuildType.Full)
42 | {
43 | conf.AddProject< DemoProject >(target);
44 | }
45 | }
46 | }
47 |
48 | public class Main
49 | {
50 | [Sharpmake.Main]
51 | public static void SharpmakeMain(Sharpmake.Arguments arguments)
52 | {
53 | Sharpmake.KitsRootPaths.SetUseKitsRootForDevEnv(DevEnv.vs2022, KitsRootEnum.KitsRoot10, Sharpmake.Options.Vc.General.WindowsTargetPlatformVersion.Latest);
54 |
55 | arguments.Generate();
56 | }
57 | }
58 | }
59 |
60 |
--------------------------------------------------------------------------------
/src/demo/demo.h:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | namespace ImWidgets {
4 | void ShowDemo();
5 | void ShowSamples();
6 | }
7 |
--------------------------------------------------------------------------------
/workingdir/IconsFontAwesome6Brands.h:
--------------------------------------------------------------------------------
1 | // Generated by https://github.com/juliettef/IconFontCppHeaders script GenerateIconFontCppHeaders.py
2 | // for C and C++
3 | // from codepoints https://github.com/FortAwesome/Font-Awesome/raw/6.x/metadata/icons.yml
4 | // for use with font https://github.com/FortAwesome/Font-Awesome/blob/6.x/webfonts/fa-brands-400.ttf
5 |
6 | #pragma once
7 |
8 | #define FONT_ICON_FILE_NAME_FAB "fa-brands-400.ttf"
9 |
10 | #define ICON_MIN_FAB 0xe007
11 | #define ICON_MAX_16_FAB 0xf8e8
12 | #define ICON_MAX_FAB 0xf8e8
13 |
14 | #define ICON_FA_42_GROUP "\xee\x82\x80" // U+e080
15 | #define ICON_FA_500PX "\xef\x89\xae" // U+f26e
16 | #define ICON_FA_ACCESSIBLE_ICON "\xef\x8d\xa8" // U+f368
17 | #define ICON_FA_ACCUSOFT "\xef\x8d\xa9" // U+f369
18 | #define ICON_FA_ADN "\xef\x85\xb0" // U+f170
19 | #define ICON_FA_ADVERSAL "\xef\x8d\xaa" // U+f36a
20 | #define ICON_FA_AFFILIATETHEME "\xef\x8d\xab" // U+f36b
21 | #define ICON_FA_AIRBNB "\xef\xa0\xb4" // U+f834
22 | #define ICON_FA_ALGOLIA "\xef\x8d\xac" // U+f36c
23 | #define ICON_FA_ALIPAY "\xef\x99\x82" // U+f642
24 | #define ICON_FA_AMAZON "\xef\x89\xb0" // U+f270
25 | #define ICON_FA_AMAZON_PAY "\xef\x90\xac" // U+f42c
26 | #define ICON_FA_AMILIA "\xef\x8d\xad" // U+f36d
27 | #define ICON_FA_ANDROID "\xef\x85\xbb" // U+f17b
28 | #define ICON_FA_ANGELLIST "\xef\x88\x89" // U+f209
29 | #define ICON_FA_ANGRYCREATIVE "\xef\x8d\xae" // U+f36e
30 | #define ICON_FA_ANGULAR "\xef\x90\xa0" // U+f420
31 | #define ICON_FA_APP_STORE "\xef\x8d\xaf" // U+f36f
32 | #define ICON_FA_APP_STORE_IOS "\xef\x8d\xb0" // U+f370
33 | #define ICON_FA_APPER "\xef\x8d\xb1" // U+f371
34 | #define ICON_FA_APPLE "\xef\x85\xb9" // U+f179
35 | #define ICON_FA_APPLE_PAY "\xef\x90\x95" // U+f415
36 | #define ICON_FA_ARTSTATION "\xef\x9d\xba" // U+f77a
37 | #define ICON_FA_ASYMMETRIK "\xef\x8d\xb2" // U+f372
38 | #define ICON_FA_ATLASSIAN "\xef\x9d\xbb" // U+f77b
39 | #define ICON_FA_AUDIBLE "\xef\x8d\xb3" // U+f373
40 | #define ICON_FA_AUTOPREFIXER "\xef\x90\x9c" // U+f41c
41 | #define ICON_FA_AVIANEX "\xef\x8d\xb4" // U+f374
42 | #define ICON_FA_AVIATO "\xef\x90\xa1" // U+f421
43 | #define ICON_FA_AWS "\xef\x8d\xb5" // U+f375
44 | #define ICON_FA_BANDCAMP "\xef\x8b\x95" // U+f2d5
45 | #define ICON_FA_BATTLE_NET "\xef\xa0\xb5" // U+f835
46 | #define ICON_FA_BEHANCE "\xef\x86\xb4" // U+f1b4
47 | #define ICON_FA_BILIBILI "\xee\x8f\x99" // U+e3d9
48 | #define ICON_FA_BIMOBJECT "\xef\x8d\xb8" // U+f378
49 | #define ICON_FA_BITBUCKET "\xef\x85\xb1" // U+f171
50 | #define ICON_FA_BITCOIN "\xef\x8d\xb9" // U+f379
51 | #define ICON_FA_BITY "\xef\x8d\xba" // U+f37a
52 | #define ICON_FA_BLACK_TIE "\xef\x89\xbe" // U+f27e
53 | #define ICON_FA_BLACKBERRY "\xef\x8d\xbb" // U+f37b
54 | #define ICON_FA_BLOGGER "\xef\x8d\xbc" // U+f37c
55 | #define ICON_FA_BLOGGER_B "\xef\x8d\xbd" // U+f37d
56 | #define ICON_FA_BLUESKY "\xee\x99\xb1" // U+e671
57 | #define ICON_FA_BLUETOOTH "\xef\x8a\x93" // U+f293
58 | #define ICON_FA_BLUETOOTH_B "\xef\x8a\x94" // U+f294
59 | #define ICON_FA_BOOTSTRAP "\xef\xa0\xb6" // U+f836
60 | #define ICON_FA_BOTS "\xee\x8d\x80" // U+e340
61 | #define ICON_FA_BRAVE "\xee\x98\xbc" // U+e63c
62 | #define ICON_FA_BRAVE_REVERSE "\xee\x98\xbd" // U+e63d
63 | #define ICON_FA_BTC "\xef\x85\x9a" // U+f15a
64 | #define ICON_FA_BUFFER "\xef\xa0\xb7" // U+f837
65 | #define ICON_FA_BUROMOBELEXPERTE "\xef\x8d\xbf" // U+f37f
66 | #define ICON_FA_BUY_N_LARGE "\xef\xa2\xa6" // U+f8a6
67 | #define ICON_FA_BUYSELLADS "\xef\x88\x8d" // U+f20d
68 | #define ICON_FA_CANADIAN_MAPLE_LEAF "\xef\x9e\x85" // U+f785
69 | #define ICON_FA_CC_AMAZON_PAY "\xef\x90\xad" // U+f42d
70 | #define ICON_FA_CC_AMEX "\xef\x87\xb3" // U+f1f3
71 | #define ICON_FA_CC_APPLE_PAY "\xef\x90\x96" // U+f416
72 | #define ICON_FA_CC_DINERS_CLUB "\xef\x89\x8c" // U+f24c
73 | #define ICON_FA_CC_DISCOVER "\xef\x87\xb2" // U+f1f2
74 | #define ICON_FA_CC_JCB "\xef\x89\x8b" // U+f24b
75 | #define ICON_FA_CC_MASTERCARD "\xef\x87\xb1" // U+f1f1
76 | #define ICON_FA_CC_PAYPAL "\xef\x87\xb4" // U+f1f4
77 | #define ICON_FA_CC_STRIPE "\xef\x87\xb5" // U+f1f5
78 | #define ICON_FA_CC_VISA "\xef\x87\xb0" // U+f1f0
79 | #define ICON_FA_CENTERCODE "\xef\x8e\x80" // U+f380
80 | #define ICON_FA_CENTOS "\xef\x9e\x89" // U+f789
81 | #define ICON_FA_CHROME "\xef\x89\xa8" // U+f268
82 | #define ICON_FA_CHROMECAST "\xef\xa0\xb8" // U+f838
83 | #define ICON_FA_CLOUDFLARE "\xee\x81\xbd" // U+e07d
84 | #define ICON_FA_CLOUDSCALE "\xef\x8e\x83" // U+f383
85 | #define ICON_FA_CLOUDSMITH "\xef\x8e\x84" // U+f384
86 | #define ICON_FA_CLOUDVERSIFY "\xef\x8e\x85" // U+f385
87 | #define ICON_FA_CMPLID "\xee\x8d\xa0" // U+e360
88 | #define ICON_FA_CODEPEN "\xef\x87\x8b" // U+f1cb
89 | #define ICON_FA_CODIEPIE "\xef\x8a\x84" // U+f284
90 | #define ICON_FA_CONFLUENCE "\xef\x9e\x8d" // U+f78d
91 | #define ICON_FA_CONNECTDEVELOP "\xef\x88\x8e" // U+f20e
92 | #define ICON_FA_CONTAO "\xef\x89\xad" // U+f26d
93 | #define ICON_FA_COTTON_BUREAU "\xef\xa2\x9e" // U+f89e
94 | #define ICON_FA_CPANEL "\xef\x8e\x88" // U+f388
95 | #define ICON_FA_CREATIVE_COMMONS "\xef\x89\x9e" // U+f25e
96 | #define ICON_FA_CREATIVE_COMMONS_BY "\xef\x93\xa7" // U+f4e7
97 | #define ICON_FA_CREATIVE_COMMONS_NC "\xef\x93\xa8" // U+f4e8
98 | #define ICON_FA_CREATIVE_COMMONS_NC_EU "\xef\x93\xa9" // U+f4e9
99 | #define ICON_FA_CREATIVE_COMMONS_NC_JP "\xef\x93\xaa" // U+f4ea
100 | #define ICON_FA_CREATIVE_COMMONS_ND "\xef\x93\xab" // U+f4eb
101 | #define ICON_FA_CREATIVE_COMMONS_PD "\xef\x93\xac" // U+f4ec
102 | #define ICON_FA_CREATIVE_COMMONS_PD_ALT "\xef\x93\xad" // U+f4ed
103 | #define ICON_FA_CREATIVE_COMMONS_REMIX "\xef\x93\xae" // U+f4ee
104 | #define ICON_FA_CREATIVE_COMMONS_SA "\xef\x93\xaf" // U+f4ef
105 | #define ICON_FA_CREATIVE_COMMONS_SAMPLING "\xef\x93\xb0" // U+f4f0
106 | #define ICON_FA_CREATIVE_COMMONS_SAMPLING_PLUS "\xef\x93\xb1" // U+f4f1
107 | #define ICON_FA_CREATIVE_COMMONS_SHARE "\xef\x93\xb2" // U+f4f2
108 | #define ICON_FA_CREATIVE_COMMONS_ZERO "\xef\x93\xb3" // U+f4f3
109 | #define ICON_FA_CRITICAL_ROLE "\xef\x9b\x89" // U+f6c9
110 | #define ICON_FA_CSS3 "\xef\x84\xbc" // U+f13c
111 | #define ICON_FA_CSS3_ALT "\xef\x8e\x8b" // U+f38b
112 | #define ICON_FA_CUTTLEFISH "\xef\x8e\x8c" // U+f38c
113 | #define ICON_FA_D_AND_D "\xef\x8e\x8d" // U+f38d
114 | #define ICON_FA_D_AND_D_BEYOND "\xef\x9b\x8a" // U+f6ca
115 | #define ICON_FA_DAILYMOTION "\xee\x81\x92" // U+e052
116 | #define ICON_FA_DASHCUBE "\xef\x88\x90" // U+f210
117 | #define ICON_FA_DEBIAN "\xee\x98\x8b" // U+e60b
118 | #define ICON_FA_DEEZER "\xee\x81\xb7" // U+e077
119 | #define ICON_FA_DELICIOUS "\xef\x86\xa5" // U+f1a5
120 | #define ICON_FA_DEPLOYDOG "\xef\x8e\x8e" // U+f38e
121 | #define ICON_FA_DESKPRO "\xef\x8e\x8f" // U+f38f
122 | #define ICON_FA_DEV "\xef\x9b\x8c" // U+f6cc
123 | #define ICON_FA_DEVIANTART "\xef\x86\xbd" // U+f1bd
124 | #define ICON_FA_DHL "\xef\x9e\x90" // U+f790
125 | #define ICON_FA_DIASPORA "\xef\x9e\x91" // U+f791
126 | #define ICON_FA_DIGG "\xef\x86\xa6" // U+f1a6
127 | #define ICON_FA_DIGITAL_OCEAN "\xef\x8e\x91" // U+f391
128 | #define ICON_FA_DISCORD "\xef\x8e\x92" // U+f392
129 | #define ICON_FA_DISCOURSE "\xef\x8e\x93" // U+f393
130 | #define ICON_FA_DOCHUB "\xef\x8e\x94" // U+f394
131 | #define ICON_FA_DOCKER "\xef\x8e\x95" // U+f395
132 | #define ICON_FA_DRAFT2DIGITAL "\xef\x8e\x96" // U+f396
133 | #define ICON_FA_DRIBBBLE "\xef\x85\xbd" // U+f17d
134 | #define ICON_FA_DROPBOX "\xef\x85\xab" // U+f16b
135 | #define ICON_FA_DRUPAL "\xef\x86\xa9" // U+f1a9
136 | #define ICON_FA_DYALOG "\xef\x8e\x99" // U+f399
137 | #define ICON_FA_EARLYBIRDS "\xef\x8e\x9a" // U+f39a
138 | #define ICON_FA_EBAY "\xef\x93\xb4" // U+f4f4
139 | #define ICON_FA_EDGE "\xef\x8a\x82" // U+f282
140 | #define ICON_FA_EDGE_LEGACY "\xee\x81\xb8" // U+e078
141 | #define ICON_FA_ELEMENTOR "\xef\x90\xb0" // U+f430
142 | #define ICON_FA_ELLO "\xef\x97\xb1" // U+f5f1
143 | #define ICON_FA_EMBER "\xef\x90\xa3" // U+f423
144 | #define ICON_FA_EMPIRE "\xef\x87\x91" // U+f1d1
145 | #define ICON_FA_ENVIRA "\xef\x8a\x99" // U+f299
146 | #define ICON_FA_ERLANG "\xef\x8e\x9d" // U+f39d
147 | #define ICON_FA_ETHEREUM "\xef\x90\xae" // U+f42e
148 | #define ICON_FA_ETSY "\xef\x8b\x97" // U+f2d7
149 | #define ICON_FA_EVERNOTE "\xef\xa0\xb9" // U+f839
150 | #define ICON_FA_EXPEDITEDSSL "\xef\x88\xbe" // U+f23e
151 | #define ICON_FA_FACEBOOK "\xef\x82\x9a" // U+f09a
152 | #define ICON_FA_FACEBOOK_F "\xef\x8e\x9e" // U+f39e
153 | #define ICON_FA_FACEBOOK_MESSENGER "\xef\x8e\x9f" // U+f39f
154 | #define ICON_FA_FANTASY_FLIGHT_GAMES "\xef\x9b\x9c" // U+f6dc
155 | #define ICON_FA_FEDEX "\xef\x9e\x97" // U+f797
156 | #define ICON_FA_FEDORA "\xef\x9e\x98" // U+f798
157 | #define ICON_FA_FIGMA "\xef\x9e\x99" // U+f799
158 | #define ICON_FA_FIREFOX "\xef\x89\xa9" // U+f269
159 | #define ICON_FA_FIREFOX_BROWSER "\xee\x80\x87" // U+e007
160 | #define ICON_FA_FIRST_ORDER "\xef\x8a\xb0" // U+f2b0
161 | #define ICON_FA_FIRST_ORDER_ALT "\xef\x94\x8a" // U+f50a
162 | #define ICON_FA_FIRSTDRAFT "\xef\x8e\xa1" // U+f3a1
163 | #define ICON_FA_FLICKR "\xef\x85\xae" // U+f16e
164 | #define ICON_FA_FLIPBOARD "\xef\x91\x8d" // U+f44d
165 | #define ICON_FA_FLY "\xef\x90\x97" // U+f417
166 | #define ICON_FA_FONT_AWESOME "\xef\x8a\xb4" // U+f2b4
167 | #define ICON_FA_FONTICONS "\xef\x8a\x80" // U+f280
168 | #define ICON_FA_FONTICONS_FI "\xef\x8e\xa2" // U+f3a2
169 | #define ICON_FA_FORT_AWESOME "\xef\x8a\x86" // U+f286
170 | #define ICON_FA_FORT_AWESOME_ALT "\xef\x8e\xa3" // U+f3a3
171 | #define ICON_FA_FORUMBEE "\xef\x88\x91" // U+f211
172 | #define ICON_FA_FOURSQUARE "\xef\x86\x80" // U+f180
173 | #define ICON_FA_FREE_CODE_CAMP "\xef\x8b\x85" // U+f2c5
174 | #define ICON_FA_FREEBSD "\xef\x8e\xa4" // U+f3a4
175 | #define ICON_FA_FULCRUM "\xef\x94\x8b" // U+f50b
176 | #define ICON_FA_GALACTIC_REPUBLIC "\xef\x94\x8c" // U+f50c
177 | #define ICON_FA_GALACTIC_SENATE "\xef\x94\x8d" // U+f50d
178 | #define ICON_FA_GET_POCKET "\xef\x89\xa5" // U+f265
179 | #define ICON_FA_GG "\xef\x89\xa0" // U+f260
180 | #define ICON_FA_GG_CIRCLE "\xef\x89\xa1" // U+f261
181 | #define ICON_FA_GIT "\xef\x87\x93" // U+f1d3
182 | #define ICON_FA_GIT_ALT "\xef\xa1\x81" // U+f841
183 | #define ICON_FA_GITHUB "\xef\x82\x9b" // U+f09b
184 | #define ICON_FA_GITHUB_ALT "\xef\x84\x93" // U+f113
185 | #define ICON_FA_GITKRAKEN "\xef\x8e\xa6" // U+f3a6
186 | #define ICON_FA_GITLAB "\xef\x8a\x96" // U+f296
187 | #define ICON_FA_GITTER "\xef\x90\xa6" // U+f426
188 | #define ICON_FA_GLIDE "\xef\x8a\xa5" // U+f2a5
189 | #define ICON_FA_GLIDE_G "\xef\x8a\xa6" // U+f2a6
190 | #define ICON_FA_GOFORE "\xef\x8e\xa7" // U+f3a7
191 | #define ICON_FA_GOLANG "\xee\x90\x8f" // U+e40f
192 | #define ICON_FA_GOODREADS "\xef\x8e\xa8" // U+f3a8
193 | #define ICON_FA_GOODREADS_G "\xef\x8e\xa9" // U+f3a9
194 | #define ICON_FA_GOOGLE "\xef\x86\xa0" // U+f1a0
195 | #define ICON_FA_GOOGLE_DRIVE "\xef\x8e\xaa" // U+f3aa
196 | #define ICON_FA_GOOGLE_PAY "\xee\x81\xb9" // U+e079
197 | #define ICON_FA_GOOGLE_PLAY "\xef\x8e\xab" // U+f3ab
198 | #define ICON_FA_GOOGLE_PLUS "\xef\x8a\xb3" // U+f2b3
199 | #define ICON_FA_GOOGLE_PLUS_G "\xef\x83\x95" // U+f0d5
200 | #define ICON_FA_GOOGLE_SCHOLAR "\xee\x98\xbb" // U+e63b
201 | #define ICON_FA_GOOGLE_WALLET "\xef\x87\xae" // U+f1ee
202 | #define ICON_FA_GRATIPAY "\xef\x86\x84" // U+f184
203 | #define ICON_FA_GRAV "\xef\x8b\x96" // U+f2d6
204 | #define ICON_FA_GRIPFIRE "\xef\x8e\xac" // U+f3ac
205 | #define ICON_FA_GRUNT "\xef\x8e\xad" // U+f3ad
206 | #define ICON_FA_GUILDED "\xee\x81\xbe" // U+e07e
207 | #define ICON_FA_GULP "\xef\x8e\xae" // U+f3ae
208 | #define ICON_FA_HACKER_NEWS "\xef\x87\x94" // U+f1d4
209 | #define ICON_FA_HACKERRANK "\xef\x97\xb7" // U+f5f7
210 | #define ICON_FA_HASHNODE "\xee\x92\x99" // U+e499
211 | #define ICON_FA_HIPS "\xef\x91\x92" // U+f452
212 | #define ICON_FA_HIRE_A_HELPER "\xef\x8e\xb0" // U+f3b0
213 | #define ICON_FA_HIVE "\xee\x81\xbf" // U+e07f
214 | #define ICON_FA_HOOLI "\xef\x90\xa7" // U+f427
215 | #define ICON_FA_HORNBILL "\xef\x96\x92" // U+f592
216 | #define ICON_FA_HOTJAR "\xef\x8e\xb1" // U+f3b1
217 | #define ICON_FA_HOUZZ "\xef\x89\xbc" // U+f27c
218 | #define ICON_FA_HTML5 "\xef\x84\xbb" // U+f13b
219 | #define ICON_FA_HUBSPOT "\xef\x8e\xb2" // U+f3b2
220 | #define ICON_FA_IDEAL "\xee\x80\x93" // U+e013
221 | #define ICON_FA_IMDB "\xef\x8b\x98" // U+f2d8
222 | #define ICON_FA_INSTAGRAM "\xef\x85\xad" // U+f16d
223 | #define ICON_FA_INSTALOD "\xee\x82\x81" // U+e081
224 | #define ICON_FA_INTERCOM "\xef\x9e\xaf" // U+f7af
225 | #define ICON_FA_INTERNET_EXPLORER "\xef\x89\xab" // U+f26b
226 | #define ICON_FA_INVISION "\xef\x9e\xb0" // U+f7b0
227 | #define ICON_FA_IOXHOST "\xef\x88\x88" // U+f208
228 | #define ICON_FA_ITCH_IO "\xef\xa0\xba" // U+f83a
229 | #define ICON_FA_ITUNES "\xef\x8e\xb4" // U+f3b4
230 | #define ICON_FA_ITUNES_NOTE "\xef\x8e\xb5" // U+f3b5
231 | #define ICON_FA_JAVA "\xef\x93\xa4" // U+f4e4
232 | #define ICON_FA_JEDI_ORDER "\xef\x94\x8e" // U+f50e
233 | #define ICON_FA_JENKINS "\xef\x8e\xb6" // U+f3b6
234 | #define ICON_FA_JIRA "\xef\x9e\xb1" // U+f7b1
235 | #define ICON_FA_JOGET "\xef\x8e\xb7" // U+f3b7
236 | #define ICON_FA_JOOMLA "\xef\x86\xaa" // U+f1aa
237 | #define ICON_FA_JS "\xef\x8e\xb8" // U+f3b8
238 | #define ICON_FA_JSFIDDLE "\xef\x87\x8c" // U+f1cc
239 | #define ICON_FA_JXL "\xee\x99\xbb" // U+e67b
240 | #define ICON_FA_KAGGLE "\xef\x97\xba" // U+f5fa
241 | #define ICON_FA_KEYBASE "\xef\x93\xb5" // U+f4f5
242 | #define ICON_FA_KEYCDN "\xef\x8e\xba" // U+f3ba
243 | #define ICON_FA_KICKSTARTER "\xef\x8e\xbb" // U+f3bb
244 | #define ICON_FA_KICKSTARTER_K "\xef\x8e\xbc" // U+f3bc
245 | #define ICON_FA_KORVUE "\xef\x90\xaf" // U+f42f
246 | #define ICON_FA_LARAVEL "\xef\x8e\xbd" // U+f3bd
247 | #define ICON_FA_LASTFM "\xef\x88\x82" // U+f202
248 | #define ICON_FA_LEANPUB "\xef\x88\x92" // U+f212
249 | #define ICON_FA_LESS "\xef\x90\x9d" // U+f41d
250 | #define ICON_FA_LETTERBOXD "\xee\x98\xad" // U+e62d
251 | #define ICON_FA_LINE "\xef\x8f\x80" // U+f3c0
252 | #define ICON_FA_LINKEDIN "\xef\x82\x8c" // U+f08c
253 | #define ICON_FA_LINKEDIN_IN "\xef\x83\xa1" // U+f0e1
254 | #define ICON_FA_LINODE "\xef\x8a\xb8" // U+f2b8
255 | #define ICON_FA_LINUX "\xef\x85\xbc" // U+f17c
256 | #define ICON_FA_LYFT "\xef\x8f\x83" // U+f3c3
257 | #define ICON_FA_MAGENTO "\xef\x8f\x84" // U+f3c4
258 | #define ICON_FA_MAILCHIMP "\xef\x96\x9e" // U+f59e
259 | #define ICON_FA_MANDALORIAN "\xef\x94\x8f" // U+f50f
260 | #define ICON_FA_MARKDOWN "\xef\x98\x8f" // U+f60f
261 | #define ICON_FA_MASTODON "\xef\x93\xb6" // U+f4f6
262 | #define ICON_FA_MAXCDN "\xef\x84\xb6" // U+f136
263 | #define ICON_FA_MDB "\xef\xa3\x8a" // U+f8ca
264 | #define ICON_FA_MEDAPPS "\xef\x8f\x86" // U+f3c6
265 | #define ICON_FA_MEDIUM "\xef\x88\xba" // U+f23a
266 | #define ICON_FA_MEDRT "\xef\x8f\x88" // U+f3c8
267 | #define ICON_FA_MEETUP "\xef\x8b\xa0" // U+f2e0
268 | #define ICON_FA_MEGAPORT "\xef\x96\xa3" // U+f5a3
269 | #define ICON_FA_MENDELEY "\xef\x9e\xb3" // U+f7b3
270 | #define ICON_FA_META "\xee\x92\x9b" // U+e49b
271 | #define ICON_FA_MICROBLOG "\xee\x80\x9a" // U+e01a
272 | #define ICON_FA_MICROSOFT "\xef\x8f\x8a" // U+f3ca
273 | #define ICON_FA_MINTBIT "\xee\x98\xaf" // U+e62f
274 | #define ICON_FA_MIX "\xef\x8f\x8b" // U+f3cb
275 | #define ICON_FA_MIXCLOUD "\xef\x8a\x89" // U+f289
276 | #define ICON_FA_MIXER "\xee\x81\x96" // U+e056
277 | #define ICON_FA_MIZUNI "\xef\x8f\x8c" // U+f3cc
278 | #define ICON_FA_MODX "\xef\x8a\x85" // U+f285
279 | #define ICON_FA_MONERO "\xef\x8f\x90" // U+f3d0
280 | #define ICON_FA_NAPSTER "\xef\x8f\x92" // U+f3d2
281 | #define ICON_FA_NEOS "\xef\x98\x92" // U+f612
282 | #define ICON_FA_NFC_DIRECTIONAL "\xee\x94\xb0" // U+e530
283 | #define ICON_FA_NFC_SYMBOL "\xee\x94\xb1" // U+e531
284 | #define ICON_FA_NIMBLR "\xef\x96\xa8" // U+f5a8
285 | #define ICON_FA_NODE "\xef\x90\x99" // U+f419
286 | #define ICON_FA_NODE_JS "\xef\x8f\x93" // U+f3d3
287 | #define ICON_FA_NPM "\xef\x8f\x94" // U+f3d4
288 | #define ICON_FA_NS8 "\xef\x8f\x95" // U+f3d5
289 | #define ICON_FA_NUTRITIONIX "\xef\x8f\x96" // U+f3d6
290 | #define ICON_FA_OCTOPUS_DEPLOY "\xee\x82\x82" // U+e082
291 | #define ICON_FA_ODNOKLASSNIKI "\xef\x89\xa3" // U+f263
292 | #define ICON_FA_ODYSEE "\xee\x97\x86" // U+e5c6
293 | #define ICON_FA_OLD_REPUBLIC "\xef\x94\x90" // U+f510
294 | #define ICON_FA_OPENCART "\xef\x88\xbd" // U+f23d
295 | #define ICON_FA_OPENID "\xef\x86\x9b" // U+f19b
296 | #define ICON_FA_OPENSUSE "\xee\x98\xab" // U+e62b
297 | #define ICON_FA_OPERA "\xef\x89\xaa" // U+f26a
298 | #define ICON_FA_OPTIN_MONSTER "\xef\x88\xbc" // U+f23c
299 | #define ICON_FA_ORCID "\xef\xa3\x92" // U+f8d2
300 | #define ICON_FA_OSI "\xef\x90\x9a" // U+f41a
301 | #define ICON_FA_PADLET "\xee\x92\xa0" // U+e4a0
302 | #define ICON_FA_PAGE4 "\xef\x8f\x97" // U+f3d7
303 | #define ICON_FA_PAGELINES "\xef\x86\x8c" // U+f18c
304 | #define ICON_FA_PALFED "\xef\x8f\x98" // U+f3d8
305 | #define ICON_FA_PATREON "\xef\x8f\x99" // U+f3d9
306 | #define ICON_FA_PAYPAL "\xef\x87\xad" // U+f1ed
307 | #define ICON_FA_PERBYTE "\xee\x82\x83" // U+e083
308 | #define ICON_FA_PERISCOPE "\xef\x8f\x9a" // U+f3da
309 | #define ICON_FA_PHABRICATOR "\xef\x8f\x9b" // U+f3db
310 | #define ICON_FA_PHOENIX_FRAMEWORK "\xef\x8f\x9c" // U+f3dc
311 | #define ICON_FA_PHOENIX_SQUADRON "\xef\x94\x91" // U+f511
312 | #define ICON_FA_PHP "\xef\x91\x97" // U+f457
313 | #define ICON_FA_PIED_PIPER "\xef\x8a\xae" // U+f2ae
314 | #define ICON_FA_PIED_PIPER_ALT "\xef\x86\xa8" // U+f1a8
315 | #define ICON_FA_PIED_PIPER_HAT "\xef\x93\xa5" // U+f4e5
316 | #define ICON_FA_PIED_PIPER_PP "\xef\x86\xa7" // U+f1a7
317 | #define ICON_FA_PINTEREST "\xef\x83\x92" // U+f0d2
318 | #define ICON_FA_PINTEREST_P "\xef\x88\xb1" // U+f231
319 | #define ICON_FA_PIX "\xee\x90\xba" // U+e43a
320 | #define ICON_FA_PIXIV "\xee\x99\x80" // U+e640
321 | #define ICON_FA_PLAYSTATION "\xef\x8f\x9f" // U+f3df
322 | #define ICON_FA_PRODUCT_HUNT "\xef\x8a\x88" // U+f288
323 | #define ICON_FA_PUSHED "\xef\x8f\xa1" // U+f3e1
324 | #define ICON_FA_PYTHON "\xef\x8f\xa2" // U+f3e2
325 | #define ICON_FA_QQ "\xef\x87\x96" // U+f1d6
326 | #define ICON_FA_QUINSCAPE "\xef\x91\x99" // U+f459
327 | #define ICON_FA_QUORA "\xef\x8b\x84" // U+f2c4
328 | #define ICON_FA_R_PROJECT "\xef\x93\xb7" // U+f4f7
329 | #define ICON_FA_RASPBERRY_PI "\xef\x9e\xbb" // U+f7bb
330 | #define ICON_FA_RAVELRY "\xef\x8b\x99" // U+f2d9
331 | #define ICON_FA_REACT "\xef\x90\x9b" // U+f41b
332 | #define ICON_FA_REACTEUROPE "\xef\x9d\x9d" // U+f75d
333 | #define ICON_FA_README "\xef\x93\x95" // U+f4d5
334 | #define ICON_FA_REBEL "\xef\x87\x90" // U+f1d0
335 | #define ICON_FA_RED_RIVER "\xef\x8f\xa3" // U+f3e3
336 | #define ICON_FA_REDDIT "\xef\x86\xa1" // U+f1a1
337 | #define ICON_FA_REDDIT_ALIEN "\xef\x8a\x81" // U+f281
338 | #define ICON_FA_REDHAT "\xef\x9e\xbc" // U+f7bc
339 | #define ICON_FA_RENREN "\xef\x86\x8b" // U+f18b
340 | #define ICON_FA_REPLYD "\xef\x8f\xa6" // U+f3e6
341 | #define ICON_FA_RESEARCHGATE "\xef\x93\xb8" // U+f4f8
342 | #define ICON_FA_RESOLVING "\xef\x8f\xa7" // U+f3e7
343 | #define ICON_FA_REV "\xef\x96\xb2" // U+f5b2
344 | #define ICON_FA_ROCKETCHAT "\xef\x8f\xa8" // U+f3e8
345 | #define ICON_FA_ROCKRMS "\xef\x8f\xa9" // U+f3e9
346 | #define ICON_FA_RUST "\xee\x81\xba" // U+e07a
347 | #define ICON_FA_SAFARI "\xef\x89\xa7" // U+f267
348 | #define ICON_FA_SALESFORCE "\xef\xa0\xbb" // U+f83b
349 | #define ICON_FA_SASS "\xef\x90\x9e" // U+f41e
350 | #define ICON_FA_SCHLIX "\xef\x8f\xaa" // U+f3ea
351 | #define ICON_FA_SCREENPAL "\xee\x95\xb0" // U+e570
352 | #define ICON_FA_SCRIBD "\xef\x8a\x8a" // U+f28a
353 | #define ICON_FA_SEARCHENGIN "\xef\x8f\xab" // U+f3eb
354 | #define ICON_FA_SELLCAST "\xef\x8b\x9a" // U+f2da
355 | #define ICON_FA_SELLSY "\xef\x88\x93" // U+f213
356 | #define ICON_FA_SERVICESTACK "\xef\x8f\xac" // U+f3ec
357 | #define ICON_FA_SHIRTSINBULK "\xef\x88\x94" // U+f214
358 | #define ICON_FA_SHOELACE "\xee\x98\x8c" // U+e60c
359 | #define ICON_FA_SHOPIFY "\xee\x81\x97" // U+e057
360 | #define ICON_FA_SHOPWARE "\xef\x96\xb5" // U+f5b5
361 | #define ICON_FA_SIGNAL_MESSENGER "\xee\x99\xa3" // U+e663
362 | #define ICON_FA_SIMPLYBUILT "\xef\x88\x95" // U+f215
363 | #define ICON_FA_SISTRIX "\xef\x8f\xae" // U+f3ee
364 | #define ICON_FA_SITH "\xef\x94\x92" // U+f512
365 | #define ICON_FA_SITROX "\xee\x91\x8a" // U+e44a
366 | #define ICON_FA_SKETCH "\xef\x9f\x86" // U+f7c6
367 | #define ICON_FA_SKYATLAS "\xef\x88\x96" // U+f216
368 | #define ICON_FA_SKYPE "\xef\x85\xbe" // U+f17e
369 | #define ICON_FA_SLACK "\xef\x86\x98" // U+f198
370 | #define ICON_FA_SLIDESHARE "\xef\x87\xa7" // U+f1e7
371 | #define ICON_FA_SNAPCHAT "\xef\x8a\xab" // U+f2ab
372 | #define ICON_FA_SOUNDCLOUD "\xef\x86\xbe" // U+f1be
373 | #define ICON_FA_SOURCETREE "\xef\x9f\x93" // U+f7d3
374 | #define ICON_FA_SPACE_AWESOME "\xee\x96\xac" // U+e5ac
375 | #define ICON_FA_SPEAKAP "\xef\x8f\xb3" // U+f3f3
376 | #define ICON_FA_SPEAKER_DECK "\xef\xa0\xbc" // U+f83c
377 | #define ICON_FA_SPOTIFY "\xef\x86\xbc" // U+f1bc
378 | #define ICON_FA_SQUARE_BEHANCE "\xef\x86\xb5" // U+f1b5
379 | #define ICON_FA_SQUARE_DRIBBBLE "\xef\x8e\x97" // U+f397
380 | #define ICON_FA_SQUARE_FACEBOOK "\xef\x82\x82" // U+f082
381 | #define ICON_FA_SQUARE_FONT_AWESOME "\xee\x96\xad" // U+e5ad
382 | #define ICON_FA_SQUARE_FONT_AWESOME_STROKE "\xef\x8d\x9c" // U+f35c
383 | #define ICON_FA_SQUARE_GIT "\xef\x87\x92" // U+f1d2
384 | #define ICON_FA_SQUARE_GITHUB "\xef\x82\x92" // U+f092
385 | #define ICON_FA_SQUARE_GITLAB "\xee\x96\xae" // U+e5ae
386 | #define ICON_FA_SQUARE_GOOGLE_PLUS "\xef\x83\x94" // U+f0d4
387 | #define ICON_FA_SQUARE_HACKER_NEWS "\xef\x8e\xaf" // U+f3af
388 | #define ICON_FA_SQUARE_INSTAGRAM "\xee\x81\x95" // U+e055
389 | #define ICON_FA_SQUARE_JS "\xef\x8e\xb9" // U+f3b9
390 | #define ICON_FA_SQUARE_LASTFM "\xef\x88\x83" // U+f203
391 | #define ICON_FA_SQUARE_LETTERBOXD "\xee\x98\xae" // U+e62e
392 | #define ICON_FA_SQUARE_ODNOKLASSNIKI "\xef\x89\xa4" // U+f264
393 | #define ICON_FA_SQUARE_PIED_PIPER "\xee\x80\x9e" // U+e01e
394 | #define ICON_FA_SQUARE_PINTEREST "\xef\x83\x93" // U+f0d3
395 | #define ICON_FA_SQUARE_REDDIT "\xef\x86\xa2" // U+f1a2
396 | #define ICON_FA_SQUARE_SNAPCHAT "\xef\x8a\xad" // U+f2ad
397 | #define ICON_FA_SQUARE_STEAM "\xef\x86\xb7" // U+f1b7
398 | #define ICON_FA_SQUARE_THREADS "\xee\x98\x99" // U+e619
399 | #define ICON_FA_SQUARE_TUMBLR "\xef\x85\xb4" // U+f174
400 | #define ICON_FA_SQUARE_TWITTER "\xef\x82\x81" // U+f081
401 | #define ICON_FA_SQUARE_UPWORK "\xee\x99\xbc" // U+e67c
402 | #define ICON_FA_SQUARE_VIADEO "\xef\x8a\xaa" // U+f2aa
403 | #define ICON_FA_SQUARE_VIMEO "\xef\x86\x94" // U+f194
404 | #define ICON_FA_SQUARE_WEB_AWESOME "\xee\x9a\x83" // U+e683
405 | #define ICON_FA_SQUARE_WEB_AWESOME_STROKE "\xee\x9a\x84" // U+e684
406 | #define ICON_FA_SQUARE_WHATSAPP "\xef\x90\x8c" // U+f40c
407 | #define ICON_FA_SQUARE_X_TWITTER "\xee\x98\x9a" // U+e61a
408 | #define ICON_FA_SQUARE_XING "\xef\x85\xa9" // U+f169
409 | #define ICON_FA_SQUARE_YOUTUBE "\xef\x90\xb1" // U+f431
410 | #define ICON_FA_SQUARESPACE "\xef\x96\xbe" // U+f5be
411 | #define ICON_FA_STACK_EXCHANGE "\xef\x86\x8d" // U+f18d
412 | #define ICON_FA_STACK_OVERFLOW "\xef\x85\xac" // U+f16c
413 | #define ICON_FA_STACKPATH "\xef\xa1\x82" // U+f842
414 | #define ICON_FA_STAYLINKED "\xef\x8f\xb5" // U+f3f5
415 | #define ICON_FA_STEAM "\xef\x86\xb6" // U+f1b6
416 | #define ICON_FA_STEAM_SYMBOL "\xef\x8f\xb6" // U+f3f6
417 | #define ICON_FA_STICKER_MULE "\xef\x8f\xb7" // U+f3f7
418 | #define ICON_FA_STRAVA "\xef\x90\xa8" // U+f428
419 | #define ICON_FA_STRIPE "\xef\x90\xa9" // U+f429
420 | #define ICON_FA_STRIPE_S "\xef\x90\xaa" // U+f42a
421 | #define ICON_FA_STUBBER "\xee\x97\x87" // U+e5c7
422 | #define ICON_FA_STUDIOVINARI "\xef\x8f\xb8" // U+f3f8
423 | #define ICON_FA_STUMBLEUPON "\xef\x86\xa4" // U+f1a4
424 | #define ICON_FA_STUMBLEUPON_CIRCLE "\xef\x86\xa3" // U+f1a3
425 | #define ICON_FA_SUPERPOWERS "\xef\x8b\x9d" // U+f2dd
426 | #define ICON_FA_SUPPLE "\xef\x8f\xb9" // U+f3f9
427 | #define ICON_FA_SUSE "\xef\x9f\x96" // U+f7d6
428 | #define ICON_FA_SWIFT "\xef\xa3\xa1" // U+f8e1
429 | #define ICON_FA_SYMFONY "\xef\xa0\xbd" // U+f83d
430 | #define ICON_FA_TEAMSPEAK "\xef\x93\xb9" // U+f4f9
431 | #define ICON_FA_TELEGRAM "\xef\x8b\x86" // U+f2c6
432 | #define ICON_FA_TENCENT_WEIBO "\xef\x87\x95" // U+f1d5
433 | #define ICON_FA_THE_RED_YETI "\xef\x9a\x9d" // U+f69d
434 | #define ICON_FA_THEMECO "\xef\x97\x86" // U+f5c6
435 | #define ICON_FA_THEMEISLE "\xef\x8a\xb2" // U+f2b2
436 | #define ICON_FA_THINK_PEAKS "\xef\x9c\xb1" // U+f731
437 | #define ICON_FA_THREADS "\xee\x98\x98" // U+e618
438 | #define ICON_FA_TIKTOK "\xee\x81\xbb" // U+e07b
439 | #define ICON_FA_TRADE_FEDERATION "\xef\x94\x93" // U+f513
440 | #define ICON_FA_TRELLO "\xef\x86\x81" // U+f181
441 | #define ICON_FA_TUMBLR "\xef\x85\xb3" // U+f173
442 | #define ICON_FA_TWITCH "\xef\x87\xa8" // U+f1e8
443 | #define ICON_FA_TWITTER "\xef\x82\x99" // U+f099
444 | #define ICON_FA_TYPO3 "\xef\x90\xab" // U+f42b
445 | #define ICON_FA_UBER "\xef\x90\x82" // U+f402
446 | #define ICON_FA_UBUNTU "\xef\x9f\x9f" // U+f7df
447 | #define ICON_FA_UIKIT "\xef\x90\x83" // U+f403
448 | #define ICON_FA_UMBRACO "\xef\xa3\xa8" // U+f8e8
449 | #define ICON_FA_UNCHARTED "\xee\x82\x84" // U+e084
450 | #define ICON_FA_UNIREGISTRY "\xef\x90\x84" // U+f404
451 | #define ICON_FA_UNITY "\xee\x81\x89" // U+e049
452 | #define ICON_FA_UNSPLASH "\xee\x81\xbc" // U+e07c
453 | #define ICON_FA_UNTAPPD "\xef\x90\x85" // U+f405
454 | #define ICON_FA_UPS "\xef\x9f\xa0" // U+f7e0
455 | #define ICON_FA_UPWORK "\xee\x99\x81" // U+e641
456 | #define ICON_FA_USB "\xef\x8a\x87" // U+f287
457 | #define ICON_FA_USPS "\xef\x9f\xa1" // U+f7e1
458 | #define ICON_FA_USSUNNAH "\xef\x90\x87" // U+f407
459 | #define ICON_FA_VAADIN "\xef\x90\x88" // U+f408
460 | #define ICON_FA_VIACOIN "\xef\x88\xb7" // U+f237
461 | #define ICON_FA_VIADEO "\xef\x8a\xa9" // U+f2a9
462 | #define ICON_FA_VIBER "\xef\x90\x89" // U+f409
463 | #define ICON_FA_VIMEO "\xef\x90\x8a" // U+f40a
464 | #define ICON_FA_VIMEO_V "\xef\x89\xbd" // U+f27d
465 | #define ICON_FA_VINE "\xef\x87\x8a" // U+f1ca
466 | #define ICON_FA_VK "\xef\x86\x89" // U+f189
467 | #define ICON_FA_VNV "\xef\x90\x8b" // U+f40b
468 | #define ICON_FA_VUEJS "\xef\x90\x9f" // U+f41f
469 | #define ICON_FA_WATCHMAN_MONITORING "\xee\x82\x87" // U+e087
470 | #define ICON_FA_WAZE "\xef\xa0\xbf" // U+f83f
471 | #define ICON_FA_WEB_AWESOME "\xee\x9a\x82" // U+e682
472 | #define ICON_FA_WEBFLOW "\xee\x99\x9c" // U+e65c
473 | #define ICON_FA_WEEBLY "\xef\x97\x8c" // U+f5cc
474 | #define ICON_FA_WEIBO "\xef\x86\x8a" // U+f18a
475 | #define ICON_FA_WEIXIN "\xef\x87\x97" // U+f1d7
476 | #define ICON_FA_WHATSAPP "\xef\x88\xb2" // U+f232
477 | #define ICON_FA_WHMCS "\xef\x90\x8d" // U+f40d
478 | #define ICON_FA_WIKIPEDIA_W "\xef\x89\xa6" // U+f266
479 | #define ICON_FA_WINDOWS "\xef\x85\xba" // U+f17a
480 | #define ICON_FA_WIRSINDHANDWERK "\xee\x8b\x90" // U+e2d0
481 | #define ICON_FA_WIX "\xef\x97\x8f" // U+f5cf
482 | #define ICON_FA_WIZARDS_OF_THE_COAST "\xef\x9c\xb0" // U+f730
483 | #define ICON_FA_WODU "\xee\x82\x88" // U+e088
484 | #define ICON_FA_WOLF_PACK_BATTALION "\xef\x94\x94" // U+f514
485 | #define ICON_FA_WORDPRESS "\xef\x86\x9a" // U+f19a
486 | #define ICON_FA_WORDPRESS_SIMPLE "\xef\x90\x91" // U+f411
487 | #define ICON_FA_WPBEGINNER "\xef\x8a\x97" // U+f297
488 | #define ICON_FA_WPEXPLORER "\xef\x8b\x9e" // U+f2de
489 | #define ICON_FA_WPFORMS "\xef\x8a\x98" // U+f298
490 | #define ICON_FA_WPRESSR "\xef\x8f\xa4" // U+f3e4
491 | #define ICON_FA_X_TWITTER "\xee\x98\x9b" // U+e61b
492 | #define ICON_FA_XBOX "\xef\x90\x92" // U+f412
493 | #define ICON_FA_XING "\xef\x85\xa8" // U+f168
494 | #define ICON_FA_Y_COMBINATOR "\xef\x88\xbb" // U+f23b
495 | #define ICON_FA_YAHOO "\xef\x86\x9e" // U+f19e
496 | #define ICON_FA_YAMMER "\xef\xa1\x80" // U+f840
497 | #define ICON_FA_YANDEX "\xef\x90\x93" // U+f413
498 | #define ICON_FA_YANDEX_INTERNATIONAL "\xef\x90\x94" // U+f414
499 | #define ICON_FA_YARN "\xef\x9f\xa3" // U+f7e3
500 | #define ICON_FA_YELP "\xef\x87\xa9" // U+f1e9
501 | #define ICON_FA_YOAST "\xef\x8a\xb1" // U+f2b1
502 | #define ICON_FA_YOUTUBE "\xef\x85\xa7" // U+f167
503 | #define ICON_FA_ZHIHU "\xef\x98\xbf" // U+f63f
504 |
--------------------------------------------------------------------------------
/workingdir/astro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/astro.png
--------------------------------------------------------------------------------
/workingdir/camera-542784_1280.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/camera-542784_1280.png
--------------------------------------------------------------------------------
/workingdir/clock.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/clock.png
--------------------------------------------------------------------------------
/workingdir/fa-brands-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/fa-brands-400.ttf
--------------------------------------------------------------------------------
/workingdir/fa-regular-400.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/fa-regular-400.ttf
--------------------------------------------------------------------------------
/workingdir/fa-solid-900.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/fa-solid-900.ttf
--------------------------------------------------------------------------------
/workingdir/generate_glsl.bat:
--------------------------------------------------------------------------------
1 | for %%G in (%cd%\shaders\hlsl_src\*) do .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 %%G -stage pixel -entry main_ps -o shaders\glsl\%%~nG.glsl
2 |
--------------------------------------------------------------------------------
/workingdir/generate_msl.bat:
--------------------------------------------------------------------------------
1 | .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 shaders\hlsl_src\markers.hlsl -stage pixel -entry main_ps -target metal -o shaders\msl\marker.msl
--------------------------------------------------------------------------------
/workingdir/generate_shaders_all.bat:
--------------------------------------------------------------------------------
1 | for %%S in (glsl msl wgsl wgpu) do (
2 | echo Generate %%S
3 | for %%G in (%cd%\shaders\hlsl_src\*) do (
4 | echo Vextex
5 |
6 | if %%S == msl .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 %%G -stage vertex -entry main_vs -target metal -o shaders\%%S\%%~nG_vs.%%S
7 | if not %%S == msl .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 %%G -stage vertex -entry main_vs -o shaders\%%S\%%~nG_vs.%%S
8 |
9 | echo Pixel
10 |
11 | if %%S == msl .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 %%G -stage pixel -entry main_ps -target metal -o shaders\%%S\%%~nG_ps.%%S
12 | if not %%S == msl .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 %%G -stage pixel -entry main_ps -o shaders\%%S\%%~nG_ps.%%S
13 | )
14 | )
15 |
--------------------------------------------------------------------------------
/workingdir/generate_wgpu.bat:
--------------------------------------------------------------------------------
1 | .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 shaders\hlsl_src\markers.hlsl -stage pixel -entry main_ps -o shaders\wgpu\marker.wgpu
--------------------------------------------------------------------------------
/workingdir/generate_wgsl.bat:
--------------------------------------------------------------------------------
1 | .\bin\slang\bin\slangc.exe -lang hlsl -profile sm_5_1 shaders\hlsl_src\markers.hlsl -stage pixel -entry main_ps -o shaders\wgsl\marker.wgsl
--------------------------------------------------------------------------------
/workingdir/img_000.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/img_000.png
--------------------------------------------------------------------------------
/workingdir/imgui.ini:
--------------------------------------------------------------------------------
1 | [Window][Debug##Default]
2 | Pos=60,60
3 | Size=400,400
4 | Collapsed=0
5 |
6 | [Window][Shop 00]
7 | Pos=256,28
8 | Size=598,199
9 | Collapsed=0
10 |
11 | [Window][Dear ImGui Demo]
12 | Pos=511,266
13 | Size=470,478
14 | Collapsed=0
15 | DockId=0x00000001,0
16 |
17 | [Window][About Dear ImGui]
18 | Pos=60,60
19 | Size=649,144
20 | Collapsed=0
21 |
22 | [Window][Dear ImGui Metrics/Debugger]
23 | Pos=511,266
24 | Size=470,478
25 | Collapsed=0
26 | DockId=0x00000001,1
27 |
28 | [Window][Dear Widgets]
29 | Pos=13,241
30 | Size=481,535
31 | Collapsed=0
32 |
33 | [Window][Dear ImGui Style Editor]
34 | Pos=44,109
35 | Size=398,748
36 | Collapsed=0
37 |
38 | [Window][Example: Custom rendering]
39 | Pos=133,141
40 | Size=866,700
41 | Collapsed=0
42 | DockId=0x00000001,2
43 |
44 | [Window][Dear ImGui Metrics/Debugger/undopoints_C2226547]
45 | IsChild=1
46 | Size=742,160
47 |
48 | [Window][UV]
49 | Pos=496,219
50 | Size=349,116
51 | Collapsed=0
52 |
53 | [Window][Tiles]
54 | Pos=13,20
55 | Size=454,516
56 | Collapsed=0
57 |
58 | [Table][0x47600645,3]
59 | RefScale=16
60 | Column 0 Width=72
61 | Column 1 Width=72
62 | Column 2 Weight=1.0000
63 |
64 | [Table][0xDE6957FF,6]
65 | RefScale=16
66 | Column 0 Width=72
67 | Column 1 Width=72
68 | Column 2 Width=-1
69 | Column 3 Weight=1.0000
70 | Column 4 Weight=1.0000
71 | Column 5 Weight=-1.0000
72 |
73 | [Table][0xDA36A7E0,6]
74 | RefScale=16
75 | Column 0 Width=32 Sort=0v
76 | Column 1 Width=48
77 | Column 2 Width=80
78 | Column 3 Width=78
79 | Column 4 Weight=1.0000
80 | Column 5 Width=-1
81 |
82 | [Docking][Data]
83 | DockNode ID=0x00000001 Pos=519,297 Size=470,478 Selected=0x5E5F7166
84 |
85 |
--------------------------------------------------------------------------------
/workingdir/man.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/man.png
--------------------------------------------------------------------------------
/workingdir/pexels-fotoaibe-1571453.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/pexels-fotoaibe-1571453.jpg
--------------------------------------------------------------------------------
/workingdir/pexels-robert-bogdan-156165-1152351.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/pexels-robert-bogdan-156165-1152351.jpg
--------------------------------------------------------------------------------
/workingdir/shader_ps.hlsl:
--------------------------------------------------------------------------------
1 | #ifndef __IM_SHADER_H__
2 | #define __IM_SHADER_H__
3 |
4 | #if defined(IM_SHADER_HLSL)
5 | #define IMS_IN in
6 | #define IMS_OUT out
7 | #define IMS_INOUT inout
8 | #define IMS_UNIFORM uniform
9 | #define IMS_CBUFFER cbuffer
10 | #elif defined(IM_SHADER_GLSL)
11 | #define IMS_IN in
12 | #define IMS_OUT out
13 | #define IMS_INOUT inout
14 | #define IMS_UNIFORM const
15 | #define IMS_CBUFFER uniform
16 | #endif
17 |
18 | #if defined(IM_SHADER_HLSL)
19 |
20 | #define Mat44f matrix
21 | #define Mat33f matrix
22 |
23 | #endif
24 |
25 | #if defined(IM_SHADER_GLSL)
26 |
27 | #define Mat44f mat4
28 | #define Mat33f mat3
29 |
30 | #define float2 vec2
31 | #define float3 vec3
32 | #define float4 vec4
33 | #define uint2 uvec2
34 | #define uint3 uvec3
35 | #define uint4 uvec4
36 | #define int2 ivec2
37 | #define int3 ivec3
38 | #define int4 ivec4
39 |
40 | #define float4x4 mat4
41 | #define float3x3 mat3
42 | #define float2x2 mat2
43 |
44 | #endif
45 | #endif
46 | struct PS_INPUT
47 | {
48 | float4 pos : SV_POSITION;
49 | float4 col : COLOR0;
50 | float2 uv : TEXCOORD0;
51 | };
52 |
53 | IMS_CBUFFER PS_CONSTANT_BUFFER
54 | {
55 | float4 fg_color;
56 | float4 bg_color;
57 | float2 rotation;
58 | float linewidth;
59 | float size;
60 | float type;
61 | float antialiasing;
62 | float draw_type;
63 | float pad0;
64 |
65 | };
66 |
67 | #define PI 3.14159265358979323846264f
68 | #define SQRT_2 1.4142135623730951f
69 |
70 | // --- disc
71 | float disc( float2 P, float size )
72 | {
73 | return length( P ) - size * 0.5f;
74 | }
75 |
76 | // --- square
77 | float square( float2 P, float size )
78 | {
79 | return max( abs( P.x ), abs( P.y ) ) - size / ( 2.0f * SQRT_2 );
80 | }
81 |
82 | // --- triangle2
83 | float triangle2( float2 P, float size )
84 | {
85 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
86 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
87 | float r1 = max( abs( x ), abs( y ) ) - size / ( 2.0f * SQRT_2 );
88 | float r2 = P.y;
89 | return max( r1, r2 );
90 | }
91 |
92 | // --- diamond
93 | float diamond( float2 P, float size )
94 | {
95 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
96 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
97 | return max( abs( x ), abs( y ) ) - size / ( 2.0f * SQRT_2 );
98 | }
99 |
100 | // --- heart
101 | float heart( float2 P, float size )
102 | {
103 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
104 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
105 | float r1 = max( abs( x ), abs( y ) ) - size / 3.5f;
106 | float r2 = length( P - SQRT_2 / 2.0f * float2( +1.0f, -1.0f ) * size / 3.5f ) - size / 3.5f;
107 | float r3 = length( P - SQRT_2 / 2.0f * float2( -1.0f, -1.0f ) * size / 3.5f ) - size / 3.5f;
108 | return min( min( r1, r2 ), r3 );
109 | }
110 |
111 | // --- spade
112 | float spade( float2 P, float size )
113 | {
114 | // Reversed heart (diamond + 2 circles)
115 | float s = size * 0.85f / 3.5f;
116 | float x = SQRT_2 / 2.0f * ( P.x + P.y ) + 0.4f * s;
117 | float y = SQRT_2 / 2.0f * ( P.x - P.y ) - 0.4f * s;
118 | float r1 = max( abs( x ), abs( y ) ) - s;
119 | float r2 = length( P - SQRT_2 / 2.0f * float2( +1.0f, +0.2f ) * s ) - s;
120 | float r3 = length( P - SQRT_2 / 2.0f * float2( -1.0f, +0.2f ) * s ) - s;
121 | float r4 = min( min( r1, r2 ), r3 );
122 |
123 | // Root (2 circles and 2 planes)
124 | float2 c1 = float2( +0.65f, 0.125f );
125 | float2 c2 = float2( -0.65f, 0.125f );
126 | float r5 = length( P - c1 * size ) - size / 1.6f;
127 | float r6 = length( P - c2 * size ) - size / 1.6f;
128 | float r7 = P.y - 0.5f * size;
129 | float r8 = 0.1f * size - P.y;
130 | float r9 = max( -min( r5, r6 ), max( r7, r8 ) );
131 |
132 | return min( r4, r9 );
133 | }
134 |
135 | // --- club
136 | float club( float2 P, float size )
137 | {
138 | // clover (3 discs)
139 | float t1 = -PI / 2.0f;
140 | float2 c1 = 0.225f * float2( cos( t1 ), sin( t1 ) );
141 | float t2 = t1 + 2.0f * PI / 3.0;
142 | float2 c2 = 0.225f * float2( cos( t2 ), sin( t2 ) );
143 | float t3 = t2 + 2.0f * PI / 3.0;
144 | float2 c3 = 0.225f * float2( cos( t3 ), sin( t3 ) );
145 | float r1 = length( P - c1 * size ) - size / 4.25f;
146 | float r2 = length( P - c2 * size ) - size / 4.25f;
147 | float r3 = length( P - c3 * size ) - size / 4.25f;
148 | float r4 = min( min( r1, r2 ), r3 );
149 |
150 | // Root (2 circles and 2 planes)
151 | float2 c4 = float2( +0.65f, 0.125f );
152 | float2 c5 = float2( -0.65f, 0.125f );
153 | float r5 = length( P - c4 * size ) - size / 1.6f;
154 | float r6 = length( P - c5 * size ) - size / 1.6f;
155 | float r7 = P.y - 0.5f * size;
156 | float r8 = 0.2f * size - P.y;
157 | float r9 = max( -min( r5, r6 ), max( r7, r8 ) );
158 |
159 | return min( r4, r9 );
160 | }
161 |
162 | // --- chevron
163 | float chevron( float2 P, float size )
164 | {
165 | float x = 1.0f / SQRT_2 * ( P.x - P.y );
166 | float y = 1.0f / SQRT_2 * ( P.x + P.y );
167 | float r1 = max( abs( x ), abs( y ) ) - size / 3.0f;
168 | float r2 = max( abs( x - size / 3 ), abs( y - size / 3.0f ) ) - size / 3.0f;
169 | return max( r1, -r2 );
170 | }
171 |
172 | // --- clover
173 | float clover( float2 P, float size )
174 | {
175 | float t1 = -PI / 2.0f;
176 | float2 c1 = 0.25f * float2( cos( t1 ), sin( t1 ) );
177 | float t2 = t1 + 2.0f * PI / 3.0f;
178 | float2 c2 = 0.25f * float2( cos( t2 ), sin( t2 ) );
179 | float t3 = t2 + 2.0f * PI / 3.0f;
180 | float2 c3 = 0.25f * float2( cos( t3 ), sin( t3 ) );
181 |
182 | float r1 = length( P - c1 * size ) - size / 3.5f;
183 | float r2 = length( P - c2 * size ) - size / 3.5f;
184 | float r3 = length( P - c3 * size ) - size / 3.5f;
185 | return min( min( r1, r2 ), r3 );
186 | }
187 |
188 | // --- ring
189 | float ring( float2 P, float size )
190 | {
191 | float r1 = length( P ) - size / 2.0f;
192 | float r2 = length( P ) - size / 4.0f;
193 | return max( r1, -r2 );
194 | }
195 |
196 | // --- tag
197 | float tag( float2 P, float size )
198 | {
199 | float r1 = max( abs( P.x ) - size / 2.0f, abs( P.y ) - size / 6.0f );
200 | float r2 = abs( P.x - size / 1.5f ) + abs( P.y ) - size;
201 | return max( r1, .75f * r2 );
202 | }
203 |
204 | // --- cross
205 | float cross( float2 P, float size )
206 | {
207 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
208 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
209 | float r1 = max( abs( x - size / 3.0f ), abs( x + size / 3.0f ) );
210 | float r2 = max( abs( y - size / 3.0f ), abs( y + size / 3.0f ) );
211 | float r3 = max( abs( x ), abs( y ) );
212 | float r = max( min( r1, r2 ), r3 );
213 | r -= size / 2.0f;
214 | return r;
215 | }
216 |
217 | // --- asterisk
218 | float asterisk( float2 P, float size )
219 | {
220 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
221 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
222 | float r1 = max( abs( x ) - size / 2.0f, abs( y ) - size / 10.0f );
223 | float r2 = max( abs( y ) - size / 2.0f, abs( x ) - size / 10.0f );
224 | float r3 = max( abs( P.x ) - size / 2.0f, abs( P.y ) - size / 10.0f );
225 | float r4 = max( abs( P.y ) - size / 2.0f, abs( P.x ) - size / 10.0f );
226 | return min( min( r1, r2 ), min( r3, r4 ) );
227 | }
228 |
229 | // --- infinity
230 | float infinity( float2 P, float size )
231 | {
232 | float2 c1 = float2( +0.2125f, 0.00f );
233 | float2 c2 = float2( -0.2125f, 0.00f );
234 | float r1 = length( P - c1 * size ) - size / 3.5f;
235 | float r2 = length( P - c1 * size ) - size / 7.5f;
236 | float r3 = length( P - c2 * size ) - size / 3.5f;
237 | float r4 = length( P - c2 * size ) - size / 7.5f;
238 | return min( max( r1, -r2 ), max( r3, -r4 ) );
239 | }
240 |
241 | // --- pin
242 | float pin( float2 P, float size )
243 | {
244 | float2 c1 = float2( 0.0f, -0.15f ) * size;
245 | float r1 = length( P - c1 ) - size / 2.675f;
246 | float2 c2 = float2( +1.49f, -0.80f ) * size;
247 | float r2 = length( P - c2 ) - 2.0f * size;
248 | float2 c3 = float2( -1.49f, -0.80f ) * size;
249 | float r3 = length( P - c3 ) - 2.0f * size;
250 | float r4 = length( P - c1 ) - size / 5.0f;
251 | return max( min( r1, max( max( r2, r3 ), -P.y ) ), -r4 );
252 | }
253 |
254 | // --- arrow
255 | float arrow( float2 P, float size )
256 | {
257 | float r1 = abs( P.x ) + abs( P.y ) - size / 2.0f;
258 | float r2 = max( abs( P.x + size / 2.0f ), abs( P.y ) ) - size / 2.0f;
259 | float r3 = max( abs( P.x - size / 6.0f ) - size / 4.0f, abs( P.y ) - size / 4.0f );
260 | return min( r3, max( .75f * r1, r2 ) );
261 | }
262 |
263 | // --- ellipse
264 | // Created by Inigo Quilez - iq/2013
265 | // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
266 | float ellipse( float2 P, float size )
267 | {
268 | float2 ab = float2( size / 3.0f, size / 2.0f );
269 | float2 p = abs( P );
270 | if ( p.x > p.y )
271 | {
272 | p = p.yx;
273 | ab = ab.yx;
274 | }
275 | float l = ab.y * ab.y - ab.x * ab.x;
276 | float m = ab.x * p.x / l;
277 | float n = ab.y * p.y / l;
278 | float m2 = m * m;
279 | float n2 = n * n;
280 |
281 | float c = ( m2 + n2 - 1.0f ) / 3.0f;
282 | float c3 = c * c * c;
283 |
284 | float q = c3 + m2 * n2 * 2.0f;
285 | float d = c3 + m2 * n2;
286 | float g = m + m * n2;
287 |
288 | float co;
289 |
290 | if ( d < 0.0f )
291 | {
292 | float p = acos( q / c3 ) / 3.0f;
293 | float s = cos( p );
294 | float t = sin( p ) * sqrt( 3.0f );
295 | float rx = sqrt( -c * ( s + t + 2.0f ) + m2 );
296 | float ry = sqrt( -c * ( s - t + 2.0f ) + m2 );
297 | co = ( ry + sign( l ) * rx + abs( g ) / ( rx * ry ) - m ) / 2.0f;
298 | }
299 | else
300 | {
301 | float h = 2.0f * m * n * sqrt( d );
302 | float s = sign( q + h ) * pow( abs( q + h ), 1.0f / 3.0f );
303 | float u = sign( q - h ) * pow( abs( q - h ), 1.0f / 3.0f );
304 | float rx = -s - u - c * 4.0f + 2.0f * m2;
305 | float ry = ( s - u ) * sqrt( 3.0f );
306 | float rm = sqrt( rx * rx + ry * ry );
307 | float p = ry / sqrt( rm - rx );
308 | co = ( p + 2.0f * g / rm - m ) / 2.0f;
309 | }
310 |
311 | float si = sqrt( 1.0f - co * co );
312 | float2 closestPoint = float2( ab.x * co, ab.y * si );
313 | return length( closestPoint - p ) * sign( p.y - closestPoint.y );
314 | }
315 |
316 | float ellipse_fast( float2 P, float size )
317 | {
318 | float a = 1.0f;
319 | float b = 3.0f;
320 | float r = 0.9f;
321 | float f = length( P*float2(a,b) );
322 | f = length( P*float2(a,b) );
323 | f = f*(f-r)/length( P*float2(a*a,b*b) );
324 | return f;
325 | }
326 |
327 | float4 stroke(float distance, float linewidth, float antialias, float4 stroke)
328 | {
329 | float4 frag_color;
330 | float t = linewidth / 2.0f - antialias;
331 | float signed_distance = distance;
332 | float border_distance = abs( signed_distance ) - t;
333 | float alpha = border_distance / antialias;
334 | alpha = exp( -alpha * alpha );
335 |
336 | if ( border_distance < 0.0f )
337 | frag_color = stroke;
338 | else
339 | frag_color = float4( stroke.rgb, stroke.a * alpha );
340 |
341 | return frag_color;
342 | }
343 |
344 | float4 filled(float distance, float linewidth, float antialias, float4 fill)
345 | {
346 | float4 frag_color;
347 | float t = linewidth / 2.0f - antialias;
348 | float signed_distance = distance;
349 | float border_distance = abs( signed_distance ) - t;
350 | float alpha = border_distance / antialias;
351 | alpha = exp( -alpha * alpha );
352 |
353 | if ( border_distance < 0.0f )
354 | frag_color = fill;
355 | else if ( signed_distance < 0.0f )
356 | frag_color = fill;
357 | else
358 | frag_color = float4( fill.rgb, alpha * fill.a );
359 |
360 | return frag_color;
361 | }
362 |
363 | float4 outline( float distance, float linewidth, float antialias, float4 stroke, float4 fill )
364 | {
365 | float4 frag_color;
366 | float t = linewidth / 2.0f - antialias;
367 | float signed_distance = distance;
368 | float border_distance = abs( signed_distance ) - t;
369 | float alpha = border_distance / antialias;
370 | alpha = exp( -alpha * alpha );
371 |
372 | if ( border_distance < 0.0f )
373 | frag_color = stroke;
374 | else if ( signed_distance < 0.0f )
375 | frag_color = lerp( fill, stroke, sqrt( alpha ) );
376 | else
377 | frag_color = float4( stroke.rgb, stroke.a * alpha );
378 |
379 | return frag_color;
380 | }
381 |
382 | sampler sampler0;
383 | Texture2D texture0;
384 |
385 | float4 main(PS_INPUT input) : SV_Target
386 | {
387 | float2 uv = input.uv.xy;
388 | float4 col_in = input.col;
389 | float4 col_out = float4(1.0f, 1.0f, 1.0f, 1.0f);
390 |
391 | float2 P = uv - 0.5f;
392 | P.y = -P.y;
393 | P = float2( rotation.x * P.x - rotation.y * P.y,
394 | rotation.y * P.x + rotation.x * P.y );
395 |
396 | float antialias = antialiasing;
397 | float point_size = SQRT_2 * size + 2.0f * ( linewidth + 1.5f * antialias );
398 | float distance;
399 | if ( type == 0.0f ) // Disc
400 | distance = disc( P * point_size, size );
401 | else if ( type == 1.0f ) // Square
402 | distance = square( P * point_size, size );
403 | else if (type == 2.0f) // Triangle
404 | distance = triangle2( P * point_size, size );
405 | else if (type == 3.0f) // Diamond
406 | distance = diamond( P * point_size, size );
407 | else if (type == 4.0f) // Heart
408 | distance = heart( P * point_size, size );
409 | else if (type == 5.0f) // Spade
410 | distance = spade( P * point_size, size );
411 | else if (type == 6.0f) // Club
412 | distance = club( P * point_size, size );
413 | else if (type == 7.0f) // Chevron
414 | distance = chevron( P * point_size, size );
415 | else if (type == 8.0f) // Clover
416 | distance = clover( P * point_size, size );
417 | else if (type == 9.0f) // Ring
418 | distance = ring( P * point_size, size );
419 | else if (type == 10.0f) // Tag
420 | distance = tag( P * point_size, size );
421 | else if (type == 11.0f) // Cross
422 | distance = cross( P * point_size, size );
423 | else if (type == 12.0f) // Asterisk
424 | distance = asterisk( P * point_size, size );
425 | else if (type == 13.0f) // Infinity
426 | distance = infinity( P * point_size, size );
427 | else if (type == 14.0f) // Pin
428 | distance = pin( P * point_size, size );
429 | else if (type == 15.0f) // Arrow
430 | distance = arrow( P * point_size, size );
431 | else if (type == 16.0f) // Ellipse
432 | distance = ellipse( P * point_size, size );
433 | else if (type == 17.0f) // EllipseApprox
434 | distance = ellipse_fast( P * point_size, size );
435 |
436 | if ( draw_type == 0.0f )
437 | col_out = filled( distance, linewidth, antialias, fg_color );
438 | else if ( draw_type == 1.0f )
439 | col_out = stroke(distance, linewidth, antialias, fg_color);
440 | else if ( draw_type == 2.0f )
441 | col_out = outline( distance, linewidth, antialias, fg_color, bg_color );
442 | else if ( draw_type == 3.0f )
443 | col_out = float4( pow( abs( distance ), 1.0f / 2.2f ).xxx, 1.0f );
444 | else if ( draw_type == 4.0f )
445 | col_out = lerp(fg_color, bg_color, distance > 0.0f);
446 |
447 |
448 |
449 | return col_out;
450 | }
451 |
452 |
--------------------------------------------------------------------------------
/workingdir/shader_vs.hlsl:
--------------------------------------------------------------------------------
1 | #ifndef __IM_SHADER_H__
2 | #define __IM_SHADER_H__
3 |
4 | #if defined(IM_SHADER_HLSL)
5 | #define IMS_IN in
6 | #define IMS_OUT out
7 | #define IMS_INOUT inout
8 | #define IMS_UNIFORM uniform
9 | #define IMS_CBUFFER cbuffer
10 | #elif defined(IM_SHADER_GLSL)
11 | #define IMS_IN in
12 | #define IMS_OUT out
13 | #define IMS_INOUT inout
14 | #define IMS_UNIFORM const
15 | #define IMS_CBUFFER uniform
16 | #endif
17 |
18 | #if defined(IM_SHADER_HLSL)
19 |
20 | #define Mat44f matrix
21 | #define Mat33f matrix
22 |
23 | #endif
24 |
25 | #if defined(IM_SHADER_GLSL)
26 |
27 | #define Mat44f mat4
28 | #define Mat33f mat3
29 |
30 | #define float2 vec2
31 | #define float3 vec3
32 | #define float4 vec4
33 | #define uint2 uvec2
34 | #define uint3 uvec3
35 | #define uint4 uvec4
36 | #define int2 ivec2
37 | #define int3 ivec3
38 | #define int4 ivec4
39 |
40 | #define float4x4 mat4
41 | #define float3x3 mat3
42 | #define float2x2 mat2
43 |
44 | #endif
45 | #endif
46 | IMS_CBUFFER vertexBuffer
47 | {
48 | float4x4 ProjectionMatrix;
49 | };
50 | struct VS_INPUT
51 | {
52 | float2 pos : POSITION;
53 | float4 col : COLOR0;
54 | float2 uv : TEXCOORD0;
55 | };
56 |
57 | struct PS_INPUT
58 | {
59 | float4 pos : SV_POSITION;
60 | float4 col : COLOR0;
61 | float2 uv : TEXCOORD0;
62 | };
63 |
64 | PS_INPUT main(VS_INPUT input)
65 | {
66 | PS_INPUT output;
67 | output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));
68 | output.col = input.col;
69 | output.uv = input.uv;
70 | return output;
71 | }
72 |
73 |
--------------------------------------------------------------------------------
/workingdir/shaders/glsl/markers_ps.glsl:
--------------------------------------------------------------------------------
1 | #version 450
2 | layout(row_major) uniform;
3 | layout(row_major) buffer;
4 |
5 | #line 13 0
6 | struct SLANG_ParameterGroup_PS_CONSTANT_BUFFER_std140_0
7 | {
8 | vec4 fg_color_0;
9 | vec4 bg_color_0;
10 | vec2 rotation_0;
11 | float linewidth_0;
12 | float size_0;
13 | float type_0;
14 | float antialiasing_0;
15 | float draw_type_0;
16 | float pad0_0;
17 | };
18 |
19 |
20 | #line 1
21 | layout(binding = 0)
22 | layout(std140) uniform block_SLANG_ParameterGroup_PS_CONSTANT_BUFFER_std140_0
23 | {
24 | vec4 fg_color_0;
25 | vec4 bg_color_0;
26 | vec2 rotation_0;
27 | float linewidth_0;
28 | float size_0;
29 | float type_0;
30 | float antialiasing_0;
31 | float draw_type_0;
32 | float pad0_0;
33 | }PS_CONSTANT_BUFFER_0;
34 |
35 | #line 39
36 | float disc_0(vec2 P_0, float size_1)
37 | {
38 | return length(P_0) - size_1 * 0.5;
39 | }
40 |
41 |
42 | float square_0(vec2 P_1, float size_2)
43 | {
44 | return max(abs(P_1.x), abs(P_1.y)) - size_2 / 2.82842707633972168;
45 | }
46 |
47 |
48 | float triangle2_0(vec2 P_2, float size_3)
49 | {
50 | float _S1 = P_2.x;
51 |
52 | #line 53
53 | float _S2 = P_2.y;
54 |
55 |
56 |
57 | return max(max(abs(0.70710676908493042 * (_S1 - _S2)), abs(0.70710676908493042 * (_S1 + _S2))) - size_3 / 2.82842707633972168, _S2);
58 | }
59 |
60 |
61 | float diamond_0(vec2 P_3, float size_4)
62 | {
63 | float _S3 = P_3.x;
64 |
65 | #line 63
66 | float _S4 = P_3.y;
67 |
68 | return max(abs(0.70710676908493042 * (_S3 - _S4)), abs(0.70710676908493042 * (_S3 + _S4))) - size_4 / 2.82842707633972168;
69 | }
70 |
71 |
72 | float heart_0(vec2 P_4, float size_5)
73 | {
74 | float _S5 = P_4.x;
75 |
76 | #line 71
77 | float _S6 = P_4.y;
78 |
79 | #line 76
80 | return min(min(max(abs(0.70710676908493042 * (_S5 - _S6)), abs(0.70710676908493042 * (_S5 + _S6))) - size_5 / 3.5, length(P_4 - 0.70710676908493042 * vec2(1.0, -1.0) * size_5 / 3.5) - size_5 / 3.5), length(P_4 - 0.70710676908493042 * vec2(-1.0, -1.0) * size_5 / 3.5) - size_5 / 3.5);
81 | }
82 |
83 |
84 | float spade_0(vec2 P_5, float size_6)
85 | {
86 |
87 | float s_0 = size_6 * 0.85000002384185791 / 3.5;
88 | float _S7 = P_5.x;
89 |
90 | #line 84
91 | float _S8 = P_5.y;
92 |
93 | #line 84
94 | float _S9 = 0.40000000596046448 * s_0;
95 |
96 | #line 100
97 | return min(min(min(max(abs(0.70710676908493042 * (_S7 + _S8) + _S9), abs(0.70710676908493042 * (_S7 - _S8) - _S9)) - s_0, length(P_5 - 0.70710676908493042 * vec2(1.0, 0.20000000298023224) * s_0) - s_0), length(P_5 - 0.70710676908493042 * vec2(-1.0, 0.20000000298023224) * s_0) - s_0), max(- min(length(P_5 - vec2(0.64999997615814209, 0.125) * size_6) - size_6 / 1.60000002384185791, length(P_5 - vec2(-0.64999997615814209, 0.125) * size_6) - size_6 / 1.60000002384185791), max(_S8 - 0.5 * size_6, 0.10000000149011612 * size_6 - _S8)));
98 | }
99 |
100 |
101 | float club_0(vec2 P_6, float size_7)
102 | {
103 |
104 | #line 123
105 | float _S10 = P_6.y;
106 |
107 |
108 |
109 | return min(min(min(length(P_6 - 0.22499999403953552 * vec2(cos(-1.57079637050628662), sin(-1.57079637050628662)) * size_7) - size_7 / 4.25, length(P_6 - 0.22499999403953552 * vec2(cos(0.52359879016876221), sin(0.52359879016876221)) * size_7) - size_7 / 4.25), length(P_6 - 0.22499999403953552 * vec2(cos(2.61799383163452148), sin(2.61799383163452148)) * size_7) - size_7 / 4.25), max(- min(length(P_6 - vec2(0.64999997615814209, 0.125) * size_7) - size_7 / 1.60000002384185791, length(P_6 - vec2(-0.64999997615814209, 0.125) * size_7) - size_7 / 1.60000002384185791), max(_S10 - 0.5 * size_7, 0.20000000298023224 * size_7 - _S10)));
110 | }
111 |
112 |
113 | float chevron_0(vec2 P_7, float size_8)
114 | {
115 | float _S11 = P_7.x;
116 |
117 | #line 133
118 | float _S12 = P_7.y;
119 |
120 | #line 133
121 | float x_0 = 0.70710676908493042 * (_S11 - _S12);
122 | float y_0 = 0.70710676908493042 * (_S11 + _S12);
123 |
124 |
125 | return max(max(abs(x_0), abs(y_0)) - size_8 / 3.0, - (max(abs(x_0 - size_8 / 3.0), abs(y_0 - size_8 / 3.0)) - size_8 / 3.0));
126 | }
127 |
128 |
129 | float clover_0(vec2 P_8, float size_9)
130 | {
131 |
132 | #line 153
133 | return min(min(length(P_8 - 0.25 * vec2(cos(-1.57079637050628662), sin(-1.57079637050628662)) * size_9) - size_9 / 3.5, length(P_8 - 0.25 * vec2(cos(0.52359879016876221), sin(0.52359879016876221)) * size_9) - size_9 / 3.5), length(P_8 - 0.25 * vec2(cos(2.61799383163452148), sin(2.61799383163452148)) * size_9) - size_9 / 3.5);
134 | }
135 |
136 |
137 | float ring_0(vec2 P_9, float size_10)
138 | {
139 | float _S13 = length(P_9);
140 |
141 | return max(_S13 - size_10 / 2.0, - (_S13 - size_10 / 4.0));
142 | }
143 |
144 |
145 | float tag_0(vec2 P_10, float size_11)
146 | {
147 | float _S14 = P_10.x;
148 |
149 | #line 167
150 | float _S15 = abs(P_10.y);
151 |
152 | return max(max(abs(_S14) - size_11 / 2.0, _S15 - size_11 / 6.0), 0.75 * (abs(_S14 - size_11 / 1.5) + _S15 - size_11));
153 | }
154 |
155 |
156 | float cross_0(vec2 P_11, float size_12)
157 | {
158 | float _S16 = P_11.x;
159 |
160 | #line 175
161 | float _S17 = P_11.y;
162 |
163 | #line 175
164 | float x_1 = 0.70710676908493042 * (_S16 - _S17);
165 | float y_1 = 0.70710676908493042 * (_S16 + _S17);
166 |
167 | #line 182
168 | return max(min(max(abs(x_1 - size_12 / 3.0), abs(x_1 + size_12 / 3.0)), max(abs(y_1 - size_12 / 3.0), abs(y_1 + size_12 / 3.0))), max(abs(x_1), abs(y_1))) - size_12 / 2.0;
169 | }
170 |
171 |
172 | float asterisk_0(vec2 P_12, float size_13)
173 | {
174 | float _S18 = P_12.x;
175 |
176 | #line 188
177 | float _S19 = P_12.y;
178 |
179 | float _S20 = abs(0.70710676908493042 * (_S18 - _S19));
180 |
181 | #line 190
182 | float _S21 = abs(0.70710676908493042 * (_S18 + _S19));
183 |
184 | float _S22 = abs(_S18);
185 |
186 | #line 192
187 | float _S23 = abs(_S19);
188 |
189 | return min(min(max(_S20 - size_13 / 2.0, _S21 - size_13 / 10.0), max(_S21 - size_13 / 2.0, _S20 - size_13 / 10.0)), min(max(_S22 - size_13 / 2.0, _S23 - size_13 / 10.0), max(_S23 - size_13 / 2.0, _S22 - size_13 / 10.0)));
190 | }
191 |
192 |
193 | float infinity_0(vec2 P_13, float size_14)
194 | {
195 |
196 |
197 | float _S24 = length(P_13 - vec2(0.21250000596046448, 0.0) * size_14);
198 |
199 | float _S25 = length(P_13 - vec2(-0.21250000596046448, 0.0) * size_14);
200 |
201 | return min(max(_S24 - size_14 / 3.5, - (_S24 - size_14 / 7.5)), max(_S25 - size_14 / 3.5, - (_S25 - size_14 / 7.5)));
202 | }
203 |
204 |
205 | float pin_0(vec2 P_14, float size_15)
206 | {
207 |
208 | float _S26 = length(P_14 - vec2(0.0, -0.15000000596046448) * size_15);
209 |
210 | float _S27 = 2.0 * size_15;
211 |
212 |
213 |
214 | return max(min(_S26 - size_15 / 2.67499995231628418, max(max(length(P_14 - vec2(1.49000000953674316, -0.80000001192092896) * size_15) - _S27, length(P_14 - vec2(-1.49000000953674316, -0.80000001192092896) * size_15) - _S27), - P_14.y)), - (_S26 - size_15 / 5.0));
215 | }
216 |
217 |
218 | float arrow_0(vec2 P_15, float size_16)
219 | {
220 | float _S28 = P_15.x;
221 |
222 | #line 225
223 | float _S29 = abs(P_15.y);
224 |
225 |
226 | return min(max(abs(_S28 - size_16 / 6.0) - size_16 / 4.0, _S29 - size_16 / 4.0), max(0.75 * (abs(_S28) + _S29 - size_16 / 2.0), max(abs(_S28 + size_16 / 2.0), _S29) - size_16 / 2.0));
227 | }
228 |
229 |
230 |
231 |
232 | float ellipse_0(vec2 P_16, float size_17)
233 | {
234 | float _S30 = size_17 / 3.0;
235 |
236 | #line 236
237 | float _S31 = size_17 / 2.0;
238 |
239 | #line 236
240 | vec2 ab_0 = vec2(_S30, _S31);
241 | vec2 p_0 = abs(P_16);
242 |
243 | #line 237
244 | vec2 ab_1;
245 |
246 | #line 237
247 | vec2 p_1;
248 | if((p_0.x) > (p_0.y))
249 | {
250 | vec2 _S32 = p_0.yx;
251 |
252 | #line 240
253 | ab_1 = vec2(_S31, _S30);
254 |
255 | #line 240
256 | p_1 = _S32;
257 |
258 | #line 238
259 | }
260 | else
261 | {
262 |
263 | #line 238
264 | ab_1 = ab_0;
265 |
266 | #line 238
267 | p_1 = p_0;
268 |
269 | #line 238
270 | }
271 |
272 | #line 243
273 | float _S33 = ab_1.y;
274 |
275 | #line 243
276 | float _S34 = ab_1.x;
277 |
278 | #line 243
279 | float l_0 = _S33 * _S33 - _S34 * _S34;
280 | float m_0 = _S34 * p_1.x / l_0;
281 | float _S35 = p_1.y;
282 |
283 | #line 245
284 | float n_0 = _S33 * _S35 / l_0;
285 | float m2_0 = m_0 * m_0;
286 | float n2_0 = n_0 * n_0;
287 |
288 | float c_0 = (m2_0 + n2_0 - 1.0) / 3.0;
289 | float c3_0 = c_0 * c_0 * c_0;
290 |
291 | float _S36 = m2_0 * n2_0;
292 |
293 | #line 252
294 | float q_0 = c3_0 + _S36 * 2.0;
295 | float d_0 = c3_0 + _S36;
296 | float g_0 = m_0 + m_0 * n2_0;
297 |
298 | #line 254
299 | float co_0;
300 |
301 |
302 |
303 | if(d_0 < 0.0)
304 | {
305 | float p_2 = acos(q_0 / c3_0) / 3.0;
306 | float s_1 = cos(p_2);
307 | float t_0 = sin(p_2) * sqrt(3.0);
308 | float _S37 = - c_0;
309 |
310 | #line 263
311 | float rx_0 = sqrt(_S37 * (s_1 + t_0 + 2.0) + m2_0);
312 | float ry_0 = sqrt(_S37 * (s_1 - t_0 + 2.0) + m2_0);
313 |
314 | #line 264
315 | co_0 = (ry_0 + float((int(sign((l_0))))) * rx_0 + abs(g_0) / (rx_0 * ry_0) - m_0) / 2.0;
316 |
317 | #line 258
318 | }
319 | else
320 | {
321 |
322 | #line 269
323 | float h_0 = 2.0 * m_0 * n_0 * sqrt(d_0);
324 | float _S38 = q_0 + h_0;
325 |
326 | #line 270
327 | float s_2 = float((int(sign((_S38))))) * pow(abs(_S38), 0.3333333432674408);
328 | float _S39 = q_0 - h_0;
329 |
330 | #line 271
331 | float u_0 = float((int(sign((_S39))))) * pow(abs(_S39), 0.3333333432674408);
332 | float rx_1 = - s_2 - u_0 - c_0 * 4.0 + 2.0 * m2_0;
333 | float ry_1 = (s_2 - u_0) * sqrt(3.0);
334 | float rm_0 = sqrt(rx_1 * rx_1 + ry_1 * ry_1);
335 |
336 | #line 274
337 | co_0 = (ry_1 / sqrt(rm_0 - rx_1) + 2.0 * g_0 / rm_0 - m_0) / 2.0;
338 |
339 | #line 258
340 | }
341 |
342 | #line 280
343 | float _S40 = _S33 * sqrt(1.0 - co_0 * co_0);
344 | return length(vec2(_S34 * co_0, _S40) - p_1) * float((int(sign((_S35 - _S40)))));
345 | }
346 |
347 | float ellipse_fast_0(vec2 P_17, float size_18)
348 | {
349 |
350 | #line 290
351 | float f_0 = length(P_17 * vec2(1.0, 3.0));
352 |
353 | return f_0 * (f_0 - 0.89999997615814209) / length(P_17 * vec2(1.0, 9.0));
354 | }
355 |
356 |
357 | #line 312
358 | vec4 filled_0(float distance_0, float linewidth_1, float antialias_0, vec4 fill_0)
359 | {
360 |
361 |
362 |
363 | float border_distance_0 = abs(distance_0) - (linewidth_1 / 2.0 - antialias_0);
364 | float alpha_0 = border_distance_0 / antialias_0;
365 | float alpha_1 = exp(- alpha_0 * alpha_0);
366 |
367 | #line 319
368 | vec4 frag_color_0;
369 |
370 | if(border_distance_0 < 0.0)
371 | {
372 |
373 | #line 321
374 | frag_color_0 = fill_0;
375 |
376 | #line 321
377 | }
378 | else
379 | {
380 |
381 | #line 323
382 | if(distance_0 < 0.0)
383 | {
384 |
385 | #line 323
386 | frag_color_0 = fill_0;
387 |
388 | #line 323
389 | }
390 | else
391 | {
392 |
393 | #line 323
394 | frag_color_0 = vec4(fill_0.xyz, alpha_1 * fill_0.w);
395 |
396 | #line 323
397 | }
398 |
399 | #line 321
400 | }
401 |
402 | #line 328
403 | return frag_color_0;
404 | }
405 |
406 |
407 | #line 295
408 | vec4 stroke_0(float distance_1, float linewidth_2, float antialias_1, vec4 stroke_1)
409 | {
410 |
411 |
412 |
413 | float border_distance_1 = abs(distance_1) - (linewidth_2 / 2.0 - antialias_1);
414 | float alpha_2 = border_distance_1 / antialias_1;
415 | float alpha_3 = exp(- alpha_2 * alpha_2);
416 |
417 | #line 302
418 | vec4 frag_color_1;
419 |
420 | if(border_distance_1 < 0.0)
421 | {
422 |
423 | #line 304
424 | frag_color_1 = stroke_1;
425 |
426 | #line 304
427 | }
428 | else
429 | {
430 |
431 | #line 304
432 | frag_color_1 = vec4(stroke_1.xyz, stroke_1.w * alpha_3);
433 |
434 | #line 304
435 | }
436 |
437 | #line 309
438 | return frag_color_1;
439 | }
440 |
441 |
442 | #line 331
443 | vec4 outline_0(float distance_2, float linewidth_3, float antialias_2, vec4 stroke_2, vec4 fill_1)
444 | {
445 |
446 |
447 |
448 | float border_distance_2 = abs(distance_2) - (linewidth_3 / 2.0 - antialias_2);
449 | float alpha_4 = border_distance_2 / antialias_2;
450 | float alpha_5 = exp(- alpha_4 * alpha_4);
451 |
452 | #line 338
453 | vec4 frag_color_2;
454 |
455 | if(border_distance_2 < 0.0)
456 | {
457 |
458 | #line 340
459 | frag_color_2 = stroke_2;
460 |
461 | #line 340
462 | }
463 | else
464 | {
465 |
466 | #line 342
467 | if(distance_2 < 0.0)
468 | {
469 |
470 | #line 342
471 | frag_color_2 = mix(fill_1, stroke_2, vec4(sqrt(alpha_5)));
472 |
473 | #line 342
474 | }
475 | else
476 | {
477 |
478 | #line 342
479 | frag_color_2 = vec4(stroke_2.xyz, stroke_2.w * alpha_5);
480 |
481 | #line 342
482 | }
483 |
484 | #line 340
485 | }
486 |
487 | #line 347
488 | return frag_color_2;
489 | }
490 |
491 |
492 | #line 347
493 | layout(location = 0)
494 | out vec4 entryPointParam_main_ps_0;
495 |
496 |
497 | #line 347
498 | layout(location = 1)
499 | in vec2 input_uv_0;
500 |
501 |
502 | #line 362
503 | void main()
504 | {
505 |
506 |
507 | const vec4 _S41 = vec4(1.0, 1.0, 1.0, 1.0);
508 |
509 | vec2 _S42 = input_uv_0.xy - 0.5;
510 |
511 | #line 368
512 | vec2 P_18 = _S42;
513 | P_18[1] = - _S42.y;
514 | P_18 = vec2(PS_CONSTANT_BUFFER_0.rotation_0.x * P_18.x - PS_CONSTANT_BUFFER_0.rotation_0.y * P_18.y, PS_CONSTANT_BUFFER_0.rotation_0.y * P_18.x + PS_CONSTANT_BUFFER_0.rotation_0.x * P_18.y);
515 |
516 |
517 | float antialias_3 = PS_CONSTANT_BUFFER_0.antialiasing_0;
518 | float point_size_0 = 1.41421353816986084 * PS_CONSTANT_BUFFER_0.size_0 + 2.0 * (PS_CONSTANT_BUFFER_0.linewidth_0 + 1.5 * PS_CONSTANT_BUFFER_0.antialiasing_0);
519 |
520 | #line 374
521 | float distance_3;
522 |
523 | if((PS_CONSTANT_BUFFER_0.type_0) == 0.0)
524 | {
525 |
526 | #line 376
527 | distance_3 = disc_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
528 |
529 | #line 376
530 | }
531 | else
532 | {
533 |
534 | #line 378
535 | if((PS_CONSTANT_BUFFER_0.type_0) == 1.0)
536 | {
537 |
538 | #line 378
539 | distance_3 = square_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
540 |
541 | #line 378
542 | }
543 | else
544 | {
545 |
546 | #line 380
547 | if((PS_CONSTANT_BUFFER_0.type_0) == 2.0)
548 | {
549 |
550 | #line 380
551 | distance_3 = triangle2_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
552 |
553 | #line 380
554 | }
555 | else
556 | {
557 |
558 | #line 382
559 | if((PS_CONSTANT_BUFFER_0.type_0) == 3.0)
560 | {
561 |
562 | #line 382
563 | distance_3 = diamond_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
564 |
565 | #line 382
566 | }
567 | else
568 | {
569 |
570 | #line 384
571 | if((PS_CONSTANT_BUFFER_0.type_0) == 4.0)
572 | {
573 |
574 | #line 384
575 | distance_3 = heart_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
576 |
577 | #line 384
578 | }
579 | else
580 | {
581 |
582 | #line 386
583 | if((PS_CONSTANT_BUFFER_0.type_0) == 5.0)
584 | {
585 |
586 | #line 386
587 | distance_3 = spade_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
588 |
589 | #line 386
590 | }
591 | else
592 | {
593 |
594 | #line 388
595 | if((PS_CONSTANT_BUFFER_0.type_0) == 6.0)
596 | {
597 |
598 | #line 388
599 | distance_3 = club_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
600 |
601 | #line 388
602 | }
603 | else
604 | {
605 |
606 | #line 390
607 | if((PS_CONSTANT_BUFFER_0.type_0) == 7.0)
608 | {
609 |
610 | #line 390
611 | distance_3 = chevron_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
612 |
613 | #line 390
614 | }
615 | else
616 | {
617 |
618 | #line 392
619 | if((PS_CONSTANT_BUFFER_0.type_0) == 8.0)
620 | {
621 |
622 | #line 392
623 | distance_3 = clover_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
624 |
625 | #line 392
626 | }
627 | else
628 | {
629 |
630 | #line 394
631 | if((PS_CONSTANT_BUFFER_0.type_0) == 9.0)
632 | {
633 |
634 | #line 394
635 | distance_3 = ring_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
636 |
637 | #line 394
638 | }
639 | else
640 | {
641 |
642 | #line 396
643 | if((PS_CONSTANT_BUFFER_0.type_0) == 10.0)
644 | {
645 |
646 | #line 396
647 | distance_3 = tag_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
648 |
649 | #line 396
650 | }
651 | else
652 | {
653 |
654 | #line 398
655 | if((PS_CONSTANT_BUFFER_0.type_0) == 11.0)
656 | {
657 |
658 | #line 398
659 | distance_3 = cross_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
660 |
661 | #line 398
662 | }
663 | else
664 | {
665 |
666 | #line 400
667 | if((PS_CONSTANT_BUFFER_0.type_0) == 12.0)
668 | {
669 |
670 | #line 400
671 | distance_3 = asterisk_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
672 |
673 | #line 400
674 | }
675 | else
676 | {
677 |
678 | #line 402
679 | if((PS_CONSTANT_BUFFER_0.type_0) == 13.0)
680 | {
681 |
682 | #line 402
683 | distance_3 = infinity_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
684 |
685 | #line 402
686 | }
687 | else
688 | {
689 |
690 | #line 404
691 | if((PS_CONSTANT_BUFFER_0.type_0) == 14.0)
692 | {
693 |
694 | #line 404
695 | distance_3 = pin_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
696 |
697 | #line 404
698 | }
699 | else
700 | {
701 |
702 | #line 406
703 | if((PS_CONSTANT_BUFFER_0.type_0) == 15.0)
704 | {
705 |
706 | #line 406
707 | distance_3 = arrow_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
708 |
709 | #line 406
710 | }
711 | else
712 | {
713 |
714 | #line 408
715 | if((PS_CONSTANT_BUFFER_0.type_0) == 16.0)
716 | {
717 |
718 | #line 408
719 | distance_3 = ellipse_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
720 |
721 | #line 408
722 | }
723 | else
724 | {
725 |
726 | #line 410
727 | if((PS_CONSTANT_BUFFER_0.type_0) == 17.0)
728 | {
729 |
730 | #line 410
731 | distance_3 = ellipse_fast_0(P_18 * point_size_0, PS_CONSTANT_BUFFER_0.size_0);
732 |
733 | #line 410
734 | }
735 |
736 | #line 408
737 | }
738 |
739 | #line 406
740 | }
741 |
742 | #line 404
743 | }
744 |
745 | #line 402
746 | }
747 |
748 | #line 400
749 | }
750 |
751 | #line 398
752 | }
753 |
754 | #line 396
755 | }
756 |
757 | #line 394
758 | }
759 |
760 | #line 392
761 | }
762 |
763 | #line 390
764 | }
765 |
766 | #line 388
767 | }
768 |
769 | #line 386
770 | }
771 |
772 | #line 384
773 | }
774 |
775 | #line 382
776 | }
777 |
778 | #line 380
779 | }
780 |
781 | #line 378
782 | }
783 |
784 | #line 376
785 | }
786 |
787 | #line 376
788 | vec4 col_out_0;
789 |
790 | #line 413
791 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 0.0)
792 | {
793 |
794 | #line 413
795 | col_out_0 = filled_0(distance_3, PS_CONSTANT_BUFFER_0.linewidth_0, antialias_3, PS_CONSTANT_BUFFER_0.fg_color_0);
796 |
797 | #line 413
798 | }
799 | else
800 | {
801 |
802 | #line 415
803 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 1.0)
804 | {
805 |
806 | #line 415
807 | col_out_0 = stroke_0(distance_3, PS_CONSTANT_BUFFER_0.linewidth_0, antialias_3, PS_CONSTANT_BUFFER_0.fg_color_0);
808 |
809 | #line 415
810 | }
811 | else
812 | {
813 |
814 | #line 417
815 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 2.0)
816 | {
817 |
818 | #line 417
819 | col_out_0 = outline_0(distance_3, PS_CONSTANT_BUFFER_0.linewidth_0, antialias_3, PS_CONSTANT_BUFFER_0.fg_color_0, PS_CONSTANT_BUFFER_0.bg_color_0);
820 |
821 | #line 417
822 | }
823 | else
824 | {
825 |
826 | #line 419
827 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 3.0)
828 | {
829 |
830 | #line 419
831 | col_out_0 = vec4(vec3(pow(abs(distance_3), 0.45454543828964233)), 1.0);
832 |
833 | #line 419
834 | }
835 | else
836 | {
837 |
838 | #line 421
839 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 4.0)
840 | {
841 |
842 | #line 422
843 | vec4 _S43 = PS_CONSTANT_BUFFER_0.fg_color_0;
844 |
845 | #line 422
846 | vec4 _S44 = PS_CONSTANT_BUFFER_0.bg_color_0;
847 |
848 | #line 422
849 | if(distance_3 > 0.0)
850 | {
851 |
852 | #line 422
853 | col_out_0 = vec4(1.0);
854 |
855 | #line 422
856 | }
857 | else
858 | {
859 |
860 | #line 422
861 | col_out_0 = vec4(0.0);
862 |
863 | #line 422
864 | }
865 |
866 | #line 422
867 | col_out_0 = mix(_S43, _S44, col_out_0);
868 |
869 | #line 421
870 | }
871 | else
872 | {
873 |
874 | #line 421
875 | col_out_0 = _S41;
876 |
877 | #line 421
878 | }
879 |
880 | #line 419
881 | }
882 |
883 | #line 417
884 | }
885 |
886 | #line 415
887 | }
888 |
889 | #line 413
890 | }
891 |
892 | #line 413
893 | entryPointParam_main_ps_0 = col_out_0;
894 |
895 | #line 413
896 | return;
897 | }
898 |
899 |
--------------------------------------------------------------------------------
/workingdir/shaders/glsl/markers_vs.glsl:
--------------------------------------------------------------------------------
1 | #version 450
2 | layout(row_major) uniform;
3 | layout(row_major) buffer;
4 |
5 | #line 1972 0
6 | struct _MatrixStorage_float4x4_ColMajorstd140_0
7 | {
8 | vec4 data_0[4];
9 | };
10 |
11 |
12 | #line 1972
13 | struct SLANG_ParameterGroup_vertexBuffer_std140_0
14 | {
15 | _MatrixStorage_float4x4_ColMajorstd140_0 ProjectionMatrix_0;
16 | };
17 |
18 |
19 | #line 16 1
20 | layout(binding = 1)
21 | layout(std140) uniform block_SLANG_ParameterGroup_vertexBuffer_std140_0
22 | {
23 | _MatrixStorage_float4x4_ColMajorstd140_0 ProjectionMatrix_0;
24 | }vertexBuffer_0;
25 |
26 | #line 16
27 | mat4x4 unpackStorage_0(_MatrixStorage_float4x4_ColMajorstd140_0 _S1)
28 | {
29 |
30 | #line 16
31 | return mat4x4(_S1.data_0[0][0], _S1.data_0[1][0], _S1.data_0[2][0], _S1.data_0[3][0], _S1.data_0[0][1], _S1.data_0[1][1], _S1.data_0[2][1], _S1.data_0[3][1], _S1.data_0[0][2], _S1.data_0[1][2], _S1.data_0[2][2], _S1.data_0[3][2], _S1.data_0[0][3], _S1.data_0[1][3], _S1.data_0[2][3], _S1.data_0[3][3]);
32 | }
33 |
34 |
35 | #line 11470 2
36 | layout(location = 0)
37 | out vec4 entryPointParam_main_vs_col_0;
38 |
39 |
40 | #line 21 1
41 | layout(location = 1)
42 | out vec2 entryPointParam_main_vs_uv_0;
43 |
44 |
45 | #line 21
46 | layout(location = 0)
47 | in vec2 input_pos_0;
48 |
49 |
50 | #line 21
51 | layout(location = 1)
52 | in vec4 input_col_0;
53 |
54 |
55 | #line 21
56 | layout(location = 2)
57 | in vec2 input_uv_0;
58 |
59 |
60 | #line 28
61 | struct PS_INPUT_0
62 | {
63 | vec4 pos_0;
64 | vec4 col_0;
65 | vec2 uv_0;
66 | };
67 |
68 |
69 | #line 353
70 | void main()
71 | {
72 | PS_INPUT_0 output_0;
73 | output_0.pos_0 = (((vec4(input_pos_0.xy, 0.0, 1.0)) * (unpackStorage_0(vertexBuffer_0.ProjectionMatrix_0))));
74 | output_0.col_0 = input_col_0;
75 | output_0.uv_0 = input_uv_0;
76 | PS_INPUT_0 _S2 = output_0;
77 |
78 | #line 359
79 | gl_Position = output_0.pos_0;
80 |
81 | #line 359
82 | entryPointParam_main_vs_col_0 = _S2.col_0;
83 |
84 | #line 359
85 | entryPointParam_main_vs_uv_0 = _S2.uv_0;
86 |
87 | #line 359
88 | return;
89 | }
90 |
91 |
--------------------------------------------------------------------------------
/workingdir/shaders/hlsl_src/markers.hlsl:
--------------------------------------------------------------------------------
1 | cbuffer PS_CONSTANT_BUFFER
2 | {
3 | float4 fg_color;
4 | float4 bg_color;
5 |
6 | float2 rotation;
7 | float linewidth;
8 | float size;
9 |
10 | float type;
11 | float antialiasing;
12 | float draw_type;
13 | float pad0;
14 | };
15 |
16 | cbuffer vertexBuffer
17 | {
18 | float4x4 ProjectionMatrix;
19 | };
20 |
21 | struct VS_INPUT
22 | {
23 | float2 pos : POSITION;
24 | float4 col : COLOR0;
25 | float2 uv : TEXCOORD0;
26 | };
27 |
28 | struct PS_INPUT
29 | {
30 | float4 pos : SV_POSITION;
31 | float4 col : COLOR0;
32 | float2 uv : TEXCOORD0;
33 | };
34 |
35 | #define PI 3.14159265358979323846264f
36 | #define SQRT_2 1.4142135623730951f
37 |
38 | // --- disc
39 | float disc( float2 P, float size )
40 | {
41 | return length( P ) - size * 0.5f;
42 | }
43 |
44 | // --- square
45 | float square( float2 P, float size )
46 | {
47 | return max( abs( P.x ), abs( P.y ) ) - size / ( 2.0f * SQRT_2 );
48 | }
49 |
50 | // --- triangle2
51 | float triangle2( float2 P, float size )
52 | {
53 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
54 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
55 | float r1 = max( abs( x ), abs( y ) ) - size / ( 2.0f * SQRT_2 );
56 | float r2 = P.y;
57 | return max( r1, r2 );
58 | }
59 |
60 | // --- diamond
61 | float diamond( float2 P, float size )
62 | {
63 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
64 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
65 | return max( abs( x ), abs( y ) ) - size / ( 2.0f * SQRT_2 );
66 | }
67 |
68 | // --- heart
69 | float heart( float2 P, float size )
70 | {
71 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
72 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
73 | float r1 = max( abs( x ), abs( y ) ) - size / 3.5f;
74 | float r2 = length( P - SQRT_2 / 2.0f * float2( +1.0f, -1.0f ) * size / 3.5f ) - size / 3.5f;
75 | float r3 = length( P - SQRT_2 / 2.0f * float2( -1.0f, -1.0f ) * size / 3.5f ) - size / 3.5f;
76 | return min( min( r1, r2 ), r3 );
77 | }
78 |
79 | // --- spade
80 | float spade( float2 P, float size )
81 | {
82 | // Reversed heart (diamond + 2 circles)
83 | float s = size * 0.85f / 3.5f;
84 | float x = SQRT_2 / 2.0f * ( P.x + P.y ) + 0.4f * s;
85 | float y = SQRT_2 / 2.0f * ( P.x - P.y ) - 0.4f * s;
86 | float r1 = max( abs( x ), abs( y ) ) - s;
87 | float r2 = length( P - SQRT_2 / 2.0f * float2( +1.0f, +0.2f ) * s ) - s;
88 | float r3 = length( P - SQRT_2 / 2.0f * float2( -1.0f, +0.2f ) * s ) - s;
89 | float r4 = min( min( r1, r2 ), r3 );
90 |
91 | // Root (2 circles and 2 planes)
92 | float2 c1 = float2( +0.65f, 0.125f );
93 | float2 c2 = float2( -0.65f, 0.125f );
94 | float r5 = length( P - c1 * size ) - size / 1.6f;
95 | float r6 = length( P - c2 * size ) - size / 1.6f;
96 | float r7 = P.y - 0.5f * size;
97 | float r8 = 0.1f * size - P.y;
98 | float r9 = max( -min( r5, r6 ), max( r7, r8 ) );
99 |
100 | return min( r4, r9 );
101 | }
102 |
103 | // --- club
104 | float club( float2 P, float size )
105 | {
106 | // clover (3 discs)
107 | float t1 = -PI / 2.0f;
108 | float2 c1 = 0.225f * float2( cos( t1 ), sin( t1 ) );
109 | float t2 = t1 + 2.0f * PI / 3.0;
110 | float2 c2 = 0.225f * float2( cos( t2 ), sin( t2 ) );
111 | float t3 = t2 + 2.0f * PI / 3.0;
112 | float2 c3 = 0.225f * float2( cos( t3 ), sin( t3 ) );
113 | float r1 = length( P - c1 * size ) - size / 4.25f;
114 | float r2 = length( P - c2 * size ) - size / 4.25f;
115 | float r3 = length( P - c3 * size ) - size / 4.25f;
116 | float r4 = min( min( r1, r2 ), r3 );
117 |
118 | // Root (2 circles and 2 planes)
119 | float2 c4 = float2( +0.65f, 0.125f );
120 | float2 c5 = float2( -0.65f, 0.125f );
121 | float r5 = length( P - c4 * size ) - size / 1.6f;
122 | float r6 = length( P - c5 * size ) - size / 1.6f;
123 | float r7 = P.y - 0.5f * size;
124 | float r8 = 0.2f * size - P.y;
125 | float r9 = max( -min( r5, r6 ), max( r7, r8 ) );
126 |
127 | return min( r4, r9 );
128 | }
129 |
130 | // --- chevron
131 | float chevron( float2 P, float size )
132 | {
133 | float x = 1.0f / SQRT_2 * ( P.x - P.y );
134 | float y = 1.0f / SQRT_2 * ( P.x + P.y );
135 | float r1 = max( abs( x ), abs( y ) ) - size / 3.0f;
136 | float r2 = max( abs( x - size / 3 ), abs( y - size / 3.0f ) ) - size / 3.0f;
137 | return max( r1, -r2 );
138 | }
139 |
140 | // --- clover
141 | float clover( float2 P, float size )
142 | {
143 | float t1 = -PI / 2.0f;
144 | float2 c1 = 0.25f * float2( cos( t1 ), sin( t1 ) );
145 | float t2 = t1 + 2.0f * PI / 3.0f;
146 | float2 c2 = 0.25f * float2( cos( t2 ), sin( t2 ) );
147 | float t3 = t2 + 2.0f * PI / 3.0f;
148 | float2 c3 = 0.25f * float2( cos( t3 ), sin( t3 ) );
149 |
150 | float r1 = length( P - c1 * size ) - size / 3.5f;
151 | float r2 = length( P - c2 * size ) - size / 3.5f;
152 | float r3 = length( P - c3 * size ) - size / 3.5f;
153 | return min( min( r1, r2 ), r3 );
154 | }
155 |
156 | // --- ring
157 | float ring( float2 P, float size )
158 | {
159 | float r1 = length( P ) - size / 2.0f;
160 | float r2 = length( P ) - size / 4.0f;
161 | return max( r1, -r2 );
162 | }
163 |
164 | // --- tag
165 | float tag( float2 P, float size )
166 | {
167 | float r1 = max( abs( P.x ) - size / 2.0f, abs( P.y ) - size / 6.0f );
168 | float r2 = abs( P.x - size / 1.5f ) + abs( P.y ) - size;
169 | return max( r1, .75f * r2 );
170 | }
171 |
172 | // --- cross
173 | float cross( float2 P, float size )
174 | {
175 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
176 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
177 | float r1 = max( abs( x - size / 3.0f ), abs( x + size / 3.0f ) );
178 | float r2 = max( abs( y - size / 3.0f ), abs( y + size / 3.0f ) );
179 | float r3 = max( abs( x ), abs( y ) );
180 | float r = max( min( r1, r2 ), r3 );
181 | r -= size / 2.0f;
182 | return r;
183 | }
184 |
185 | // --- asterisk
186 | float asterisk( float2 P, float size )
187 | {
188 | float x = SQRT_2 / 2.0f * ( P.x - P.y );
189 | float y = SQRT_2 / 2.0f * ( P.x + P.y );
190 | float r1 = max( abs( x ) - size / 2.0f, abs( y ) - size / 10.0f );
191 | float r2 = max( abs( y ) - size / 2.0f, abs( x ) - size / 10.0f );
192 | float r3 = max( abs( P.x ) - size / 2.0f, abs( P.y ) - size / 10.0f );
193 | float r4 = max( abs( P.y ) - size / 2.0f, abs( P.x ) - size / 10.0f );
194 | return min( min( r1, r2 ), min( r3, r4 ) );
195 | }
196 |
197 | // --- infinity
198 | float infinity( float2 P, float size )
199 | {
200 | float2 c1 = float2( +0.2125f, 0.00f );
201 | float2 c2 = float2( -0.2125f, 0.00f );
202 | float r1 = length( P - c1 * size ) - size / 3.5f;
203 | float r2 = length( P - c1 * size ) - size / 7.5f;
204 | float r3 = length( P - c2 * size ) - size / 3.5f;
205 | float r4 = length( P - c2 * size ) - size / 7.5f;
206 | return min( max( r1, -r2 ), max( r3, -r4 ) );
207 | }
208 |
209 | // --- pin
210 | float pin( float2 P, float size )
211 | {
212 | float2 c1 = float2( 0.0f, -0.15f ) * size;
213 | float r1 = length( P - c1 ) - size / 2.675f;
214 | float2 c2 = float2( +1.49f, -0.80f ) * size;
215 | float r2 = length( P - c2 ) - 2.0f * size;
216 | float2 c3 = float2( -1.49f, -0.80f ) * size;
217 | float r3 = length( P - c3 ) - 2.0f * size;
218 | float r4 = length( P - c1 ) - size / 5.0f;
219 | return max( min( r1, max( max( r2, r3 ), -P.y ) ), -r4 );
220 | }
221 |
222 | // --- arrow
223 | float arrow( float2 P, float size )
224 | {
225 | float r1 = abs( P.x ) + abs( P.y ) - size / 2.0f;
226 | float r2 = max( abs( P.x + size / 2.0f ), abs( P.y ) ) - size / 2.0f;
227 | float r3 = max( abs( P.x - size / 6.0f ) - size / 4.0f, abs( P.y ) - size / 4.0f );
228 | return min( r3, max( .75f * r1, r2 ) );
229 | }
230 |
231 | // --- ellipse
232 | // Created by Inigo Quilez - iq/2013
233 | // License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
234 | float ellipse( float2 P, float size )
235 | {
236 | float2 ab = float2( size / 3.0f, size / 2.0f );
237 | float2 p = abs( P );
238 | if ( p.x > p.y )
239 | {
240 | p = p.yx;
241 | ab = ab.yx;
242 | }
243 | float l = ab.y * ab.y - ab.x * ab.x;
244 | float m = ab.x * p.x / l;
245 | float n = ab.y * p.y / l;
246 | float m2 = m * m;
247 | float n2 = n * n;
248 |
249 | float c = ( m2 + n2 - 1.0f ) / 3.0f;
250 | float c3 = c * c * c;
251 |
252 | float q = c3 + m2 * n2 * 2.0f;
253 | float d = c3 + m2 * n2;
254 | float g = m + m * n2;
255 |
256 | float co;
257 |
258 | if ( d < 0.0f )
259 | {
260 | float p = acos( q / c3 ) / 3.0f;
261 | float s = cos( p );
262 | float t = sin( p ) * sqrt( 3.0f );
263 | float rx = sqrt( -c * ( s + t + 2.0f ) + m2 );
264 | float ry = sqrt( -c * ( s - t + 2.0f ) + m2 );
265 | co = ( ry + sign( l ) * rx + abs( g ) / ( rx * ry ) - m ) / 2.0f;
266 | }
267 | else
268 | {
269 | float h = 2.0f * m * n * sqrt( d );
270 | float s = sign( q + h ) * pow( abs( q + h ), 1.0f / 3.0f );
271 | float u = sign( q - h ) * pow( abs( q - h ), 1.0f / 3.0f );
272 | float rx = -s - u - c * 4.0f + 2.0f * m2;
273 | float ry = ( s - u ) * sqrt( 3.0f );
274 | float rm = sqrt( rx * rx + ry * ry );
275 | float p = ry / sqrt( rm - rx );
276 | co = ( p + 2.0f * g / rm - m ) / 2.0f;
277 | }
278 |
279 | float si = sqrt( 1.0f - co * co );
280 | float2 closestPoint = float2( ab.x * co, ab.y * si );
281 | return length( closestPoint - p ) * sign( p.y - closestPoint.y );
282 | }
283 |
284 | float ellipse_fast( float2 P, float size )
285 | {
286 | float a = 1.0f;
287 | float b = 3.0f;
288 | float r = 0.9f;
289 | float f = length( P*float2(a,b) );
290 | f = length( P*float2(a,b) );
291 | f = f*(f-r)/length( P*float2(a*a,b*b) );
292 | return f;
293 | }
294 |
295 | float4 stroke(float distance, float linewidth, float antialias, float4 stroke)
296 | {
297 | float4 frag_color;
298 | float t = linewidth / 2.0f - antialias;
299 | float signed_distance = distance;
300 | float border_distance = abs( signed_distance ) - t;
301 | float alpha = border_distance / antialias;
302 | alpha = exp( -alpha * alpha );
303 |
304 | if ( border_distance < 0.0f )
305 | frag_color = stroke;
306 | else
307 | frag_color = float4( stroke.rgb, stroke.a * alpha );
308 |
309 | return frag_color;
310 | }
311 |
312 | float4 filled(float distance, float linewidth, float antialias, float4 fill)
313 | {
314 | float4 frag_color;
315 | float t = linewidth / 2.0f - antialias;
316 | float signed_distance = distance;
317 | float border_distance = abs( signed_distance ) - t;
318 | float alpha = border_distance / antialias;
319 | alpha = exp( -alpha * alpha );
320 |
321 | if ( border_distance < 0.0f )
322 | frag_color = fill;
323 | else if ( signed_distance < 0.0f )
324 | frag_color = fill;
325 | else
326 | frag_color = float4( fill.rgb, alpha * fill.a );
327 |
328 | return frag_color;
329 | }
330 |
331 | float4 outline( float distance, float linewidth, float antialias, float4 stroke, float4 fill )
332 | {
333 | float4 frag_color;
334 | float t = linewidth / 2.0f - antialias;
335 | float signed_distance = distance;
336 | float border_distance = abs( signed_distance ) - t;
337 | float alpha = border_distance / antialias;
338 | alpha = exp( -alpha * alpha );
339 |
340 | if ( border_distance < 0.0f )
341 | frag_color = stroke;
342 | else if ( signed_distance < 0.0f )
343 | frag_color = lerp( fill, stroke, sqrt( alpha ) );
344 | else
345 | frag_color = float4( stroke.rgb, stroke.a * alpha );
346 |
347 | return frag_color;
348 | }
349 |
350 | SamplerState sampler0;
351 | Texture2D texture0;
352 |
353 | PS_INPUT main_vs(VS_INPUT input)
354 | {
355 | PS_INPUT output;
356 | output.pos = mul( ProjectionMatrix, float4(input.pos.xy, 0.f, 1.f));
357 | output.col = input.col;
358 | output.uv = input.uv;
359 | return output;
360 | }
361 |
362 | float4 main_ps(PS_INPUT input) : SV_Target
363 | {
364 | float2 uv = input.uv.xy;
365 | float4 col_in = input.col;
366 | float4 col_out = float4(1.0f, 1.0f, 1.0f, 1.0f);
367 |
368 | float2 P = uv - 0.5f;
369 | P.y = -P.y;
370 | P = float2( rotation.x * P.x - rotation.y * P.y,
371 | rotation.y * P.x + rotation.x * P.y );
372 |
373 | float antialias = antialiasing;
374 | float point_size = SQRT_2 * size + 2.0f * ( linewidth + 1.5f * antialias );
375 | float distance;
376 | if ( type == 0.0f ) // Disc
377 | distance = disc( P * point_size, size );
378 | else if ( type == 1.0f ) // Square
379 | distance = square( P * point_size, size );
380 | else if (type == 2.0f) // Triangle
381 | distance = triangle2( P * point_size, size );
382 | else if (type == 3.0f) // Diamond
383 | distance = diamond( P * point_size, size );
384 | else if (type == 4.0f) // Heart
385 | distance = heart( P * point_size, size );
386 | else if (type == 5.0f) // Spade
387 | distance = spade( P * point_size, size );
388 | else if (type == 6.0f) // Club
389 | distance = club( P * point_size, size );
390 | else if (type == 7.0f) // Chevron
391 | distance = chevron( P * point_size, size );
392 | else if (type == 8.0f) // Clover
393 | distance = clover( P * point_size, size );
394 | else if (type == 9.0f) // Ring
395 | distance = ring( P * point_size, size );
396 | else if (type == 10.0f) // Tag
397 | distance = tag( P * point_size, size );
398 | else if (type == 11.0f) // Cross
399 | distance = cross( P * point_size, size );
400 | else if (type == 12.0f) // Asterisk
401 | distance = asterisk( P * point_size, size );
402 | else if (type == 13.0f) // Infinity
403 | distance = infinity( P * point_size, size );
404 | else if (type == 14.0f) // Pin
405 | distance = pin( P * point_size, size );
406 | else if (type == 15.0f) // Arrow
407 | distance = arrow( P * point_size, size );
408 | else if (type == 16.0f) // Ellipse
409 | distance = ellipse( P * point_size, size );
410 | else if (type == 17.0f) // EllipseApprox
411 | distance = ellipse_fast( P * point_size, size );
412 |
413 | if ( draw_type == 0.0f )
414 | col_out = filled( distance, linewidth, antialias, fg_color );
415 | else if ( draw_type == 1.0f )
416 | col_out = stroke(distance, linewidth, antialias, fg_color);
417 | else if ( draw_type == 2.0f )
418 | col_out = outline( distance, linewidth, antialias, fg_color, bg_color );
419 | else if ( draw_type == 3.0f )
420 | col_out = float4( pow( abs( distance ), 1.0f / 2.2f ).xxx, 1.0f );
421 | else if ( draw_type == 4.0f )
422 | col_out = lerp(fg_color, bg_color, distance > 0.0f ? 1.0f.xxxx : 0.0f.xxxx);
423 |
424 | return col_out;
425 | }
426 |
427 |
--------------------------------------------------------------------------------
/workingdir/shaders/msl/markers_ps.msl:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | using namespace metal;
5 |
6 | #line 39 "C:/git/DearWidgets/workingdir/shaders/hlsl_src/markers.hlsl"
7 | float disc_0(float2 P_0, float size_0)
8 | {
9 | return length(P_0) - size_0 * 0.5;
10 | }
11 |
12 |
13 | float square_0(float2 P_1, float size_1)
14 | {
15 | return max(abs(P_1.x), abs(P_1.y)) - size_1 / 2.82842707633972168;
16 | }
17 |
18 |
19 | float triangle2_0(float2 P_2, float size_2)
20 | {
21 | float _S1 = P_2.x;
22 |
23 | #line 53
24 | float _S2 = P_2.y;
25 |
26 |
27 |
28 | return max(max(abs(0.70710676908493042 * (_S1 - _S2)), abs(0.70710676908493042 * (_S1 + _S2))) - size_2 / 2.82842707633972168, _S2);
29 | }
30 |
31 |
32 | float diamond_0(float2 P_3, float size_3)
33 | {
34 | float _S3 = P_3.x;
35 |
36 | #line 63
37 | float _S4 = P_3.y;
38 |
39 | return max(abs(0.70710676908493042 * (_S3 - _S4)), abs(0.70710676908493042 * (_S3 + _S4))) - size_3 / 2.82842707633972168;
40 | }
41 |
42 |
43 | float heart_0(float2 P_4, float size_4)
44 | {
45 | float _S5 = P_4.x;
46 |
47 | #line 71
48 | float _S6 = P_4.y;
49 |
50 | #line 71
51 | float2 _S7 = float2(0.70710676908493042) ;
52 |
53 | #line 71
54 | float2 _S8 = float2(size_4) ;
55 |
56 | #line 71
57 | float2 _S9 = float2(3.5) ;
58 |
59 | #line 76
60 | return min(min(max(abs(0.70710676908493042 * (_S5 - _S6)), abs(0.70710676908493042 * (_S5 + _S6))) - size_4 / 3.5, length(P_4 - _S7 * float2(1.0, -1.0) * _S8 / _S9) - size_4 / 3.5), length(P_4 - _S7 * float2(-1.0, -1.0) * _S8 / _S9) - size_4 / 3.5);
61 | }
62 |
63 |
64 | float spade_0(float2 P_5, float size_5)
65 | {
66 |
67 | float s_0 = size_5 * 0.85000002384185791 / 3.5;
68 | float _S10 = P_5.x;
69 |
70 | #line 84
71 | float _S11 = P_5.y;
72 |
73 | #line 84
74 | float _S12 = 0.40000000596046448 * s_0;
75 |
76 | #line 84
77 | float2 _S13 = float2(0.70710676908493042) ;
78 |
79 | #line 84
80 | float2 _S14 = float2(s_0) ;
81 |
82 | #line 84
83 | float2 _S15 = float2(size_5) ;
84 |
85 | #line 100
86 | return min(min(min(max(abs(0.70710676908493042 * (_S10 + _S11) + _S12), abs(0.70710676908493042 * (_S10 - _S11) - _S12)) - s_0, length(P_5 - _S13 * float2(1.0, 0.20000000298023224) * _S14) - s_0), length(P_5 - _S13 * float2(-1.0, 0.20000000298023224) * _S14) - s_0), max(- min(length(P_5 - float2(0.64999997615814209, 0.125) * _S15) - size_5 / 1.60000002384185791, length(P_5 - float2(-0.64999997615814209, 0.125) * _S15) - size_5 / 1.60000002384185791), max(_S11 - 0.5 * size_5, 0.10000000149011612 * size_5 - _S11)));
87 | }
88 |
89 |
90 | float club_0(float2 P_6, float size_6)
91 | {
92 |
93 | #line 104
94 | float2 _S16 = float2(0.22499999403953552) ;
95 |
96 | #line 104
97 | float2 _S17 = float2(size_6) ;
98 |
99 | #line 123
100 | float _S18 = P_6.y;
101 |
102 |
103 |
104 | return min(min(min(length(P_6 - _S16 * float2(cos(-1.57079637050628662), sin(-1.57079637050628662)) * _S17) - size_6 / 4.25, length(P_6 - _S16 * float2(cos(0.52359879016876221), sin(0.52359879016876221)) * _S17) - size_6 / 4.25), length(P_6 - _S16 * float2(cos(2.61799383163452148), sin(2.61799383163452148)) * _S17) - size_6 / 4.25), max(- min(length(P_6 - float2(0.64999997615814209, 0.125) * _S17) - size_6 / 1.60000002384185791, length(P_6 - float2(-0.64999997615814209, 0.125) * _S17) - size_6 / 1.60000002384185791), max(_S18 - 0.5 * size_6, 0.20000000298023224 * size_6 - _S18)));
105 | }
106 |
107 |
108 | float chevron_0(float2 P_7, float size_7)
109 | {
110 | float _S19 = P_7.x;
111 |
112 | #line 133
113 | float _S20 = P_7.y;
114 |
115 | #line 133
116 | float x_0 = 0.70710676908493042 * (_S19 - _S20);
117 | float y_0 = 0.70710676908493042 * (_S19 + _S20);
118 |
119 |
120 | return max(max(abs(x_0), abs(y_0)) - size_7 / 3.0, - (max(abs(x_0 - size_7 / 3.0), abs(y_0 - size_7 / 3.0)) - size_7 / 3.0));
121 | }
122 |
123 |
124 | float clover_0(float2 P_8, float size_8)
125 | {
126 |
127 | #line 141
128 | float2 _S21 = float2(0.25) ;
129 |
130 | #line 141
131 | float2 _S22 = float2(size_8) ;
132 |
133 | #line 153
134 | return min(min(length(P_8 - _S21 * float2(cos(-1.57079637050628662), sin(-1.57079637050628662)) * _S22) - size_8 / 3.5, length(P_8 - _S21 * float2(cos(0.52359879016876221), sin(0.52359879016876221)) * _S22) - size_8 / 3.5), length(P_8 - _S21 * float2(cos(2.61799383163452148), sin(2.61799383163452148)) * _S22) - size_8 / 3.5);
135 | }
136 |
137 |
138 | float ring_0(float2 P_9, float size_9)
139 | {
140 | float _S23 = length(P_9);
141 |
142 | return max(_S23 - size_9 / 2.0, - (_S23 - size_9 / 4.0));
143 | }
144 |
145 |
146 | float tag_0(float2 P_10, float size_10)
147 | {
148 | float _S24 = P_10.x;
149 |
150 | #line 167
151 | float _S25 = abs(P_10.y);
152 |
153 | return max(max(abs(_S24) - size_10 / 2.0, _S25 - size_10 / 6.0), 0.75 * (abs(_S24 - size_10 / 1.5) + _S25 - size_10));
154 | }
155 |
156 |
157 | float cross_0(float2 P_11, float size_11)
158 | {
159 | float _S26 = P_11.x;
160 |
161 | #line 175
162 | float _S27 = P_11.y;
163 |
164 | #line 175
165 | float x_1 = 0.70710676908493042 * (_S26 - _S27);
166 | float y_1 = 0.70710676908493042 * (_S26 + _S27);
167 |
168 | #line 182
169 | return max(min(max(abs(x_1 - size_11 / 3.0), abs(x_1 + size_11 / 3.0)), max(abs(y_1 - size_11 / 3.0), abs(y_1 + size_11 / 3.0))), max(abs(x_1), abs(y_1))) - size_11 / 2.0;
170 | }
171 |
172 |
173 | float asterisk_0(float2 P_12, float size_12)
174 | {
175 | float _S28 = P_12.x;
176 |
177 | #line 188
178 | float _S29 = P_12.y;
179 |
180 | float _S30 = abs(0.70710676908493042 * (_S28 - _S29));
181 |
182 | #line 190
183 | float _S31 = abs(0.70710676908493042 * (_S28 + _S29));
184 |
185 | float _S32 = abs(_S28);
186 |
187 | #line 192
188 | float _S33 = abs(_S29);
189 |
190 | return min(min(max(_S30 - size_12 / 2.0, _S31 - size_12 / 10.0), max(_S31 - size_12 / 2.0, _S30 - size_12 / 10.0)), min(max(_S32 - size_12 / 2.0, _S33 - size_12 / 10.0), max(_S33 - size_12 / 2.0, _S32 - size_12 / 10.0)));
191 | }
192 |
193 |
194 | float infinity_0(float2 P_13, float size_13)
195 | {
196 |
197 | #line 198
198 | float2 _S34 = float2(size_13) ;
199 |
200 |
201 |
202 | float _S35 = length(P_13 - float2(0.21250000596046448, 0.0) * _S34);
203 |
204 | float _S36 = length(P_13 - float2(-0.21250000596046448, 0.0) * _S34);
205 |
206 | return min(max(_S35 - size_13 / 3.5, - (_S35 - size_13 / 7.5)), max(_S36 - size_13 / 3.5, - (_S36 - size_13 / 7.5)));
207 | }
208 |
209 |
210 | float pin_0(float2 P_14, float size_14)
211 | {
212 |
213 | #line 210
214 | float2 _S37 = float2(size_14) ;
215 |
216 |
217 | float _S38 = length(P_14 - float2(0.0, -0.15000000596046448) * _S37);
218 |
219 | float _S39 = 2.0 * size_14;
220 |
221 |
222 |
223 | return max(min(_S38 - size_14 / 2.67499995231628418, max(max(length(P_14 - float2(1.49000000953674316, -0.80000001192092896) * _S37) - _S39, length(P_14 - float2(-1.49000000953674316, -0.80000001192092896) * _S37) - _S39), - P_14.y)), - (_S38 - size_14 / 5.0));
224 | }
225 |
226 |
227 | float arrow_0(float2 P_15, float size_15)
228 | {
229 | float _S40 = P_15.x;
230 |
231 | #line 225
232 | float _S41 = abs(P_15.y);
233 |
234 |
235 | return min(max(abs(_S40 - size_15 / 6.0) - size_15 / 4.0, _S41 - size_15 / 4.0), max(0.75 * (abs(_S40) + _S41 - size_15 / 2.0), max(abs(_S40 + size_15 / 2.0), _S41) - size_15 / 2.0));
236 | }
237 |
238 |
239 |
240 |
241 | float ellipse_0(float2 P_16, float size_16)
242 | {
243 | float _S42 = size_16 / 3.0;
244 |
245 | #line 236
246 | float _S43 = size_16 / 2.0;
247 |
248 | #line 236
249 | float2 ab_0 = float2(_S42, _S43);
250 | float2 p_0 = abs(P_16);
251 |
252 | #line 237
253 | float2 ab_1;
254 |
255 | #line 237
256 | float2 p_1;
257 | if((p_0.x) > (p_0.y))
258 | {
259 | float2 _S44 = p_0.yx;
260 |
261 | #line 240
262 | ab_1 = float2(_S43, _S42);
263 |
264 | #line 240
265 | p_1 = _S44;
266 |
267 | #line 238
268 | }
269 | else
270 | {
271 |
272 | #line 238
273 | ab_1 = ab_0;
274 |
275 | #line 238
276 | p_1 = p_0;
277 |
278 | #line 238
279 | }
280 |
281 | #line 243
282 | float _S45 = ab_1.y;
283 |
284 | #line 243
285 | float _S46 = ab_1.x;
286 |
287 | #line 243
288 | float l_0 = _S45 * _S45 - _S46 * _S46;
289 | float m_0 = _S46 * p_1.x / l_0;
290 | float _S47 = p_1.y;
291 |
292 | #line 245
293 | float n_0 = _S45 * _S47 / l_0;
294 | float m2_0 = m_0 * m_0;
295 | float n2_0 = n_0 * n_0;
296 |
297 | float c_0 = (m2_0 + n2_0 - 1.0) / 3.0;
298 | float c3_0 = c_0 * c_0 * c_0;
299 |
300 | float _S48 = m2_0 * n2_0;
301 |
302 | #line 252
303 | float q_0 = c3_0 + _S48 * 2.0;
304 | float d_0 = c3_0 + _S48;
305 | float g_0 = m_0 + m_0 * n2_0;
306 |
307 | #line 254
308 | float co_0;
309 |
310 |
311 |
312 | if(d_0 < 0.0)
313 | {
314 | float p_2 = acos(q_0 / c3_0) / 3.0;
315 | float s_1 = cos(p_2);
316 | float t_0 = sin(p_2) * sqrt(3.0);
317 | float _S49 = - c_0;
318 |
319 | #line 263
320 | float rx_0 = sqrt(_S49 * (s_1 + t_0 + 2.0) + m2_0);
321 | float ry_0 = sqrt(_S49 * (s_1 - t_0 + 2.0) + m2_0);
322 |
323 | #line 264
324 | co_0 = (ry_0 + float((int(sign((l_0))))) * rx_0 + abs(g_0) / (rx_0 * ry_0) - m_0) / 2.0;
325 |
326 | #line 258
327 | }
328 | else
329 | {
330 |
331 | #line 269
332 | float h_0 = 2.0 * m_0 * n_0 * sqrt(d_0);
333 | float _S50 = q_0 + h_0;
334 |
335 | #line 270
336 | float s_2 = float((int(sign((_S50))))) * pow(abs(_S50), 0.3333333432674408);
337 | float _S51 = q_0 - h_0;
338 |
339 | #line 271
340 | float u_0 = float((int(sign((_S51))))) * pow(abs(_S51), 0.3333333432674408);
341 | float rx_1 = - s_2 - u_0 - c_0 * 4.0 + 2.0 * m2_0;
342 | float ry_1 = (s_2 - u_0) * sqrt(3.0);
343 | float rm_0 = sqrt(rx_1 * rx_1 + ry_1 * ry_1);
344 |
345 | #line 274
346 | co_0 = (ry_1 / sqrt(rm_0 - rx_1) + 2.0 * g_0 / rm_0 - m_0) / 2.0;
347 |
348 | #line 258
349 | }
350 |
351 | #line 280
352 | float _S52 = _S45 * sqrt(1.0 - co_0 * co_0);
353 | return length(float2(_S46 * co_0, _S52) - p_1) * float((int(sign((_S47 - _S52)))));
354 | }
355 |
356 | float ellipse_fast_0(float2 P_17, float size_17)
357 | {
358 |
359 | #line 290
360 | float f_0 = length(P_17 * float2(1.0, 3.0));
361 |
362 | return f_0 * (f_0 - 0.89999997615814209) / length(P_17 * float2(1.0, 9.0));
363 | }
364 |
365 |
366 | #line 312
367 | float4 filled_0(float distance_0, float linewidth_0, float antialias_0, float4 fill_0)
368 | {
369 |
370 |
371 |
372 | float border_distance_0 = abs(distance_0) - (linewidth_0 / 2.0 - antialias_0);
373 | float alpha_0 = border_distance_0 / antialias_0;
374 | float alpha_1 = exp(- alpha_0 * alpha_0);
375 |
376 | #line 319
377 | float4 frag_color_0;
378 |
379 | if(border_distance_0 < 0.0)
380 | {
381 |
382 | #line 321
383 | frag_color_0 = fill_0;
384 |
385 | #line 321
386 | }
387 | else
388 | {
389 |
390 | #line 323
391 | if(distance_0 < 0.0)
392 | {
393 |
394 | #line 323
395 | frag_color_0 = fill_0;
396 |
397 | #line 323
398 | }
399 | else
400 | {
401 |
402 | #line 323
403 | frag_color_0 = float4(fill_0.xyz, alpha_1 * fill_0.w);
404 |
405 | #line 323
406 | }
407 |
408 | #line 321
409 | }
410 |
411 | #line 328
412 | return frag_color_0;
413 | }
414 |
415 |
416 | #line 295
417 | float4 stroke_0(float distance_1, float linewidth_1, float antialias_1, float4 stroke_1)
418 | {
419 |
420 |
421 |
422 | float border_distance_1 = abs(distance_1) - (linewidth_1 / 2.0 - antialias_1);
423 | float alpha_2 = border_distance_1 / antialias_1;
424 | float alpha_3 = exp(- alpha_2 * alpha_2);
425 |
426 | #line 302
427 | float4 frag_color_1;
428 |
429 | if(border_distance_1 < 0.0)
430 | {
431 |
432 | #line 304
433 | frag_color_1 = stroke_1;
434 |
435 | #line 304
436 | }
437 | else
438 | {
439 |
440 | #line 304
441 | frag_color_1 = float4(stroke_1.xyz, stroke_1.w * alpha_3);
442 |
443 | #line 304
444 | }
445 |
446 | #line 309
447 | return frag_color_1;
448 | }
449 |
450 |
451 | #line 331
452 | float4 outline_0(float distance_2, float linewidth_2, float antialias_2, float4 stroke_2, float4 fill_1)
453 | {
454 |
455 |
456 |
457 | float border_distance_2 = abs(distance_2) - (linewidth_2 / 2.0 - antialias_2);
458 | float alpha_4 = border_distance_2 / antialias_2;
459 | float alpha_5 = exp(- alpha_4 * alpha_4);
460 |
461 | #line 338
462 | float4 frag_color_2;
463 |
464 | if(border_distance_2 < 0.0)
465 | {
466 |
467 | #line 340
468 | frag_color_2 = stroke_2;
469 |
470 | #line 340
471 | }
472 | else
473 | {
474 |
475 | #line 342
476 | if(distance_2 < 0.0)
477 | {
478 |
479 | #line 342
480 | frag_color_2 = mix(fill_1, stroke_2, float4(sqrt(alpha_5)) );
481 |
482 | #line 342
483 | }
484 | else
485 | {
486 |
487 | #line 342
488 | frag_color_2 = float4(stroke_2.xyz, stroke_2.w * alpha_5);
489 |
490 | #line 342
491 | }
492 |
493 | #line 340
494 | }
495 |
496 | #line 347
497 | return frag_color_2;
498 | }
499 |
500 |
501 | #line 90 "core"
502 | struct pixelOutput_0
503 | {
504 | float4 output_0 [[color(0)]];
505 | };
506 |
507 |
508 | #line 90
509 | struct pixelInput_0
510 | {
511 | float4 col_0 [[user(COLOR)]];
512 | float2 uv_0 [[user(TEXCOORD)]];
513 | };
514 |
515 |
516 | #line 1 "C:/git/DearWidgets/workingdir/shaders/hlsl_src/markers.hlsl"
517 | struct SLANG_ParameterGroup_PS_CONSTANT_BUFFER_0
518 | {
519 | float4 fg_color_0;
520 | float4 bg_color_0;
521 | float2 rotation_0;
522 | float linewidth_3;
523 | float size_18;
524 | float type_0;
525 | float antialiasing_0;
526 | float draw_type_0;
527 | float pad0_0;
528 | };
529 |
530 |
531 | #line 4264 "core.meta.slang"
532 | struct KernelContext_0
533 | {
534 | SLANG_ParameterGroup_PS_CONSTANT_BUFFER_0 constant* PS_CONSTANT_BUFFER_0;
535 | };
536 |
537 |
538 | #line 362 "C:/git/DearWidgets/workingdir/shaders/hlsl_src/markers.hlsl"
539 | [[fragment]] pixelOutput_0 main_ps(pixelInput_0 _S53 [[stage_in]], float4 pos_0 [[position]], SLANG_ParameterGroup_PS_CONSTANT_BUFFER_0 constant* PS_CONSTANT_BUFFER_1 [[buffer(0)]])
540 | {
541 |
542 | #line 362
543 | KernelContext_0 kernelContext_0;
544 |
545 | #line 362
546 | (&kernelContext_0)->PS_CONSTANT_BUFFER_0 = PS_CONSTANT_BUFFER_1;
547 |
548 |
549 |
550 | float4 _S54 = float4(1.0, 1.0, 1.0, 1.0);
551 |
552 | float2 _S55 = _S53.uv_0.xy - float2(0.5) ;
553 |
554 | #line 368
555 | thread float2 P_18 = _S55;
556 | P_18.y = - _S55.y;
557 | P_18 = float2(PS_CONSTANT_BUFFER_1->rotation_0.x * P_18.x - PS_CONSTANT_BUFFER_1->rotation_0.y * P_18.y, PS_CONSTANT_BUFFER_1->rotation_0.y * P_18.x + PS_CONSTANT_BUFFER_1->rotation_0.x * P_18.y);
558 |
559 |
560 | float antialias_3 = PS_CONSTANT_BUFFER_1->antialiasing_0;
561 | float point_size_0 = 1.41421353816986084 * PS_CONSTANT_BUFFER_1->size_18 + 2.0 * (PS_CONSTANT_BUFFER_1->linewidth_3 + 1.5 * PS_CONSTANT_BUFFER_1->antialiasing_0);
562 |
563 | #line 374
564 | float distance_3;
565 |
566 | if((PS_CONSTANT_BUFFER_1->type_0) == 0.0)
567 | {
568 |
569 | #line 376
570 | distance_3 = disc_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
571 |
572 | #line 376
573 | }
574 | else
575 | {
576 |
577 | #line 378
578 | if((PS_CONSTANT_BUFFER_1->type_0) == 1.0)
579 | {
580 |
581 | #line 378
582 | distance_3 = square_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
583 |
584 | #line 378
585 | }
586 | else
587 | {
588 |
589 | #line 380
590 | if((PS_CONSTANT_BUFFER_1->type_0) == 2.0)
591 | {
592 |
593 | #line 380
594 | distance_3 = triangle2_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
595 |
596 | #line 380
597 | }
598 | else
599 | {
600 |
601 | #line 382
602 | if((PS_CONSTANT_BUFFER_1->type_0) == 3.0)
603 | {
604 |
605 | #line 382
606 | distance_3 = diamond_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
607 |
608 | #line 382
609 | }
610 | else
611 | {
612 |
613 | #line 384
614 | if((PS_CONSTANT_BUFFER_1->type_0) == 4.0)
615 | {
616 |
617 | #line 384
618 | distance_3 = heart_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
619 |
620 | #line 384
621 | }
622 | else
623 | {
624 |
625 | #line 386
626 | if((PS_CONSTANT_BUFFER_1->type_0) == 5.0)
627 | {
628 |
629 | #line 386
630 | distance_3 = spade_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
631 |
632 | #line 386
633 | }
634 | else
635 | {
636 |
637 | #line 388
638 | if((PS_CONSTANT_BUFFER_1->type_0) == 6.0)
639 | {
640 |
641 | #line 388
642 | distance_3 = club_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
643 |
644 | #line 388
645 | }
646 | else
647 | {
648 |
649 | #line 390
650 | if((PS_CONSTANT_BUFFER_1->type_0) == 7.0)
651 | {
652 |
653 | #line 390
654 | distance_3 = chevron_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
655 |
656 | #line 390
657 | }
658 | else
659 | {
660 |
661 | #line 392
662 | if((PS_CONSTANT_BUFFER_1->type_0) == 8.0)
663 | {
664 |
665 | #line 392
666 | distance_3 = clover_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
667 |
668 | #line 392
669 | }
670 | else
671 | {
672 |
673 | #line 394
674 | if((PS_CONSTANT_BUFFER_1->type_0) == 9.0)
675 | {
676 |
677 | #line 394
678 | distance_3 = ring_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
679 |
680 | #line 394
681 | }
682 | else
683 | {
684 |
685 | #line 396
686 | if((PS_CONSTANT_BUFFER_1->type_0) == 10.0)
687 | {
688 |
689 | #line 396
690 | distance_3 = tag_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
691 |
692 | #line 396
693 | }
694 | else
695 | {
696 |
697 | #line 398
698 | if((PS_CONSTANT_BUFFER_1->type_0) == 11.0)
699 | {
700 |
701 | #line 398
702 | distance_3 = cross_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
703 |
704 | #line 398
705 | }
706 | else
707 | {
708 |
709 | #line 400
710 | if((PS_CONSTANT_BUFFER_1->type_0) == 12.0)
711 | {
712 |
713 | #line 400
714 | distance_3 = asterisk_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
715 |
716 | #line 400
717 | }
718 | else
719 | {
720 |
721 | #line 402
722 | if((PS_CONSTANT_BUFFER_1->type_0) == 13.0)
723 | {
724 |
725 | #line 402
726 | distance_3 = infinity_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
727 |
728 | #line 402
729 | }
730 | else
731 | {
732 |
733 | #line 404
734 | if((PS_CONSTANT_BUFFER_1->type_0) == 14.0)
735 | {
736 |
737 | #line 404
738 | distance_3 = pin_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
739 |
740 | #line 404
741 | }
742 | else
743 | {
744 |
745 | #line 406
746 | if((PS_CONSTANT_BUFFER_1->type_0) == 15.0)
747 | {
748 |
749 | #line 406
750 | distance_3 = arrow_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
751 |
752 | #line 406
753 | }
754 | else
755 | {
756 |
757 | #line 408
758 | if((PS_CONSTANT_BUFFER_1->type_0) == 16.0)
759 | {
760 |
761 | #line 408
762 | distance_3 = ellipse_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
763 |
764 | #line 408
765 | }
766 | else
767 | {
768 |
769 | #line 410
770 | if((PS_CONSTANT_BUFFER_1->type_0) == 17.0)
771 | {
772 |
773 | #line 410
774 | distance_3 = ellipse_fast_0(P_18 * float2(point_size_0) , PS_CONSTANT_BUFFER_1->size_18);
775 |
776 | #line 410
777 | }
778 |
779 | #line 408
780 | }
781 |
782 | #line 406
783 | }
784 |
785 | #line 404
786 | }
787 |
788 | #line 402
789 | }
790 |
791 | #line 400
792 | }
793 |
794 | #line 398
795 | }
796 |
797 | #line 396
798 | }
799 |
800 | #line 394
801 | }
802 |
803 | #line 392
804 | }
805 |
806 | #line 390
807 | }
808 |
809 | #line 388
810 | }
811 |
812 | #line 386
813 | }
814 |
815 | #line 384
816 | }
817 |
818 | #line 382
819 | }
820 |
821 | #line 380
822 | }
823 |
824 | #line 378
825 | }
826 |
827 | #line 376
828 | }
829 |
830 | #line 376
831 | float4 col_out_0;
832 |
833 | #line 413
834 | if(((&kernelContext_0)->PS_CONSTANT_BUFFER_0->draw_type_0) == 0.0)
835 | {
836 |
837 | #line 413
838 | col_out_0 = filled_0(distance_3, PS_CONSTANT_BUFFER_1->linewidth_3, antialias_3, (&kernelContext_0)->PS_CONSTANT_BUFFER_0->fg_color_0);
839 |
840 | #line 413
841 | }
842 | else
843 | {
844 |
845 | #line 415
846 | if(((&kernelContext_0)->PS_CONSTANT_BUFFER_0->draw_type_0) == 1.0)
847 | {
848 |
849 | #line 415
850 | col_out_0 = stroke_0(distance_3, PS_CONSTANT_BUFFER_1->linewidth_3, antialias_3, (&kernelContext_0)->PS_CONSTANT_BUFFER_0->fg_color_0);
851 |
852 | #line 415
853 | }
854 | else
855 | {
856 |
857 | #line 417
858 | if(((&kernelContext_0)->PS_CONSTANT_BUFFER_0->draw_type_0) == 2.0)
859 | {
860 |
861 | #line 417
862 | col_out_0 = outline_0(distance_3, PS_CONSTANT_BUFFER_1->linewidth_3, antialias_3, (&kernelContext_0)->PS_CONSTANT_BUFFER_0->fg_color_0, (&kernelContext_0)->PS_CONSTANT_BUFFER_0->bg_color_0);
863 |
864 | #line 417
865 | }
866 | else
867 | {
868 |
869 | #line 419
870 | if(((&kernelContext_0)->PS_CONSTANT_BUFFER_0->draw_type_0) == 3.0)
871 | {
872 |
873 | #line 419
874 | col_out_0 = float4(float3(pow(abs(distance_3), 0.45454543828964233)) , 1.0);
875 |
876 | #line 419
877 | }
878 | else
879 | {
880 |
881 | #line 421
882 | if(((&kernelContext_0)->PS_CONSTANT_BUFFER_0->draw_type_0) == 4.0)
883 | {
884 |
885 | #line 422
886 | float4 _S56 = (&kernelContext_0)->PS_CONSTANT_BUFFER_0->fg_color_0;
887 |
888 | #line 422
889 | float4 _S57 = (&kernelContext_0)->PS_CONSTANT_BUFFER_0->bg_color_0;
890 |
891 | #line 422
892 | if(distance_3 > 0.0)
893 | {
894 |
895 | #line 422
896 | col_out_0 = float4(1.0) ;
897 |
898 | #line 422
899 | }
900 | else
901 | {
902 |
903 | #line 422
904 | col_out_0 = float4(0.0) ;
905 |
906 | #line 422
907 | }
908 |
909 | #line 422
910 | col_out_0 = mix(_S56, _S57, col_out_0);
911 |
912 | #line 421
913 | }
914 | else
915 | {
916 |
917 | #line 421
918 | col_out_0 = _S54;
919 |
920 | #line 421
921 | }
922 |
923 | #line 419
924 | }
925 |
926 | #line 417
927 | }
928 |
929 | #line 415
930 | }
931 |
932 | #line 413
933 | }
934 |
935 | #line 413
936 | pixelOutput_0 _S58 = { col_out_0 };
937 |
938 | #line 424
939 | return _S58;
940 | }
941 |
942 |
--------------------------------------------------------------------------------
/workingdir/shaders/msl/markers_vs.msl:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 | using namespace metal;
5 |
6 | #line 1972 "core.meta.slang"
7 | struct _MatrixStorage_float4x4_ColMajornatural_0
8 | {
9 | array data_0;
10 | };
11 |
12 |
13 | #line 1972
14 | matrix unpackStorage_0(_MatrixStorage_float4x4_ColMajornatural_0 _S1)
15 | {
16 |
17 | #line 1972
18 | return matrix (_S1.data_0[int(0)][int(0)], _S1.data_0[int(1)][int(0)], _S1.data_0[int(2)][int(0)], _S1.data_0[int(3)][int(0)], _S1.data_0[int(0)][int(1)], _S1.data_0[int(1)][int(1)], _S1.data_0[int(2)][int(1)], _S1.data_0[int(3)][int(1)], _S1.data_0[int(0)][int(2)], _S1.data_0[int(1)][int(2)], _S1.data_0[int(2)][int(2)], _S1.data_0[int(3)][int(2)], _S1.data_0[int(0)][int(3)], _S1.data_0[int(1)][int(3)], _S1.data_0[int(2)][int(3)], _S1.data_0[int(3)][int(3)]);
19 | }
20 |
21 |
22 | #line 28 "C:/git/DearWidgets/workingdir/shaders/hlsl_src/markers.hlsl"
23 | struct PS_INPUT_0
24 | {
25 | float4 pos_0 [[position]];
26 | float4 col_0 [[user(COLOR)]];
27 | float2 uv_0 [[user(TEXCOORD)]];
28 | };
29 |
30 |
31 | #line 28
32 | struct vertexInput_0
33 | {
34 | float2 pos_1 [[attribute(0)]];
35 | float4 col_1 [[attribute(1)]];
36 | float2 uv_1 [[attribute(2)]];
37 | };
38 |
39 |
40 | #line 28
41 | struct SLANG_ParameterGroup_vertexBuffer_natural_0
42 | {
43 | _MatrixStorage_float4x4_ColMajornatural_0 ProjectionMatrix_0;
44 | };
45 |
46 |
47 | #line 353
48 | [[vertex]] PS_INPUT_0 main_vs(vertexInput_0 _S2 [[stage_in]], SLANG_ParameterGroup_vertexBuffer_natural_0 constant* vertexBuffer_0 [[buffer(1)]])
49 | {
50 | thread PS_INPUT_0 output_0;
51 | (&output_0)->pos_0 = (((float4(_S2.pos_1.xy, 0.0, 1.0)) * (unpackStorage_0(vertexBuffer_0->ProjectionMatrix_0))));
52 | (&output_0)->col_0 = _S2.col_1;
53 | (&output_0)->uv_0 = _S2.uv_1;
54 | return output_0;
55 | }
56 |
57 |
--------------------------------------------------------------------------------
/workingdir/shaders/wgpu/markers_ps.wgpu:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/shaders/wgpu/markers_ps.wgpu
--------------------------------------------------------------------------------
/workingdir/shaders/wgpu/markers_vs.wgpu:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soufianekhiat/DearWidgets/58d907638cdb9647d35c988b5e0ee60a06a9d33a/workingdir/shaders/wgpu/markers_vs.wgpu
--------------------------------------------------------------------------------
/workingdir/shaders/wgsl/markers_ps.wgsl:
--------------------------------------------------------------------------------
1 | struct SLANG_ParameterGroup_PS_CONSTANT_BUFFER_std140_0
2 | {
3 | @align(16) fg_color_0 : vec4,
4 | @align(16) bg_color_0 : vec4,
5 | @align(16) rotation_0 : vec2,
6 | @align(8) linewidth_0 : f32,
7 | @align(4) size_0 : f32,
8 | @align(16) type_0 : f32,
9 | @align(4) antialiasing_0 : f32,
10 | @align(8) draw_type_0 : f32,
11 | @align(4) pad0_0 : f32,
12 | };
13 |
14 | @binding(0) @group(0) var PS_CONSTANT_BUFFER_0 : SLANG_ParameterGroup_PS_CONSTANT_BUFFER_std140_0;
15 | fn disc_0( P_0 : vec2, size_1 : f32) -> f32
16 | {
17 | return length(P_0) - size_1 * 0.5f;
18 | }
19 |
20 | fn square_0( P_1 : vec2, size_2 : f32) -> f32
21 | {
22 | return max(abs(P_1.x), abs(P_1.y)) - size_2 / 2.82842707633972168f;
23 | }
24 |
25 | fn triangle2_0( P_2 : vec2, size_3 : f32) -> f32
26 | {
27 | var _S1 : f32 = P_2.x;
28 | var _S2 : f32 = P_2.y;
29 | return max(max(abs(0.70710676908493042f * (_S1 - _S2)), abs(0.70710676908493042f * (_S1 + _S2))) - size_3 / 2.82842707633972168f, _S2);
30 | }
31 |
32 | fn diamond_0( P_3 : vec2, size_4 : f32) -> f32
33 | {
34 | var _S3 : f32 = P_3.x;
35 | var _S4 : f32 = P_3.y;
36 | return max(abs(0.70710676908493042f * (_S3 - _S4)), abs(0.70710676908493042f * (_S3 + _S4))) - size_4 / 2.82842707633972168f;
37 | }
38 |
39 | fn heart_0( P_4 : vec2, size_5 : f32) -> f32
40 | {
41 | var _S5 : f32 = P_4.x;
42 | var _S6 : f32 = P_4.y;
43 | var _S7 : vec2 = vec2(0.70710676908493042f);
44 | var _S8 : vec2 = vec2(size_5);
45 | var _S9 : vec2 = vec2(3.5f);
46 | return min(min(max(abs(0.70710676908493042f * (_S5 - _S6)), abs(0.70710676908493042f * (_S5 + _S6))) - size_5 / 3.5f, length(P_4 - _S7 * vec2(1.0f, -1.0f) * _S8 / _S9) - size_5 / 3.5f), length(P_4 - _S7 * vec2(-1.0f, -1.0f) * _S8 / _S9) - size_5 / 3.5f);
47 | }
48 |
49 | fn spade_0( P_5 : vec2, size_6 : f32) -> f32
50 | {
51 | var s_0 : f32 = size_6 * 0.85000002384185791f / 3.5f;
52 | var _S10 : f32 = P_5.x;
53 | var _S11 : f32 = P_5.y;
54 | var _S12 : f32 = 0.40000000596046448f * s_0;
55 | var _S13 : vec2 = vec2(0.70710676908493042f);
56 | var _S14 : vec2 = vec2(s_0);
57 | var _S15 : vec2 = vec2(size_6);
58 | return min(min(min(max(abs(0.70710676908493042f * (_S10 + _S11) + _S12), abs(0.70710676908493042f * (_S10 - _S11) - _S12)) - s_0, length(P_5 - _S13 * vec2(1.0f, 0.20000000298023224f) * _S14) - s_0), length(P_5 - _S13 * vec2(-1.0f, 0.20000000298023224f) * _S14) - s_0), max(- min(length(P_5 - vec2(0.64999997615814209f, 0.125f) * _S15) - size_6 / 1.60000002384185791f, length(P_5 - vec2(-0.64999997615814209f, 0.125f) * _S15) - size_6 / 1.60000002384185791f), max(_S11 - 0.5f * size_6, 0.10000000149011612f * size_6 - _S11)));
59 | }
60 |
61 | fn club_0( P_6 : vec2, size_7 : f32) -> f32
62 | {
63 | var _S16 : vec2 = vec2(0.22499999403953552f);
64 | var _S17 : vec2 = vec2(size_7);
65 | var _S18 : f32 = P_6.y;
66 | return min(min(min(length(P_6 - _S16 * vec2(cos(-1.57079637050628662f), sin(-1.57079637050628662f)) * _S17) - size_7 / 4.25f, length(P_6 - _S16 * vec2(cos(0.52359879016876221f), sin(0.52359879016876221f)) * _S17) - size_7 / 4.25f), length(P_6 - _S16 * vec2(cos(2.61799383163452148f), sin(2.61799383163452148f)) * _S17) - size_7 / 4.25f), max(- min(length(P_6 - vec2(0.64999997615814209f, 0.125f) * _S17) - size_7 / 1.60000002384185791f, length(P_6 - vec2(-0.64999997615814209f, 0.125f) * _S17) - size_7 / 1.60000002384185791f), max(_S18 - 0.5f * size_7, 0.20000000298023224f * size_7 - _S18)));
67 | }
68 |
69 | fn chevron_0( P_7 : vec2, size_8 : f32) -> f32
70 | {
71 | var _S19 : f32 = P_7.x;
72 | var _S20 : f32 = P_7.y;
73 | var x_0 : f32 = 0.70710676908493042f * (_S19 - _S20);
74 | var y_0 : f32 = 0.70710676908493042f * (_S19 + _S20);
75 | return max(max(abs(x_0), abs(y_0)) - size_8 / 3.0f, - (max(abs(x_0 - size_8 / 3.0f), abs(y_0 - size_8 / 3.0f)) - size_8 / 3.0f));
76 | }
77 |
78 | fn clover_0( P_8 : vec2, size_9 : f32) -> f32
79 | {
80 | var _S21 : vec2 = vec2(0.25f);
81 | var _S22 : vec2 = vec2(size_9);
82 | return min(min(length(P_8 - _S21 * vec2(cos(-1.57079637050628662f), sin(-1.57079637050628662f)) * _S22) - size_9 / 3.5f, length(P_8 - _S21 * vec2(cos(0.52359879016876221f), sin(0.52359879016876221f)) * _S22) - size_9 / 3.5f), length(P_8 - _S21 * vec2(cos(2.61799383163452148f), sin(2.61799383163452148f)) * _S22) - size_9 / 3.5f);
83 | }
84 |
85 | fn ring_0( P_9 : vec2, size_10 : f32) -> f32
86 | {
87 | var _S23 : f32 = length(P_9);
88 | return max(_S23 - size_10 / 2.0f, - (_S23 - size_10 / 4.0f));
89 | }
90 |
91 | fn tag_0( P_10 : vec2, size_11 : f32) -> f32
92 | {
93 | var _S24 : f32 = P_10.x;
94 | var _S25 : f32 = abs(P_10.y);
95 | return max(max(abs(_S24) - size_11 / 2.0f, _S25 - size_11 / 6.0f), 0.75f * (abs(_S24 - size_11 / 1.5f) + _S25 - size_11));
96 | }
97 |
98 | fn cross_0( P_11 : vec2, size_12 : f32) -> f32
99 | {
100 | var _S26 : f32 = P_11.x;
101 | var _S27 : f32 = P_11.y;
102 | var x_1 : f32 = 0.70710676908493042f * (_S26 - _S27);
103 | var y_1 : f32 = 0.70710676908493042f * (_S26 + _S27);
104 | return max(min(max(abs(x_1 - size_12 / 3.0f), abs(x_1 + size_12 / 3.0f)), max(abs(y_1 - size_12 / 3.0f), abs(y_1 + size_12 / 3.0f))), max(abs(x_1), abs(y_1))) - size_12 / 2.0f;
105 | }
106 |
107 | fn asterisk_0( P_12 : vec2, size_13 : f32) -> f32
108 | {
109 | var _S28 : f32 = P_12.x;
110 | var _S29 : f32 = P_12.y;
111 | var _S30 : f32 = abs(0.70710676908493042f * (_S28 - _S29));
112 | var _S31 : f32 = abs(0.70710676908493042f * (_S28 + _S29));
113 | var _S32 : f32 = abs(_S28);
114 | var _S33 : f32 = abs(_S29);
115 | return min(min(max(_S30 - size_13 / 2.0f, _S31 - size_13 / 10.0f), max(_S31 - size_13 / 2.0f, _S30 - size_13 / 10.0f)), min(max(_S32 - size_13 / 2.0f, _S33 - size_13 / 10.0f), max(_S33 - size_13 / 2.0f, _S32 - size_13 / 10.0f)));
116 | }
117 |
118 | fn infinity_0( P_13 : vec2, size_14 : f32) -> f32
119 | {
120 | var _S34 : vec2 = vec2(size_14);
121 | var _S35 : f32 = length(P_13 - vec2(0.21250000596046448f, 0.0f) * _S34);
122 | var _S36 : f32 = length(P_13 - vec2(-0.21250000596046448f, 0.0f) * _S34);
123 | return min(max(_S35 - size_14 / 3.5f, - (_S35 - size_14 / 7.5f)), max(_S36 - size_14 / 3.5f, - (_S36 - size_14 / 7.5f)));
124 | }
125 |
126 | fn pin_0( P_14 : vec2, size_15 : f32) -> f32
127 | {
128 | var _S37 : vec2 = vec2(size_15);
129 | var _S38 : f32 = length(P_14 - vec2(0.0f, -0.15000000596046448f) * _S37);
130 | var _S39 : f32 = 2.0f * size_15;
131 | return max(min(_S38 - size_15 / 2.67499995231628418f, max(max(length(P_14 - vec2(1.49000000953674316f, -0.80000001192092896f) * _S37) - _S39, length(P_14 - vec2(-1.49000000953674316f, -0.80000001192092896f) * _S37) - _S39), - P_14.y)), - (_S38 - size_15 / 5.0f));
132 | }
133 |
134 | fn arrow_0( P_15 : vec2, size_16 : f32) -> f32
135 | {
136 | var _S40 : f32 = P_15.x;
137 | var _S41 : f32 = abs(P_15.y);
138 | return min(max(abs(_S40 - size_16 / 6.0f) - size_16 / 4.0f, _S41 - size_16 / 4.0f), max(0.75f * (abs(_S40) + _S41 - size_16 / 2.0f), max(abs(_S40 + size_16 / 2.0f), _S41) - size_16 / 2.0f));
139 | }
140 |
141 | fn ellipse_0( P_16 : vec2, size_17 : f32) -> f32
142 | {
143 | var _S42 : f32 = size_17 / 3.0f;
144 | var _S43 : f32 = size_17 / 2.0f;
145 | var ab_0 : vec2 = vec2(_S42, _S43);
146 | var p_0 : vec2 = abs(P_16);
147 | var ab_1 : vec2;
148 | var p_1 : vec2;
149 | if((p_0.x) > (p_0.y))
150 | {
151 | var _S44 : vec2 = p_0.yx;
152 | ab_1 = vec2(_S43, _S42);
153 | p_1 = _S44;
154 | }
155 | else
156 | {
157 | ab_1 = ab_0;
158 | p_1 = p_0;
159 | }
160 | var _S45 : f32 = ab_1.y;
161 | var _S46 : f32 = ab_1.x;
162 | var l_0 : f32 = _S45 * _S45 - _S46 * _S46;
163 | var m_0 : f32 = _S46 * p_1.x / l_0;
164 | var _S47 : f32 = p_1.y;
165 | var n_0 : f32 = _S45 * _S47 / l_0;
166 | var m2_0 : f32 = m_0 * m_0;
167 | var n2_0 : f32 = n_0 * n_0;
168 | var c_0 : f32 = (m2_0 + n2_0 - 1.0f) / 3.0f;
169 | var c3_0 : f32 = c_0 * c_0 * c_0;
170 | var _S48 : f32 = m2_0 * n2_0;
171 | var q_0 : f32 = c3_0 + _S48 * 2.0f;
172 | var d_0 : f32 = c3_0 + _S48;
173 | var g_0 : f32 = m_0 + m_0 * n2_0;
174 | var co_0 : f32;
175 | if(d_0 < 0.0f)
176 | {
177 | var p_2 : f32 = acos(q_0 / c3_0) / 3.0f;
178 | var s_1 : f32 = cos(p_2);
179 | var t_0 : f32 = sin(p_2) * sqrt(3.0f);
180 | var _S49 : f32 = - c_0;
181 | var rx_0 : f32 = sqrt(_S49 * (s_1 + t_0 + 2.0f) + m2_0);
182 | var ry_0 : f32 = sqrt(_S49 * (s_1 - t_0 + 2.0f) + m2_0);
183 | co_0 = (ry_0 + f32(sign(l_0)) * rx_0 + abs(g_0) / (rx_0 * ry_0) - m_0) / 2.0f;
184 | }
185 | else
186 | {
187 | var h_0 : f32 = 2.0f * m_0 * n_0 * sqrt(d_0);
188 | var _S50 : f32 = q_0 + h_0;
189 | var s_2 : f32 = f32(sign(_S50)) * pow(abs(_S50), 0.3333333432674408f);
190 | var _S51 : f32 = q_0 - h_0;
191 | var u_0 : f32 = f32(sign(_S51)) * pow(abs(_S51), 0.3333333432674408f);
192 | var rx_1 : f32 = - s_2 - u_0 - c_0 * 4.0f + 2.0f * m2_0;
193 | var ry_1 : f32 = (s_2 - u_0) * sqrt(3.0f);
194 | var rm_0 : f32 = sqrt(rx_1 * rx_1 + ry_1 * ry_1);
195 | co_0 = (ry_1 / sqrt(rm_0 - rx_1) + 2.0f * g_0 / rm_0 - m_0) / 2.0f;
196 | }
197 | var _S52 : f32 = _S45 * sqrt(1.0f - co_0 * co_0);
198 | return length(vec2(_S46 * co_0, _S52) - p_1) * f32(sign(_S47 - _S52));
199 | }
200 |
201 | fn ellipse_fast_0( P_17 : vec2, size_18 : f32) -> f32
202 | {
203 | var f_0 : f32 = length(P_17 * vec2(1.0f, 3.0f));
204 | return f_0 * (f_0 - 0.89999997615814209f) / length(P_17 * vec2(1.0f, 9.0f));
205 | }
206 |
207 | fn filled_0( distance_0 : f32, linewidth_1 : f32, antialias_0 : f32, fill_0 : vec4) -> vec4
208 | {
209 | var border_distance_0 : f32 = abs(distance_0) - (linewidth_1 / 2.0f - antialias_0);
210 | var alpha_0 : f32 = border_distance_0 / antialias_0;
211 | var alpha_1 : f32 = exp(- alpha_0 * alpha_0);
212 | var frag_color_0 : vec4;
213 | if(border_distance_0 < 0.0f)
214 | {
215 | frag_color_0 = fill_0;
216 | }
217 | else
218 | {
219 | if(distance_0 < 0.0f)
220 | {
221 | frag_color_0 = fill_0;
222 | }
223 | else
224 | {
225 | frag_color_0 = vec4(fill_0.xyz, alpha_1 * fill_0.w);
226 | }
227 | }
228 | return frag_color_0;
229 | }
230 |
231 | fn stroke_0( distance_1 : f32, linewidth_2 : f32, antialias_1 : f32, stroke_1 : vec4) -> vec4
232 | {
233 | var border_distance_1 : f32 = abs(distance_1) - (linewidth_2 / 2.0f - antialias_1);
234 | var alpha_2 : f32 = border_distance_1 / antialias_1;
235 | var alpha_3 : f32 = exp(- alpha_2 * alpha_2);
236 | var frag_color_1 : vec4;
237 | if(border_distance_1 < 0.0f)
238 | {
239 | frag_color_1 = stroke_1;
240 | }
241 | else
242 | {
243 | frag_color_1 = vec4(stroke_1.xyz, stroke_1.w * alpha_3);
244 | }
245 | return frag_color_1;
246 | }
247 |
248 | fn outline_0( distance_2 : f32, linewidth_3 : f32, antialias_2 : f32, stroke_2 : vec4, fill_1 : vec4) -> vec4
249 | {
250 | var border_distance_2 : f32 = abs(distance_2) - (linewidth_3 / 2.0f - antialias_2);
251 | var alpha_4 : f32 = border_distance_2 / antialias_2;
252 | var alpha_5 : f32 = exp(- alpha_4 * alpha_4);
253 | var frag_color_2 : vec4;
254 | if(border_distance_2 < 0.0f)
255 | {
256 | frag_color_2 = stroke_2;
257 | }
258 | else
259 | {
260 | if(distance_2 < 0.0f)
261 | {
262 | frag_color_2 = mix(fill_1, stroke_2, vec4(sqrt(alpha_5)));
263 | }
264 | else
265 | {
266 | frag_color_2 = vec4(stroke_2.xyz, stroke_2.w * alpha_5);
267 | }
268 | }
269 | return frag_color_2;
270 | }
271 |
272 | struct pixelOutput_0
273 | {
274 | @location(0) output_0 : vec4,
275 | };
276 |
277 | struct pixelInput_0
278 | {
279 | @location(0) col_0 : vec4,
280 | @location(1) uv_0 : vec2,
281 | };
282 |
283 | @fragment
284 | fn main_ps( _S53 : pixelInput_0, @builtin(position) pos_0 : vec4) -> pixelOutput_0
285 | {
286 | const _S54 : vec4 = vec4(1.0f, 1.0f, 1.0f, 1.0f);
287 | var _S55 : vec2 = _S53.uv_0.xy - vec2(0.5f);
288 | var P_18 : vec2 = _S55;
289 | P_18[i32(1)] = - _S55.y;
290 | P_18 = vec2(PS_CONSTANT_BUFFER_0.rotation_0.x * P_18.x - PS_CONSTANT_BUFFER_0.rotation_0.y * P_18.y, PS_CONSTANT_BUFFER_0.rotation_0.y * P_18.x + PS_CONSTANT_BUFFER_0.rotation_0.x * P_18.y);
291 | var antialias_3 : f32 = PS_CONSTANT_BUFFER_0.antialiasing_0;
292 | var point_size_0 : f32 = 1.41421353816986084f * PS_CONSTANT_BUFFER_0.size_0 + 2.0f * (PS_CONSTANT_BUFFER_0.linewidth_0 + 1.5f * PS_CONSTANT_BUFFER_0.antialiasing_0);
293 | var distance_3 : f32;
294 | if((PS_CONSTANT_BUFFER_0.type_0) == 0.0f)
295 | {
296 | distance_3 = disc_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
297 | }
298 | else
299 | {
300 | if((PS_CONSTANT_BUFFER_0.type_0) == 1.0f)
301 | {
302 | distance_3 = square_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
303 | }
304 | else
305 | {
306 | if((PS_CONSTANT_BUFFER_0.type_0) == 2.0f)
307 | {
308 | distance_3 = triangle2_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
309 | }
310 | else
311 | {
312 | if((PS_CONSTANT_BUFFER_0.type_0) == 3.0f)
313 | {
314 | distance_3 = diamond_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
315 | }
316 | else
317 | {
318 | if((PS_CONSTANT_BUFFER_0.type_0) == 4.0f)
319 | {
320 | distance_3 = heart_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
321 | }
322 | else
323 | {
324 | if((PS_CONSTANT_BUFFER_0.type_0) == 5.0f)
325 | {
326 | distance_3 = spade_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
327 | }
328 | else
329 | {
330 | if((PS_CONSTANT_BUFFER_0.type_0) == 6.0f)
331 | {
332 | distance_3 = club_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
333 | }
334 | else
335 | {
336 | if((PS_CONSTANT_BUFFER_0.type_0) == 7.0f)
337 | {
338 | distance_3 = chevron_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
339 | }
340 | else
341 | {
342 | if((PS_CONSTANT_BUFFER_0.type_0) == 8.0f)
343 | {
344 | distance_3 = clover_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
345 | }
346 | else
347 | {
348 | if((PS_CONSTANT_BUFFER_0.type_0) == 9.0f)
349 | {
350 | distance_3 = ring_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
351 | }
352 | else
353 | {
354 | if((PS_CONSTANT_BUFFER_0.type_0) == 10.0f)
355 | {
356 | distance_3 = tag_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
357 | }
358 | else
359 | {
360 | if((PS_CONSTANT_BUFFER_0.type_0) == 11.0f)
361 | {
362 | distance_3 = cross_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
363 | }
364 | else
365 | {
366 | if((PS_CONSTANT_BUFFER_0.type_0) == 12.0f)
367 | {
368 | distance_3 = asterisk_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
369 | }
370 | else
371 | {
372 | if((PS_CONSTANT_BUFFER_0.type_0) == 13.0f)
373 | {
374 | distance_3 = infinity_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
375 | }
376 | else
377 | {
378 | if((PS_CONSTANT_BUFFER_0.type_0) == 14.0f)
379 | {
380 | distance_3 = pin_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
381 | }
382 | else
383 | {
384 | if((PS_CONSTANT_BUFFER_0.type_0) == 15.0f)
385 | {
386 | distance_3 = arrow_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
387 | }
388 | else
389 | {
390 | if((PS_CONSTANT_BUFFER_0.type_0) == 16.0f)
391 | {
392 | distance_3 = ellipse_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
393 | }
394 | else
395 | {
396 | if((PS_CONSTANT_BUFFER_0.type_0) == 17.0f)
397 | {
398 | distance_3 = ellipse_fast_0(P_18 * vec2(point_size_0), PS_CONSTANT_BUFFER_0.size_0);
399 | }
400 | }
401 | }
402 | }
403 | }
404 | }
405 | }
406 | }
407 | }
408 | }
409 | }
410 | }
411 | }
412 | }
413 | }
414 | }
415 | }
416 | }
417 | var col_out_0 : vec4;
418 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 0.0f)
419 | {
420 | col_out_0 = filled_0(distance_3, PS_CONSTANT_BUFFER_0.linewidth_0, antialias_3, PS_CONSTANT_BUFFER_0.fg_color_0);
421 | }
422 | else
423 | {
424 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 1.0f)
425 | {
426 | col_out_0 = stroke_0(distance_3, PS_CONSTANT_BUFFER_0.linewidth_0, antialias_3, PS_CONSTANT_BUFFER_0.fg_color_0);
427 | }
428 | else
429 | {
430 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 2.0f)
431 | {
432 | col_out_0 = outline_0(distance_3, PS_CONSTANT_BUFFER_0.linewidth_0, antialias_3, PS_CONSTANT_BUFFER_0.fg_color_0, PS_CONSTANT_BUFFER_0.bg_color_0);
433 | }
434 | else
435 | {
436 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 3.0f)
437 | {
438 | col_out_0 = vec4(vec3(pow(abs(distance_3), 0.45454543828964233f)), 1.0f);
439 | }
440 | else
441 | {
442 | if((PS_CONSTANT_BUFFER_0.draw_type_0) == 4.0f)
443 | {
444 | var _S56 : vec4 = PS_CONSTANT_BUFFER_0.fg_color_0;
445 | var _S57 : vec4 = PS_CONSTANT_BUFFER_0.bg_color_0;
446 | if(distance_3 > 0.0f)
447 | {
448 | col_out_0 = vec4(1.0f);
449 | }
450 | else
451 | {
452 | col_out_0 = vec4(0.0f);
453 | }
454 | col_out_0 = mix(_S56, _S57, col_out_0);
455 | }
456 | else
457 | {
458 | col_out_0 = _S54;
459 | }
460 | }
461 | }
462 | }
463 | }
464 | var _S58 : pixelOutput_0 = pixelOutput_0( col_out_0 );
465 | return _S58;
466 | }
467 |
468 |
--------------------------------------------------------------------------------
/workingdir/shaders/wgsl/markers_vs.wgsl:
--------------------------------------------------------------------------------
1 | struct _MatrixStorage_float4x4_ColMajorstd140_0
2 | {
3 | @align(16) data_0 : array, i32(4)>,
4 | };
5 |
6 | struct SLANG_ParameterGroup_vertexBuffer_std140_0
7 | {
8 | @align(16) ProjectionMatrix_0 : _MatrixStorage_float4x4_ColMajorstd140_0,
9 | };
10 |
11 | @binding(1) @group(0) var vertexBuffer_0 : SLANG_ParameterGroup_vertexBuffer_std140_0;
12 | fn unpackStorage_0( _S1 : _MatrixStorage_float4x4_ColMajorstd140_0) -> mat4x4
13 | {
14 | return mat4x4(_S1.data_0[i32(0)][i32(0)], _S1.data_0[i32(1)][i32(0)], _S1.data_0[i32(2)][i32(0)], _S1.data_0[i32(3)][i32(0)], _S1.data_0[i32(0)][i32(1)], _S1.data_0[i32(1)][i32(1)], _S1.data_0[i32(2)][i32(1)], _S1.data_0[i32(3)][i32(1)], _S1.data_0[i32(0)][i32(2)], _S1.data_0[i32(1)][i32(2)], _S1.data_0[i32(2)][i32(2)], _S1.data_0[i32(3)][i32(2)], _S1.data_0[i32(0)][i32(3)], _S1.data_0[i32(1)][i32(3)], _S1.data_0[i32(2)][i32(3)], _S1.data_0[i32(3)][i32(3)]);
15 | }
16 |
17 | struct PS_INPUT_0
18 | {
19 | @builtin(position) pos_0 : vec4,
20 | @location(0) col_0 : vec4,
21 | @location(1) uv_0 : vec2,
22 | };
23 |
24 | struct vertexInput_0
25 | {
26 | @location(0) pos_1 : vec2,
27 | @location(1) col_1 : vec4,
28 | @location(2) uv_1 : vec2,
29 | };
30 |
31 | @vertex
32 | fn main_vs( _S2 : vertexInput_0) -> PS_INPUT_0
33 | {
34 | var output_0 : PS_INPUT_0;
35 | output_0.pos_0 = (((vec4(_S2.pos_1.xy, 0.0f, 1.0f)) * (unpackStorage_0(vertexBuffer_0.ProjectionMatrix_0))));
36 | output_0.col_0 = _S2.col_1;
37 | output_0.uv_0 = _S2.uv_1;
38 | return output_0;
39 | }
40 |
41 |
--------------------------------------------------------------------------------