This feels great. 5000 lines of code cleaned the heck up
-
Every single one of these inherited classes exposes one or more static template methods to facilitate drawing such that you can do like
draw::line(...)
,draw::filled_rectangle(...)
ordraw::text(...)
It's not just one liner classes either. Most of these are at least a page. I had to start the inherited classes with "x" to move them down the autocomplete list in vs code so they don't get in the way. Yesterday this was all in a single 5000 line header. This morning I finished refactoring and integrating. Woo!#ifndef HTCW_GFX_DRAW_HPP
#define HTCW_GFX_DRAW_HPP
#include "gfx_draw_common.hpp"
#include "gfx_draw_point.hpp"
#include "gfx_draw_filled_rectangle.hpp"
#include "gfx_draw_line.hpp"
#include "gfx_draw_rectangle.hpp"
#include "gfx_draw_bitmap.hpp"
#include "gfx_draw_icon.hpp"
#include "gfx_draw_text.hpp"
#include "gfx_draw_ellipse.hpp"
#include "gfx_draw_arc.hpp"
#include "gfx_draw_rounded_rectangle.hpp"
#include "gfx_draw_filled_rounded_rectangle.hpp"
#include "gfx_draw_polygon.hpp"
#include "gfx_draw_filled_polygon.hpp"
#include "gfx_draw_sprite.hpp"
#include "gfx_draw_image.hpp"
namespace gfx {
struct draw : public helpers::xdraw_point,
public helpers::xdraw_filled_rectangle,
public helpers::xdraw_line,
public helpers::xdraw_rectangle,
public helpers::xdraw_bitmap,
public helpers::xdraw_icon,
public helpers::xdraw_text,
public helpers::xdraw_ellipse,
public helpers::xdraw_arc,
public helpers::xdraw_rounded_rectangle,
public helpers::xdraw_filled_rounded_rectangle,
public helpers::xdraw_polygon,
public helpers::xdraw_filled_polygon,
public helpers::xdraw_sprite,
public helpers::xdraw_image
{};
}
#endifCheck out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
Every single one of these inherited classes exposes one or more static template methods to facilitate drawing such that you can do like
draw::line(...)
,draw::filled_rectangle(...)
ordraw::text(...)
It's not just one liner classes either. Most of these are at least a page. I had to start the inherited classes with "x" to move them down the autocomplete list in vs code so they don't get in the way. Yesterday this was all in a single 5000 line header. This morning I finished refactoring and integrating. Woo!#ifndef HTCW_GFX_DRAW_HPP
#define HTCW_GFX_DRAW_HPP
#include "gfx_draw_common.hpp"
#include "gfx_draw_point.hpp"
#include "gfx_draw_filled_rectangle.hpp"
#include "gfx_draw_line.hpp"
#include "gfx_draw_rectangle.hpp"
#include "gfx_draw_bitmap.hpp"
#include "gfx_draw_icon.hpp"
#include "gfx_draw_text.hpp"
#include "gfx_draw_ellipse.hpp"
#include "gfx_draw_arc.hpp"
#include "gfx_draw_rounded_rectangle.hpp"
#include "gfx_draw_filled_rounded_rectangle.hpp"
#include "gfx_draw_polygon.hpp"
#include "gfx_draw_filled_polygon.hpp"
#include "gfx_draw_sprite.hpp"
#include "gfx_draw_image.hpp"
namespace gfx {
struct draw : public helpers::xdraw_point,
public helpers::xdraw_filled_rectangle,
public helpers::xdraw_line,
public helpers::xdraw_rectangle,
public helpers::xdraw_bitmap,
public helpers::xdraw_icon,
public helpers::xdraw_text,
public helpers::xdraw_ellipse,
public helpers::xdraw_arc,
public helpers::xdraw_rounded_rectangle,
public helpers::xdraw_filled_rounded_rectangle,
public helpers::xdraw_polygon,
public helpers::xdraw_filled_polygon,
public helpers::xdraw_sprite,
public helpers::xdraw_image
{};
}
#endifCheck out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
Every single one of these inherited classes exposes one or more static template methods to facilitate drawing such that you can do like
draw::line(...)
,draw::filled_rectangle(...)
ordraw::text(...)
It's not just one liner classes either. Most of these are at least a page. I had to start the inherited classes with "x" to move them down the autocomplete list in vs code so they don't get in the way. Yesterday this was all in a single 5000 line header. This morning I finished refactoring and integrating. Woo!#ifndef HTCW_GFX_DRAW_HPP
#define HTCW_GFX_DRAW_HPP
#include "gfx_draw_common.hpp"
#include "gfx_draw_point.hpp"
#include "gfx_draw_filled_rectangle.hpp"
#include "gfx_draw_line.hpp"
#include "gfx_draw_rectangle.hpp"
#include "gfx_draw_bitmap.hpp"
#include "gfx_draw_icon.hpp"
#include "gfx_draw_text.hpp"
#include "gfx_draw_ellipse.hpp"
#include "gfx_draw_arc.hpp"
#include "gfx_draw_rounded_rectangle.hpp"
#include "gfx_draw_filled_rounded_rectangle.hpp"
#include "gfx_draw_polygon.hpp"
#include "gfx_draw_filled_polygon.hpp"
#include "gfx_draw_sprite.hpp"
#include "gfx_draw_image.hpp"
namespace gfx {
struct draw : public helpers::xdraw_point,
public helpers::xdraw_filled_rectangle,
public helpers::xdraw_line,
public helpers::xdraw_rectangle,
public helpers::xdraw_bitmap,
public helpers::xdraw_icon,
public helpers::xdraw_text,
public helpers::xdraw_ellipse,
public helpers::xdraw_arc,
public helpers::xdraw_rounded_rectangle,
public helpers::xdraw_filled_rounded_rectangle,
public helpers::xdraw_polygon,
public helpers::xdraw_filled_polygon,
public helpers::xdraw_sprite,
public helpers::xdraw_image
{};
}
#endifCheck out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Time for #pragma once ;-)
-
Time for #pragma once ;-)
I don't use pragma once for these files because this way i get breadcrumbs that let me know which files have been included already. I have yet to need that, but I wanted it in case I ended up needing it.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I don't use pragma once for these files because this way i get breadcrumbs that let me know which files have been included already. I have yet to need that, but I wanted it in case I ended up needing it.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix