Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
luxe committed Jul 21, 2024
1 parent 1709859 commit 5d73043
Show file tree
Hide file tree
Showing 18 changed files with 159 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ hcp_hdrs_derive(
"//code/utilities/data_structures/graphics/image:positioned_image_data",
"//code/utilities/data_structures/graphics/image:positioned_texture",
"//code/utilities/data_structures/shapes/rectangle:positioned_rectangle_settings",
"//code/utilities/data_structures/shapes/circle:positioned_circle_settings",
"//code/utilities/deps/stl/variant:lib",
],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public:

std::vector<std::variant<
Positioned_Rectangle_Settings,
Positioned_Circle_Settings,
Positioned_Full_Color_Bitmap,
Positioned_Multi_Color_Bitmap,
Positioned_Image_Data,
Expand Down
32 changes: 32 additions & 0 deletions source/code/utilities/data_structures/shapes/circle/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package(default_visibility = ["//visibility:public"])

load("//bazel/rules/hcp:hcp.bzl", "hcp")
load("//bazel/rules/hcp:hcp_hdrs_derive.bzl", "hcp_hdrs_derive")
load("//bazel/rules/cpp:object.bzl", "cpp_object")

hcp_hdrs_derive(
name = "circle_draw_hooks",
interface_deps = [],
)

hcp_hdrs_derive(
name = "circle_fill_colors",
interface_deps = ["//code/utilities/data_structures/color:transparent_rgb_color"],
)

hcp_hdrs_derive(
name = "circle_settings",
interface_deps = [
"//code/utilities/data_structures/color:transparent_rgb_color",
"//code/utilities/data_structures/shapes/circle:circle_draw_hooks",
"//code/utilities/data_structures/shapes/circle:circle_fill_colors",
],
)

hcp_hdrs_derive(
name = "positioned_circle_settings",
interface_deps = [
"//code/utilities/data_structures/position",
"//code/utilities/data_structures/shapes/circle:circle_settings",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class
⚞⚟

public:

//hooks on whether to show something
bool ፠draw_border፠ = true;
bool ፠draw_fill፠ = true;
bool ፠draw_shade፠ = false;

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class
⚞⚟

public:

Transparent_Rgb_Color ፠border፠;
Transparent_Rgb_Color ፠fill፠;

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class
⚞⚟

public:

float ፠radius፠ = 10;
int ፠number_of_segments፠;
int ፠thickness፠ = 1;


Circle_Draw_Hooks ፠hooks፠;
Circle_Fill_Colors ፠colors፠;

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
class
⚞⚟

public:
Position ፠pos፠;
Circle_Settings ፠shape፠;
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class
set_equal_if_less(pos.x,x.pos.x + x.shape.dimensions.width);
set_equal_if_less(pos.y,x.pos.y + x.shape.dimensions.height);
},
[&](Positioned_Circle_Settings const& x) {
//TODO
},
[&](Positioned_Multi_Color_Bitmap const& x) {
for (auto const& it: x.bitmap.pixels){
set_equal_if_less(pos.x,x.pos.x + it.pos.x);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class
Draw(cr,x);
}
},
[&](Positioned_Circle_Settings const& x) {
//TODO
},
[&](Positioned_Multi_Color_Bitmap const& x) {
Draw(cr,x);
},
Expand Down
6 changes: 4 additions & 2 deletions source/code/utilities/graphics/imgui/render/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ load("//bazel/rules/hcp:hcp_hdrs_derive.bzl", "hcp_hdrs_derive")
load("//bazel/rules/cpp:object.bzl", "cpp_object")
load("//bazel/rules/enum_cpp:enum_cpp.bzl", "enum_cpp")

hcp(
hcp_hdrs_derive(
name = "frame_renderer",
deps = [
interface_deps = [
"//code/programs/ide/settings/data:ide_settings",
"//code/utilities/data_structures/graphics/bitmap/full_color_bitmap:positioned_full_color_bitmap",
"//code/utilities/data_structures/graphics/bitmap/multi_color_bitmap:positioned_multi_color_bitmap",
Expand All @@ -21,6 +21,8 @@ hcp(
"//code/utilities/graphics/imgui:ui_renders",
"//code/utilities/graphics/imgui/loop:mechanics",
"//code/utilities/graphics/imgui/render/elements:line_drawer",
"//code/utilities/graphics/imgui/render/elements:circle_drawer",
"//code/utilities/graphics/imgui/render/elements:rectangle_drawer",
"//code/utilities/graphics/imgui/render/elements:multi_color_bitmap_drawer",
"//code/utilities/graphics/imgui/window:window_position_finder",
"//code/utilities/graphics/imgui/window:window_renderer",
Expand Down
36 changes: 26 additions & 10 deletions source/code/utilities/graphics/imgui/render/elements/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ load("//bazel/rules/hcp:hcp.bzl", "hcp")
load("//bazel/rules/hcp:hcp_hdrs_derive.bzl", "hcp_hdrs_derive")
load("//bazel/rules/cpp:object.bzl", "cpp_object")

hcp(
hcp_hdrs_derive(
name = "full_color_bitmap_drawer",
deps = [
interface_deps = [
"//code/utilities/data_structures/graphics/bitmap/full_color_bitmap",
"//code/utilities/data_structures/graphics/bitmap/full_color_bitmap:positioned_full_color_bitmap",
"//code/utilities/data_structures/graphics/bitmap/pixel:pixel_settings",
Expand All @@ -19,9 +19,9 @@ hcp(
],
)

hcp(
hcp_hdrs_derive(
name = "multi_color_bitmap_drawer",
deps = [
interface_deps = [
"//code/utilities/data_structures/graphics/bitmap/multi_color_bitmap",
"//code/utilities/data_structures/graphics/bitmap/multi_color_bitmap:positioned_multi_color_bitmap",
"//code/utilities/data_structures/graphics/bitmap/pixel:pixel_settings",
Expand All @@ -34,9 +34,9 @@ hcp(
],
)

hcp(
hcp_hdrs_derive(
name = "pixel_drawer",
deps = [
interface_deps = [
"//code/utilities/data_structures/graphics/bitmap/pixel:pixel_settings",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events_checker",
Expand All @@ -46,9 +46,9 @@ hcp(
],
)

hcp(
hcp_hdrs_derive(
name = "line_drawer",
deps = [
interface_deps = [
"//code/utilities/data_structures/graphics/line:line_settings",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events_checker",
Expand All @@ -58,9 +58,9 @@ hcp(
],
)

hcp(
hcp_hdrs_derive(
name = "rectangle_drawer",
deps = [
interface_deps = [
"//code/utilities/colors/transformers:color_transitioner",
"//code/utilities/data_structures/graphics/bitmap/multi_color_bitmap",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events",
Expand All @@ -75,3 +75,19 @@ hcp(
"//code/utilities/graphics/imgui/render/elements:multi_color_bitmap_drawer",
],
)

hcp_hdrs_derive(
name = "circle_drawer",
interface_deps = [
"//code/utilities/colors/transformers:color_transitioner",
"//code/utilities/data_structures/graphics/bitmap/multi_color_bitmap",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events",
"//code/utilities/data_structures/graphics/objects/mouse/events:mouse_events_checker",
"//code/utilities/data_structures/position",
"//code/utilities/data_structures/shapes/circle:positioned_circle_settings",
"//code/utilities/data_structures/shapes/circle:circle_settings",
"//code/utilities/graphics/imgui:imgui_type_utility",
"//code/utilities/graphics/imgui/loop:mechanics",
"//code/utilities/graphics/imgui/render/elements:multi_color_bitmap_drawer",
],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
class
⚞⚟


//regular draw
public: static▶ void ☀Draw(ImDrawList *draw_list, Positioned_Circle_Settings const &settings)
return Draw(draw_list,settings.pos,settings.shape);
public: static▶ void ☀Draw(ImDrawList *draw_list, Position pos, Circle_Settings const &settings)
Possibly_Draw_Filling(draw_list,pos,settings);
Possibly_Draw_Border(draw_list,pos,settings);


private: static▶ void ☀Possibly_Draw_Filling(ImDrawList *draw_list, Position pos, Circle_Settings const &settings)
if (settings.hooks.draw_fill){
draw_list->AddCircleFilled(ImVec2(pos.x, pos.y),
settings.radius,
Imgui_Type_Utility::to_imgui_color(settings.colors.fill),
settings.number_of_segments);
}

if (settings.hooks.draw_shade){
//TODO
}

private: static▶ void ☀Possibly_Draw_Border(ImDrawList *draw_list, Position pos, Circle_Settings const &settings)
if (settings.hooks.draw_border){
draw_list->AddCircle(ImVec2(pos.x, pos.y),
settings.radius,
Imgui_Type_Utility::to_imgui_color(settings.colors.border),
settings.number_of_segments,
settings.thickness);
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
class
❪string❫
"code/utilities/data_structures/graphics/bitmap/full_color_bitmap/full_color_bitmap"
"code/utilities/data_structures/graphics/bitmap/full_color_bitmap/positioned_full_color_bitmap"
"code/utilities/data_structures/graphics/bitmap/pixel/pixel_settings"
"code/utilities/graphics/imgui/render/elements/pixel_drawer"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events_checker"
"code/utilities/graphics/imgui/imgui_type_utility"
"code/utilities/data_structures/position/position"
"code/utilities/graphics/imgui/loop/mechanics"
⚞⚟

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
class
❪string❫
"code/utilities/data_structures/graphics/line/line_settings"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events_checker"
"code/utilities/graphics/imgui/imgui_type_utility"
"code/utilities/data_structures/position/position"
"code/utilities/graphics/imgui/loop/mechanics"
⚞⚟

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
class
❪string❫
"code/utilities/data_structures/graphics/bitmap/multi_color_bitmap/multi_color_bitmap"
"code/utilities/data_structures/graphics/bitmap/multi_color_bitmap/positioned_multi_color_bitmap"
"code/utilities/data_structures/graphics/bitmap/pixel/pixel_settings"
"code/utilities/graphics/imgui/render/elements/pixel_drawer"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events_checker"
"code/utilities/graphics/imgui/imgui_type_utility"
"code/utilities/data_structures/position/position"
"code/utilities/graphics/imgui/loop/mechanics"
⚞⚟

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
class
❪string❫
"code/utilities/data_structures/graphics/bitmap/pixel/pixel_settings"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events_checker"
"code/utilities/graphics/imgui/imgui_type_utility"
"code/utilities/data_structures/position/position"
"code/utilities/graphics/imgui/loop/mechanics"
⚞⚟

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
class
❪string❫
"code/utilities/data_structures/shapes/rectangle/rectangle_settings"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events"
"code/utilities/data_structures/graphics/objects/mouse/events/mouse_events_checker"
"code/utilities/graphics/imgui/imgui_type_utility"
"code/utilities/data_structures/position/position"
"code/utilities/graphics/imgui/loop/mechanics"
"code/utilities/data_structures/shapes/rectangle/positioned_rectangle_settings"
"code/utilities/data_structures/shapes/rectangle/shade_rectangle_settings"
"code/utilities/data_structures/graphics/bitmap/multi_color_bitmap/multi_color_bitmap"
"code/utilities/colors/transformers/color_transitioner"
"code/utilities/graphics/imgui/render/elements/multi_color_bitmap_drawer"
"code/utilities/data_structures/graphics/rectangle/rectangle_fill_bitmap"
⚞⚟

Expand Down
25 changes: 3 additions & 22 deletions source/code/utilities/graphics/imgui/render/frame_renderer.hcp
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
class
"code/programs/ide/settings/data/ide_settings"
"code/utilities/graphics/imgui/loop/mechanics"
"code/utilities/data_structures/graphics/objects/frame_elements"
"SDL.h"
"code/utilities/graphics/imgui/ui_renders"
"code/utilities/graphics/imgui/window/window_renderer"
"code/utilities/graphics/imgui/window/window_position_finder"
"code/utilities/data_structures/graphics/objects/label/label_drawer"
"code/utilities/graphics/imgui/render/elements/rectangle_drawer"
"code/utilities/graphics/imgui/imgui_type_utility"
"code/utilities/peripheral/keyboard/key_detector"
"code/utilities/data_structures/graphics/objects/mouse/draw/mouse_selection_drawer"
"code/utilities/data_structures/graphics/objects/cursor/label_cursor_action_doer"
"code/utilities/graphics/imgui/render/elements/line_drawer"
"code/utilities/peripheral/mouse/state/mouse_position_getter"
"code/utilities/graphics/imgui/render/elements/multi_color_bitmap_drawer"
"code/utilities/data_structures/graphics/bitmap/multi_color_bitmap/positioned_multi_color_bitmap"
"code/utilities/data_structures/graphics/bitmap/full_color_bitmap/positioned_full_color_bitmap"
"code/utilities/types/variant/lib"
"code/utilities/peripheral/pc/pc_input_state_getter"
"code/utilities/image/stb_image_setter"
"code/utilities/data_structures/graphics/image/positioned_texture"
⚞⚟

public: static▶ void ☀Render(Background_Settings & settings, Frame_Elements const& elements)❰
Expand All @@ -46,6 +24,9 @@ class
[&](Positioned_Rectangle_Settings const& x) {
Rectangle_Drawer::draw_rectangle(draw_list,x);
},
[&](Positioned_Circle_Settings const& x) {
Circle_Drawer::Draw(draw_list,x);
},
[&](Positioned_Multi_Color_Bitmap const& x) {
Multi_Color_Bitmap_Drawer::Draw(draw_list,x);
},
Expand Down

0 comments on commit 5d73043

Please sign in to comment.