update dependencies, minor change to scrolling speed
This commit is contained in:
parent
4cdeb65122
commit
82cb3cb357
Binary file not shown.
Binary file not shown.
2
dub.json
2
dub.json
@ -13,7 +13,7 @@
|
|||||||
"sourcePaths": ["src/editor", "src/dlib", "src/dlib/external/xxhash", "src/VulkanRenderer"],
|
"sourcePaths": ["src/editor", "src/dlib", "src/dlib/external/xxhash", "src/VulkanRenderer"],
|
||||||
"libs-linux": ["xcb", "X11", "X11-xcb", "vulkan", "stdc++", "xcb-xfixes", "freetype"],
|
"libs-linux": ["xcb", "X11", "X11-xcb", "vulkan", "stdc++", "xcb-xfixes", "freetype"],
|
||||||
"libs-windows": [],
|
"libs-windows": [],
|
||||||
"versions": [],
|
"versions": ["VULKAN_DEBUG"],
|
||||||
"preGenerateCommands-linux": ["./build.sh"],
|
"preGenerateCommands-linux": ["./build.sh"],
|
||||||
"preGenerateCommands-windows": [],
|
"preGenerateCommands-windows": [],
|
||||||
"dflags": ["-Xcc=-mno-sse", "-P-I/usr/include/freetype2", "-Jbuild", "-Jassets", "-link-debuglib"],
|
"dflags": ["-Xcc=-mno-sse", "-P-I/usr/include/freetype2", "-Jbuild", "-Jassets", "-link-debuglib"],
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
Subproject commit 614ee40d853d65818fd04e41372e0ae492c8d988
|
Subproject commit c42238a456f5048c7d1b2d5ebd71ecf13bb10ece
|
||||||
2
src/dlib
2
src/dlib
@ -1 +1 @@
|
|||||||
Subproject commit c83ffabce69071a3e7a0af3f26aa420082eeda1f
|
Subproject commit 10b5c0a127ef5fd5a18b956d2d112cae75017150
|
||||||
@ -136,7 +136,8 @@ struct UICtx
|
|||||||
|
|
||||||
PlatformWindow* window;
|
PlatformWindow* window;
|
||||||
Renderer rd;
|
Renderer rd;
|
||||||
ImageView font_atlas;
|
Descriptor font_atlas;
|
||||||
|
Descriptor sampler;
|
||||||
Pipeline pipeline;
|
Pipeline pipeline;
|
||||||
DescSetLayout desc_set_layout;
|
DescSetLayout desc_set_layout;
|
||||||
DescSet desc_set;
|
DescSet desc_set;
|
||||||
@ -428,7 +429,7 @@ EaseOutQuint(f32 x)
|
|||||||
void
|
void
|
||||||
SetScrollOffset(UIPanel* panel)
|
SetScrollOffset(UIPanel* panel)
|
||||||
{
|
{
|
||||||
f32 scroll_speed = 0.8 * (g_delta * 60.0);
|
f32 scroll_speed = 5.0;
|
||||||
|
|
||||||
U64Vec2 pos = VecPos(&panel.ed.buf);
|
U64Vec2 pos = VecPos(&panel.ed.buf);
|
||||||
|
|
||||||
@ -451,7 +452,7 @@ SetScrollOffset(UIPanel* panel)
|
|||||||
|
|
||||||
if(panel.scroll_offset != panel.scroll_target)
|
if(panel.scroll_offset != panel.scroll_target)
|
||||||
{
|
{
|
||||||
panel.scroll_offset += (scroll_speed * (panel.scroll_target - panel.scroll_offset)) * (g_delta * 60.0);
|
panel.scroll_offset += (scroll_speed * (panel.scroll_target - panel.scroll_offset)) * (g_delta * 2.0);
|
||||||
|
|
||||||
if(fabsf(panel.scroll_offset-panel.scroll_target) < 0.0009)
|
if(fabsf(panel.scroll_offset-panel.scroll_target) < 0.0009)
|
||||||
{
|
{
|
||||||
@ -529,10 +530,6 @@ Panel(UIPanel* panel)
|
|||||||
DrawPanel(panel, lc_w, focused);
|
DrawPanel(panel, lc_w, focused);
|
||||||
|
|
||||||
f32 y_rem = fmod(panel.scroll_offset, TEXT_SIZE);
|
f32 y_rem = fmod(panel.scroll_offset, TEXT_SIZE);
|
||||||
if(y_rem != 0.0)
|
|
||||||
{
|
|
||||||
Logf("rem %f ln %s", y_rem, panel.start_ln);
|
|
||||||
}
|
|
||||||
|
|
||||||
f32 x = panel.rect.x0;
|
f32 x = panel.rect.x0;
|
||||||
f32 y = panel.rect.y0 + TEXT_SIZE - fmod(panel.scroll_offset, TEXT_SIZE);
|
f32 y = panel.rect.y0 + TEXT_SIZE - fmod(panel.scroll_offset, TEXT_SIZE);
|
||||||
@ -754,16 +751,16 @@ InitUICtx(PlatformWindow* window)
|
|||||||
Vec4 b = Vec4(Vec3(0.0), 1.0);
|
Vec4 b = Vec4(Vec3(0.0), 1.0);
|
||||||
|
|
||||||
UICtx ctx = {
|
UICtx ctx = {
|
||||||
rd: InitRenderer(handles, MB(16), MB(8)),
|
rd: InitRenderer(handles, MB(16), MB(8)),
|
||||||
items: CreateHashTable!(UIHash, UIItem*)(12),
|
items: CreateHashTable!(UIHash, UIItem*)(12),
|
||||||
arena: arena,
|
arena: arena,
|
||||||
temp_arena: CreateArena(MB(1)),
|
temp_arena: CreateArena(MB(1)),
|
||||||
drag_item: g_UI_NIL,
|
drag_item: g_UI_NIL,
|
||||||
atlas_buf: atlas_buf,
|
atlas_buf: atlas_buf,
|
||||||
font: font,
|
font: font,
|
||||||
font_data: cast(u8[])FONT_BYTES,
|
font_data: cast(u8[])FONT_BYTES,
|
||||||
text_size: 16.0,
|
text_size: 16.0,
|
||||||
tab_width: 2,
|
tab_width: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
for(u64 i = 0; i < FRAME_OVERLAP; i += 1)
|
for(u64 i = 0; i < FRAME_OVERLAP; i += 1)
|
||||||
@ -775,8 +772,8 @@ InitUICtx(PlatformWindow* window)
|
|||||||
}
|
}
|
||||||
|
|
||||||
DescLayoutBinding[2] layout_bindings = [
|
DescLayoutBinding[2] layout_bindings = [
|
||||||
{ binding: 0, descriptorType: DT.Image, descriptorCount: 1, stageFlags: SS.All },
|
{ binding: 0, descriptorType: DT.Image, descriptorCount: 1, stageFlags: SS.All },
|
||||||
{ binding: 1, descriptorType: DT.Storage, descriptorCount: 1, stageFlags: SS.All },
|
{ binding: 1, descriptorType: DT.Sampler, descriptorCount: 1, stageFlags: SS.All },
|
||||||
];
|
];
|
||||||
|
|
||||||
ctx.desc_set_layout = CreateDescSetLayout(&ctx.rd, layout_bindings);
|
ctx.desc_set_layout = CreateDescSetLayout(&ctx.rd, layout_bindings);
|
||||||
@ -819,7 +816,10 @@ InitUICtx(PlatformWindow* window)
|
|||||||
|
|
||||||
CreateImageView(&ctx.rd, &ctx.font_atlas, ctx.atlas_buf.atlas.width, ctx.atlas_buf.atlas.height, 4, ctx.atlas_buf.data);
|
CreateImageView(&ctx.rd, &ctx.font_atlas, ctx.atlas_buf.atlas.width, ctx.atlas_buf.atlas.height, 4, ctx.atlas_buf.data);
|
||||||
|
|
||||||
Write(&ctx.rd, ctx.desc_set, &ctx.font_atlas, 0, DT.Image);
|
ctx.sampler = CreateSampler(&ctx.rd, MipmapMode.Nearest);
|
||||||
|
ctx.sampler.binding = 1;
|
||||||
|
|
||||||
|
Write(&ctx.rd, ctx.desc_set, [ctx.font_atlas, ctx.sampler]);
|
||||||
|
|
||||||
SetClearColors(&ctx.rd, [0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 0.0]);
|
SetClearColors(&ctx.rd, [0.0, 0.0, 0.0, 1.0], [0.0, 0.0, 0.0, 0.0]);
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
layout (rgba16f, set = 0, binding = 0) uniform image2D DrawImage;
|
layout (rgba16f, set = 0, binding = 0) uniform image2D DrawImage;
|
||||||
|
|
||||||
layout (set = 0, binding = 1) uniform sampler SamplerNearest;
|
|
||||||
|
|
||||||
layout (set = 1, binding = 0) uniform texture2D SpriteAtlas;
|
layout (set = 1, binding = 0) uniform texture2D SpriteAtlas;
|
||||||
|
|
||||||
|
layout (set = 1, binding = 1) uniform sampler SamplerNearest;
|
||||||
|
|
||||||
layout (push_constant) uniform Constants {
|
layout (push_constant) uniform Constants {
|
||||||
mat4 projection;
|
mat4 projection;
|
||||||
} PC;
|
} PC;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user