Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# .editorconfig
root = true

# Apply only to C++ source and header files
[*.{cpp,hpp,h,cc,cxx}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = 120
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ AutoTest.Net/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
Expand Down Expand Up @@ -358,3 +357,9 @@ install.json

# mkdocs output
site/

# clangd compile commands
compile_commands.json

# gdb config
.gdbinit
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Contributing

See https://aui-framework.github.io/develop/md_docs_2Contributing_01to_01AUI.html
See https://aui-framework.github.io/develop/contributing/?h=contrib
7 changes: 7 additions & 0 deletions aui.core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.16)
option(AUI_CATCH_UNHANDLED "Catch segfault" ON)
option(AUI_COROUTINES "Use C++20 coroutines" OFF)
option(AUI_ENABLE_ASAN "Enable AddressSanitizer" OFF)
option(AUI_ENABLE_UBSAN "Enable UndefinedBehaviourSanitizer" OFF)
option(AUI_ENABLE_DEATH_TESTS "Enable GTest death tests" ON)

aui_module(aui.core EXPORT aui)
Expand Down Expand Up @@ -194,6 +195,12 @@ if (AUI_ENABLE_ASAN)
target_link_options(aui.core PUBLIC -fsanitize=address)
endif()

if (AUI_ENABLE_UBSAN)
message(STATUS "AUI_ENABLE_UBSAN=${AUI_ENABLE_UBSAN}")
target_compile_options(aui.core PUBLIC -fsanitize=undefined)
target_link_options(aui.core PUBLIC -fsanitize=undefined)
endif()

if(MSVC)
target_compile_options(aui.core PUBLIC /bigobj)
endif()
Expand Down
9 changes: 4 additions & 5 deletions aui.core/src/AUI/Common/AMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#pragma once
#include <map>
#include <unordered_map>
#include "AUI/Core.h"
#include "AException.h"
#include <AUI/Common/AVector.h>
#include <AUI/Traits/containers.h>
Expand Down Expand Up @@ -59,19 +58,19 @@ class ABaseMap: public Parent
private:
iterator mIterator;
bool mValid;

public:
contains_iterator(const iterator& p, bool valid):
mIterator(p),
mValid(valid)
{

}
contains_iterator(const contains_iterator& c):
mIterator(c.mIterator),
mValid(c.mValid)
{

}

operator bool() const noexcept {
Expand Down Expand Up @@ -259,4 +258,4 @@ inline auto aui::container::to_unordered_map(Iterator begin,
result[std::move(key)] = std::move(value);
}
return result;
}
}
5 changes: 1 addition & 4 deletions aui.core/src/AUI/Common/AString.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#pragma once

#include <algorithm>
#include <string>
#include <string_view>
#include <iostream>
Expand All @@ -20,9 +19,7 @@
#include <AUI/Common/ASet.h>
#include <AUI/Common/AUtf8.h>
#include <AUI/Common/AStringView.h>
#include <optional>
#include <span>
#include <concepts>
#include <fmt/core.h>
#if AUI_PLATFORM_ANDROID
#include <range/v3/all.hpp>
Expand Down Expand Up @@ -288,7 +285,7 @@ class API_AUI_CORE AString: public std::string {
AString(AChar c);

AString(size_type n, AChar c);

AString(size_type n, char32_t c) : AString(n, AChar(c)) {}

AString(size_type n, char16_t c) : AString(n, AChar(c)) {}
Expand Down
1 change: 1 addition & 0 deletions aui.uitests/src/AUI/Test/UI/UITestCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class MyListener: public ::testing::EmptyTestEventListener {
for (auto& v: matcher->toSet()) {
AWindow::current()->getRenderingContext()->renderer().rectangleBorder(ASolidBrush{0xaae00000_argb},
v->getPositionInWindow() - glm::ivec2{1, 1},
v->getZIndex(),
v->getSize() + glm::ivec2{2, 2});
}
}
Expand Down
34 changes: 17 additions & 17 deletions aui.views/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,22 @@ if (OPENGL_FOUND OR ANDROID OR IOS)
aui_compile_assets(aui.views EXCLUDE uni/font/Roboto.ttf)
endif ()

auisl_shader(aui.views basic.vsh)
auisl_shader(aui.views basic_uv.vsh)
auisl_shader(aui.views shadow.fsh)
auisl_shader(aui.views shadow_inner.fsh)
auisl_shader(aui.views rect_solid.fsh)
auisl_shader(aui.views rect_solid_rounded.fsh)
auisl_shader(aui.views rect_textured.fsh)
auisl_shader(aui.views rect_unblend.fsh)
auisl_shader(aui.views rect_gradient.fsh)
auisl_shader(aui.views rect_gradient_rounded.fsh)
auisl_shader(aui.views border_rounded.fsh)
auisl_shader(aui.views symbol.vsh)
auisl_shader(aui.views symbol.fsh)
auisl_shader(aui.views symbol_sub.fsh)
auisl_shader(aui.views square_sector.fsh)
auisl_shader(aui.views line_solid_dashed.fsh)
# auisl_shader(aui.views basic.vsh)
# auisl_shader(aui.views basic_uv.vsh)
# auisl_shader(aui.views shadow.fsh)
# auisl_shader(aui.views shadow_inner.fsh)
# auisl_shader(aui.views rect_solid.fsh)
# auisl_shader(aui.views rect_solid_rounded.fsh)
# auisl_shader(aui.views rect_textured.fsh)
# auisl_shader(aui.views rect_unblend.fsh)
# auisl_shader(aui.views rect_gradient.fsh)
# auisl_shader(aui.views rect_gradient_rounded.fsh)
# auisl_shader(aui.views border_rounded.fsh)
# auisl_shader(aui.views symbol.vsh)
# auisl_shader(aui.views symbol.fsh)
# auisl_shader(aui.views symbol_sub.fsh)
# auisl_shader(aui.views square_sector.fsh)
# auisl_shader(aui.views line_solid_dashed.fsh)

target_compile_definitions(aui.views PRIVATE
$<$<OR:$<PLATFORM_ID:MinGW>,$<PLATFORM_ID:Windows>>:UNICODE=1>
Expand Down Expand Up @@ -153,4 +153,4 @@ if (OPENGL_FOUND OR ANDROID OR IOS)
endif ()
else ()
message("OpenGL library was not found. Disabling aui.views")
endif ()
endif ()
10 changes: 0 additions & 10 deletions aui.views/shaders/basic.vsh

This file was deleted.

23 changes: 23 additions & 0 deletions aui.views/shaders/basic_gradient.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#version 300 es

precision highp float;

layout(location = 0) in vec4 pos;
layout(location = 1) in vec4 color_start;
layout(location = 2) in vec4 color_end;
layout(location = 3) in float rotation;

flat out vec4 vColorStart;
flat out vec4 vColorEnd;
out float vT;

void main() {
gl_Position = pos;

vec2 dir = vec2(cos(rotation), sin(rotation));

vT = dot(pos.xy, dir);

vColorStart = color_start;
vColorEnd = color_end;
}
12 changes: 12 additions & 0 deletions aui.views/shaders/basic_solid.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#version 300 es

precision highp float;

layout(location = 0) in vec4 pos;
layout(location = 1) in vec4 color;
flat out vec4 vertexColor;

void main() {
gl_Position = vec4(pos);
vertexColor = color;
}
8 changes: 2 additions & 6 deletions aui.views/shaders/basic_uv.vsh
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
uniform {
mat4 transform
}

input {
[0] vec4 pos
[1] vec2 uv
Expand All @@ -12,7 +8,7 @@ inter {
}

entry {
sl_position = uniform.transform * vec4(input.pos.xy, 0, 1)
sl_position = vec4(input.pos.xyz, 1)
inter.vertex = input.pos
inter.uv = input.uv
}
}
13 changes: 13 additions & 0 deletions aui.views/shaders/gradient.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#version 300 es
precision highp float;

flat in vec4 vColorStart;
flat in vec4 vColorEnd;
in float vT;

out vec4 fragColor;

void main() {
float t = clamp(vT * 0.5 + 0.5, 0.0, 1.0);
fragColor = mix(vColorStart, vColorEnd, t);
}
10 changes: 10 additions & 0 deletions aui.views/shaders/solid.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#version 300 es

precision highp float;

flat in vec4 vertexColor;
out vec4 fragColor;

void main() {
fragColor = vertexColor;
}
7 changes: 7 additions & 0 deletions aui.views/shaders_legacy/basic.vsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
input {
[0] vec3 pos
}

entry {
sl_position = vec4(input.pos.xyz, 1)
}
14 changes: 14 additions & 0 deletions aui.views/shaders_legacy/basic_uv.vsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
input {
[0] vec4 pos
[1] vec2 uv
}
inter {
vec4 vertex
vec2 uv
}

entry {
sl_position = vec4(input.pos.xyz, 1)
inter.vertex = input.pos
inter.uv = input.uv
}
22 changes: 22 additions & 0 deletions aui.views/shaders_legacy/border_rounded.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import rounded

uniform {
vec4 color
vec2 innerSize
vec2 outerToInner
vec2 outerSize
}

inter {
vec2 uv
}

output {
[0] vec4 albedo
}

entry {
vec2 absolute = abs(inter.uv * 2 - 1)
output.albedo = uniform.color * vec4(1, 1, 1, rounded(absolute, uniform.outerSize) - rounded(absolute * uniform.outerToInner, uniform.innerSize))
#flag glsl120 if (gl_FragColor.a < 0.1) discard;
}
8 changes: 8 additions & 0 deletions aui.views/shaders_legacy/dashed.sl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
uniform {
float divider
float threshold
}

float dashed(float distance) {
return step(mod(distance, uniform.divider), uniform.threshold);
}
File renamed without changes.
17 changes: 17 additions & 0 deletions aui.views/shaders_legacy/line_solid_dashed.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import dashed

uniform {
vec4 color
}

inter {
vec4 vertex
}

output {
[0] vec4 albedo
}

entry {
output.albedo = uniform.color * dashed(inter.vertex.z)
}
20 changes: 20 additions & 0 deletions aui.views/shaders_legacy/rect_gradient_rounded.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import gradient
import rounded

inter {
vec2 uv
}

uniform {
vec4 color
vec2 outerSize
}

output {
[0] vec4 albedo
}

entry {
output.albedo = uniform.color * gradient(inter.uv) * vec4(1, 1, 1, rounded(abs(inter.uv * 2 - 1), uniform.outerSize))
#flag glsl120 if (gl_FragColor.a < 0.1) discard;
}
19 changes: 19 additions & 0 deletions aui.views/shaders_legacy/rect_solid_rounded.fsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import rounded

uniform {
vec4 color
vec2 outerSize
}

inter {
vec2 uv
}

output {
[0] vec4 albedo
}

entry {
output.albedo = uniform.color * vec4(1, 1, 1, rounded(abs(inter.uv * 2 - 1), uniform.outerSize))
#flag glsl120 if (gl_FragColor.a < 0.1) discard;
}
Loading