Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. This feels great. 5000 lines of code cleaned the heck up

This feels great. 5000 lines of code cleaned the heck up

Scheduled Pinned Locked Moved The Lounge
graphicsdesignvisual-studiocomiot
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    honey the codewitch
    wrote on last edited by
    #1

    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(...) or draw::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
    {};
    }
    #endif

    Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

    G M 2 Replies Last reply
    0
    • H honey the codewitch

      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(...) or draw::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
      {};
      }
      #endif

      Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

      G Offline
      G Offline
      GKP1992
      wrote on last edited by
      #2

      The feeling after you finally got around to clean that dirty room you wanted to for so long (may not apply to everyone). Pure bliss!

      1 Reply Last reply
      0
      • H honey the codewitch

        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(...) or draw::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
        {};
        }
        #endif

        Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix

        M Offline
        M Offline
        Member 12995087
        wrote on last edited by
        #3

        Time for #pragma once ;-)

        H 1 Reply Last reply
        0
        • M Member 12995087

          Time for #pragma once ;-)

          H Offline
          H Offline
          honey the codewitch
          wrote on last edited by
          #4

          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

          pkfoxP 1 Reply Last reply
          0
          • H honey the codewitch

            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

            pkfoxP Offline
            pkfoxP Offline
            pkfox
            wrote on last edited by
            #5

            You have done well HTW

            In a closed society where everybody's guilty, the only crime is getting caught. In a world of thieves, the only final sin is stupidity. - Hunter S Thompson - RIP

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups