Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
f052c4a
allat
laluxx Sep 13, 2023
da6bcaa
minor-change
laluxx Sep 13, 2023
4636df3
update
laluxx Sep 13, 2023
80fe2fb
editor_delete_selection
laluxx Sep 13, 2023
2fa49ed
selection-fix
laluxx Sep 13, 2023
e3204a4
java-and-python
laluxx Sep 13, 2023
d255a51
hex-colors-preview
laluxx Sep 14, 2023
7517a02
togglable-line-numbers
laluxx Sep 14, 2023
a21cb5d
toggle-animations-1
laluxx Sep 15, 2023
758c740
TODOOOO
laluxx Sep 16, 2023
17d9a54
FIXMEEE
laluxx Sep 16, 2023
0804268
NOTE
laluxx Sep 16, 2023
f7b4e56
BUG
laluxx Sep 16, 2023
a255142
anim-fix
laluxx Sep 17, 2023
8e70f24
preatty-code
laluxx Sep 17, 2023
6cb6c28
lexer-arrays
laluxx Sep 17, 2023
0fdce54
idk
laluxx Sep 17, 2023
903a3b3
change-font
laluxx Sep 20, 2023
b6f019b
font-fix
laluxx Sep 20, 2023
cce174d
lexer-fix
laluxx Sep 20, 2023
32574c3
lexer-fix
laluxx Sep 20, 2023
f9adead
dynamic-shaders1
laluxx Sep 20, 2023
170df42
relative-line-numbers
laluxx Sep 21, 2023
89d0d2b
themes
laluxx Sep 21, 2023
b312f56
config-shaders
laluxx Oct 3, 2023
9cf898c
trasparent-cursor-when-mark
laluxx Oct 3, 2023
7fe5eff
visual-line-indicator
laluxx Oct 4, 2023
294b986
deepclean
laluxx Oct 23, 2023
f29a01c
update
laluxx Nov 14, 2023
098537a
update
laluxx Nov 17, 2023
838100a
update
laluxx Nov 17, 2023
04a7cb0
open-includes
laluxx Nov 17, 2023
9732d35
better-cursor
laluxx Nov 18, 2023
249845d
config-update
laluxx Nov 18, 2023
fb9fc5a
fix
laluxx Nov 18, 2023
6330ddf
fix
laluxx Nov 18, 2023
bd73162
vim-o
laluxx Nov 19, 2023
59b173d
wave
laluxx Nov 22, 2023
05d35be
waved
laluxx Nov 22, 2023
5c6411b
shaders
laluxx Dec 21, 2023
61e840f
dumb smart indentation
laluxx Dec 22, 2023
3d1e78e
editor backward-kill-word
laluxx Dec 22, 2023
9e355df
whitespaces
laluxx Dec 23, 2023
0bdc93f
Emacs mode and lines
laluxx Dec 26, 2023
f2f2b4c
Matching parenthesis
laluxx Jan 4, 2024
9adaf31
Yasnippet
laluxx Jan 6, 2024
f5f44f5
hl_line
laluxx Jan 6, 2024
36c028f
Function definition
laluxx Jan 7, 2024
0938eaa
Anchor and drag lines
laluxx Jan 9, 2024
e382bff
Buffers
laluxx Jan 9, 2024
9d168db
Bug hunting
laluxx Jan 9, 2024
390c63c
Themes and editor_open_include
laluxx Jan 10, 2024
3213829
Refactor
laluxx Jan 12, 2024
04a5415
cool stuff
laluxx Jan 12, 2024
239f3c8
Evil_find_char and render_indentation_lines
laluxx Jan 14, 2024
570b04f
Indent and render_indent_lines
laluxx Jan 15, 2024
6cd3527
stuff
laluxx Jan 16, 2024
a8ce744
M-x
laluxx Jan 17, 2024
6d5732c
Variable documentation
laluxx Jan 19, 2024
29b15ff
stuff
laluxx Jan 20, 2024
1b5a90c
bugs
laluxx Jan 22, 2024
b49f0f6
stuff
laluxx Feb 15, 2024
e753609
removed caches
laluxx Feb 15, 2024
f32223f
we are so back
laluxx Mar 17, 2024
ad74cec
smart_fill_column
laluxx Apr 9, 2024
5636f2f
Emacs Keybinds
laluxx May 4, 2024
f224198
doom-material-dark
laluxx May 5, 2024
f2b2dbe
im bad with names
laluxx May 6, 2024
1c66f21
FileBrowser++
laluxx May 11, 2024
1137734
line numbers background
laluxx Jun 15, 2024
757d135
casting to int, different types comparison error fixed
Jun 16, 2024
34889f8
type size_t instead of casting (int)
Jun 19, 2024
a755197
Merge pull request #1 from raulmontoro/master
laluxx Jun 21, 2024
f0bcbde
jade types
laluxx Jun 26, 2024
feed647
update
laluxx Jun 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
te
ded
SDL2
*.exe
*.obj
Expand Down
30 changes: 26 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
#!/bin/sh
#!/bin/bash

askforoverwrite=true # Set to false to disable overwrite prompt

if [ ! -d "$HOME/.config/ded" ]; then
cp -r ./config/ded "$HOME/.config/"
elif [ "$askforoverwrite" = true ]; then
echo "Config already exists. Overwrite? (y/n)"
read -r -n 1 overwrite_confirmation
echo # Move to a new line

if [ "$overwrite_confirmation" = "y" ]; then
rm -rf "$HOME/.config/ded"
cp -r ./config/ded "$HOME/.config/"
echo "Config overwritten."
else
echo "Not overwriting the config."
fi
else
echo "Config already exists. Overwrite not allowed."
fi

set -xe

CC="${CXX:-cc}"
PKGS="sdl2 glew freetype2"
CFLAGS="-Wall -Wextra -std=c11 -pedantic -ggdb"
CFLAGS="-Wall -Wextra -std=c11 -pedantic -ggdb -ljson-c -lpthread -D_DEFAULT_SOURCE"
LIBS=-lm
SRC="src/main.c src/la.c src/editor.c src/file_browser.c src/free_glyph.c src/simple_renderer.c src/common.c src/lexer.c"
SRC="src/*.c"

if [ `uname` = "Darwin" ]; then
CFLAGS+=" -framework OpenGL"
fi

$CC $CFLAGS `pkg-config --cflags $PKGS` -o ded $SRC $LIBS `pkg-config --libs $PKGS`
$CC $CFLAGS `pkg-config --cflags $PKGS` -o ded $SRC $LIBS `pkg-config --libs $PKGS `


Empty file added clangd.log
Empty file.
Binary file added config/ded/fonts/FantasqueSansMNerdFont-Bold.ttf
Binary file not shown.
Binary file added config/ded/fonts/FiraCodeNerdFontPropo-Bold.ttf
Binary file not shown.
Binary file added config/ded/fonts/MonoLisa-Bold.ttf
Binary file not shown.
File renamed without changes.
Binary file added config/ded/fonts/monocraft.ttf
Binary file not shown.
Binary file added config/ded/fonts/radon.otf
Binary file not shown.
67 changes: 67 additions & 0 deletions config/ded/shaders/cursor.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/* #version 330 core */

/* in vec4 out_color; */

/* void main() { */
/* gl_FragColor = out_color; */
/* } */


#version 330 core

in vec4 out_color; // Color input for the object.
in vec2 frag_coord; // The coordinate of the current fragment in screen space.

uniform vec2 light_position; // The position of the light source in screen space.

out vec4 frag_color; // Output color of the fragment.

void main() {
// Calculate the distance between the fragment and the light source.
float distance_to_light = length(frag_coord - light_position);

// Define a shadow radius and adjust the shadow intensity.
float shadow_radius = 100.0;
float shadow_intensity = 0.3; // Adjust this value to control the shadow intensity.

// Calculate the shadow factor based on distance.
float shadow_factor = smoothstep(shadow_radius, shadow_radius + 1.0, distance_to_light);

// Apply the shadow factor to darken the input color.
vec3 fragment_color = out_color.rgb * (1.0 - shadow_intensity * shadow_factor);

frag_color = vec4(fragment_color, out_color.a);
}




// GRADIENT
/* #version 330 core */

/* in vec2 fragTexCoord; // Texture coordinate, if you're using textures */
/* uniform float time; // Uniform variable for time */
/* uniform vec2 cursorPos; // Cursor position in screen coordinates */
/* uniform vec2 resolution; // Screen resolution */

/* out vec4 color; */

/* void main() { */
/* // Calculate normalized coordinates */
/* vec2 uv = fragTexCoord / resolution; */

/* // Create a dynamic gradient based on time */
/* vec3 gradient = 0.5 + 0.9 * cos(time + uv.xyx + vec3(0, 2, 4)); */

/* // Create a glow effect */
/* float dist = distance(uv, cursorPos / resolution); */
/* float glow = exp(20.0 * dist); */

/* // Combine the gradient and glow */
/* vec3 finalColor = gradient * glow; */

/* // Output the color */
/* color = vec4(finalColor, 0.7); // Fully opaque */
/* } */


24 changes: 24 additions & 0 deletions config/ded/shaders/fixed.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#version 330 core

uniform vec2 resolution;
uniform float time;

layout(location = 0) in vec2 position;
layout(location = 1) in vec4 color;
layout(location = 2) in vec2 uv;

out vec4 out_color;
out vec2 out_uv;

vec2 simple_project(vec2 point)
{
// Project the point directly based on the resolution
return (2.0 * point / resolution) - vec2(1.0);
}

void main() {
// Use the simple projection method without camera transformations
gl_Position = vec4(simple_project(position), 0.0, 1.0);
out_color = color;
out_uv = uv;
}
28 changes: 28 additions & 0 deletions config/ded/shaders/minibuffer.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#version 330 core

uniform vec2 resolution;
uniform float time;

layout(location = 0) in vec2 position;
layout(location = 1) in vec4 color;
layout(location = 2) in vec2 uv;

out vec4 out_color;
out vec2 out_uv;

const float scaleFactor = 0.25;

vec2 simple_project(vec2 point) {
// Project the point directly based on the resolution
return (2.0 * point / resolution) - vec2(1.0);
}

void main() {
// Apply the scale factor to the position
vec2 scaledPosition = position * scaleFactor;

// Use the simple projection method without camera transformations
gl_Position = vec4(simple_project(scaledPosition), 0.0, 1.0);
out_color = color;
out_uv = uv;
}
File renamed without changes.
36 changes: 36 additions & 0 deletions config/ded/shaders/simple_acid.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#version 330 core

uniform float time;
uniform vec2 resolution;
uniform sampler2D image;

in vec2 out_uv;

vec3 hsl2rgb(vec3 c) {
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0);
return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
}

void main() {
vec4 tc = texture(image, out_uv);
float d = tc.r;
float aaf = fwidth(d);
float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);

vec2 frag_uv = gl_FragCoord.xy / resolution;

// Firefly movement: This simulates the movement of 3 "fireflies"
float f1 = abs(sin(frag_uv.x * 10.0 + time));
float f2 = abs(cos(frag_uv.y * 8.0 + time * 1.5));
float f3 = abs(sin(frag_uv.x * 12.0 + frag_uv.y * 12.0 + time * 0.7));

// Combine fireflies' impact
float fireflyEffect = f1 + f2 + f3;

// Translate that to a color-shifting effect
vec3 fireflyColor = hsl2rgb(vec3(fireflyEffect * 0.3, 0.6, 0.5));

vec3 finalColor = mix(tc.rgb, fireflyColor, d * fireflyEffect);

gl_FragColor = vec4(finalColor, alpha);
}
File renamed without changes.
31 changes: 31 additions & 0 deletions config/ded/shaders/simple_epic.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#version 330 core

uniform float time;
uniform vec2 resolution;
uniform sampler2D image;

in vec2 out_uv;

vec3 hsl2rgb(vec3 c) {
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0);
return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
}

void main() {
vec4 tc = texture(image, out_uv);
float d = tc.r;
float aaf = fwidth(d);
float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);

vec2 frag_uv = gl_FragCoord.xy / resolution;

// Dynamic color-shifting aura
vec3 auraColor = hsl2rgb(vec3(mod(time * 0.2 + frag_uv.y, 1.0), 0.5, 0.5));

// Shimmering gradient across the text
float shimmer = (sin(time * 3.0 + frag_uv.x * 10.0) + 1.0) * 0.5;
vec3 shimmerColor = mix(vec3(1.0, 0.8, 0.6), vec3(0.6, 0.8, 1.0), shimmer);

vec3 finalColor = mix(auraColor, shimmerColor, d);
gl_FragColor = vec4(finalColor, alpha);
}
20 changes: 20 additions & 0 deletions config/ded/shaders/simple_glow.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#version 330 core

uniform sampler2D image; // The off-screen texture with the cursor
uniform float blurSize; // The size of the blur effect (experiment with this value)

in vec2 out_uv;

const float offset[5] = float[](0.0, 1.333, 2.666, 4.0, 5.333); // Offsets for Gaussian blur

void main() {
vec4 sum = texture(image, out_uv) * 0.2941; // Central sample (weight is highest)

sum += texture(image, out_uv + vec2(blurSize * offset[1], 0.0)) * 0.2353;
sum += texture(image, out_uv - vec2(blurSize * offset[1], 0.0)) * 0.2353;
sum += texture(image, out_uv + vec2(blurSize * offset[2], 0.0)) * 0.1176;
sum += texture(image, out_uv - vec2(blurSize * offset[2], 0.0)) * 0.1176;
// ... Add more samples if needed

gl_FragColor = sum;
}
File renamed without changes.
31 changes: 31 additions & 0 deletions config/ded/shaders/simple_pony.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#version 330 core

uniform float time;
uniform vec2 resolution;
uniform sampler2D image;

in vec2 out_uv;

vec3 hsl2rgb(vec3 c) {
vec3 rgb = clamp(abs(mod(c.x*6.0+vec3(0.0,4.0,2.0),6.0)-3.0)-1.0, 0.0, 1.0);
return c.z + c.y * (rgb-0.5)*(1.0-abs(2.0*c.z-1.0));
}

void main() {
vec4 tc = texture(image, out_uv);
float d = tc.r;
float aaf = fwidth(d);
float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);

vec2 frag_uv = gl_FragCoord.xy / resolution;

// Dynamic color-shifting aura
vec3 auraColor = hsl2rgb(vec3(mod(time * 0.2 + frag_uv.y, 1.0), 0.5, 0.5));

// Shimmering gradient across the text
float shimmer = (sin(time * 3.0 + frag_uv.x * 10.0) + 1.0) * 0.5;
vec3 shimmerColor = mix(vec3(1.0, 0.8, 0.6), vec3(0.6, 0.8, 1.0), shimmer);

vec3 finalColor = mix(auraColor, shimmerColor, d);
gl_FragColor = vec4(finalColor, alpha);
}
File renamed without changes.
92 changes: 92 additions & 0 deletions config/ded/shaders/simple_text.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#version 330 core

uniform sampler2D image;

in vec4 out_color;
in vec2 out_uv;

void main() {
float d = texture(image, out_uv).r;
float aaf = fwidth(d);
float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);
gl_FragColor = vec4(out_color.rgb, alpha);
}



// Dumb shadow
/* look good only with radon font */
/* #version 330 core */

/* uniform sampler2D image; */

/* in vec4 out_color; */
/* in vec2 out_uv; */

/* void main() { */
/* // Shadow properties */
/* vec2 shadowOffset = vec2(0.001, -0.001); // Very close offset for the shadow */
/* vec4 shadowColor = vec4(0.0, 0.0, 0.0, 0.7); // Black shadow with decent opacity */

/* // Calculate distance for shadow and text */
/* float d = texture(image, out_uv).r; */

/* float aaf = fwidth(d); */
/* float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d); */

/* // Basic blur approximation for shadow */
/* float blurRadius = 0.0005; // Adjust this value for more/less blur */
/* float shadowAlpha = 0.0; */
/* for (float x = -blurRadius; x <= blurRadius; x += 0.001) { */
/* for (float y = -blurRadius; y <= blurRadius; y += 0.001) { */
/* float dShadow = texture(image, out_uv + shadowOffset + vec2(x, y)).r; */
/* shadowAlpha += smoothstep(0.5 - aaf, 0.5 + aaf, dShadow); */
/* } */
/* } */
/* shadowAlpha = shadowAlpha / ((2.0 * blurRadius / 0.001 + 1.0) * (2.0 * blurRadius / 0.001 + 1.0)); */
/* shadowAlpha *= shadowColor.a; */

/* // Mix shadow and text */
/* vec4 textColor = vec4(out_color.rgb, alpha); */
/* vec4 shadow = vec4(shadowColor.rgb, shadowAlpha); */
/* gl_FragColor = mix(shadow, textColor, alpha); */
/* } */


// idk
/* #version 330 core */

/* uniform sampler2D image; */
/* uniform float time; // Time variable for animation */

/* in vec4 out_color; // Base text color */
/* in vec2 out_uv; // Texture coordinates */

/* void main() { */
/* float d = texture(image, out_uv).r; // Distance field value */
/* float aaf = fwidth(d); // Antialiasing factor */

/* // Outline settings */
/* float outlineSize = 0.09; // Width of the outline */
/* float movingSegmentLength = 0.8; // Length of the moving segment */
/* float speed = 0.5; // Speed of the segment's movement */

/* // Calculate position of the moving segment */
/* float segmentPosition = mod(time * speed, 1.0); */

/* // Calculate outline alpha based on SDF */
/* float outlineAlpha = smoothstep(0.5 - outlineSize - aaf, 0.5 - outlineSize, d) - */
/* smoothstep(0.5 + outlineSize, 0.5 + outlineSize + aaf, d); */

/* // Determine if we're within the moving segment */
/* float sdfCoord = (atan(out_uv.y - 0.5, out_uv.x - 0.5) / 3.14159265 + 1.0) * 0.5; */
/* bool inMovingSegment = abs(sdfCoord - segmentPosition) < movingSegmentLength * 0.5 || */
/* abs(sdfCoord - segmentPosition - 1.0) < movingSegmentLength * 0.5; */

/* // Mix colors: text, outline, and moving segment */
/* vec3 outlineColor = vec3(0, 1, 0); // Green for the moving segment */
/* vec4 textColor = vec4(out_color.rgb, smoothstep(0.5 - aaf, 0.5 + aaf, d)); */
/* vec4 segmentColor = mix(vec4(outlineColor, outlineAlpha), textColor, float(!inMovingSegment)); */

/* gl_FragColor = segmentColor; */
/* } */
Loading