diff --git a/docs/build/doctrees/environment.pickle b/docs/build/doctrees/environment.pickle index 69698f1..37af1a3 100644 Binary files a/docs/build/doctrees/environment.pickle and b/docs/build/doctrees/environment.pickle differ diff --git a/docs/build/doctrees/reference/draw.doctree b/docs/build/doctrees/reference/draw.doctree index cc9de8f..2d0d8b2 100644 Binary files a/docs/build/doctrees/reference/draw.doctree and b/docs/build/doctrees/reference/draw.doctree differ diff --git a/docs/build/doctrees/reference/entity.doctree b/docs/build/doctrees/reference/entity.doctree index ea713bf..bcfb681 100644 Binary files a/docs/build/doctrees/reference/entity.doctree and b/docs/build/doctrees/reference/entity.doctree differ diff --git a/docs/build/doctrees/reference/font.doctree b/docs/build/doctrees/reference/font.doctree index 88da427..00daa6e 100644 Binary files a/docs/build/doctrees/reference/font.doctree and b/docs/build/doctrees/reference/font.doctree differ diff --git a/docs/build/doctrees/reference/texture_cache.doctree b/docs/build/doctrees/reference/texture_cache.doctree index 57cf097..5a69c81 100644 Binary files a/docs/build/doctrees/reference/texture_cache.doctree and b/docs/build/doctrees/reference/texture_cache.doctree differ diff --git a/docs/build/doctrees/reference/tile_map.doctree b/docs/build/doctrees/reference/tile_map.doctree index 26125c9..ca7245d 100644 Binary files a/docs/build/doctrees/reference/tile_map.doctree and b/docs/build/doctrees/reference/tile_map.doctree differ diff --git a/docs/build/html/genindex.html b/docs/build/html/genindex.html index fefc4cd..4eb7ad3 100644 --- a/docs/build/html/genindex.html +++ b/docs/build/html/genindex.html @@ -211,11 +211,11 @@

Index

K

    -
  • kn::draw::rect (C++ function) +
  • kn::draw::rect (C++ function)
  • kn::Entity (C++ class)
  • -
  • kn::Entity::Entity (C++ function) +
  • kn::Entity::Entity (C++ function)
  • kn::Entity::getTexture (C++ function)
  • @@ -223,7 +223,7 @@

    K

  • kn::Font (C++ class)
  • -
  • kn::Font::Font (C++ function) +
  • kn::Font::Font (C++ function)
  • kn::Font::render (C++ function)
  • @@ -325,7 +325,7 @@

    K

  • kn::TextureCache::move (C++ function)
  • -
  • kn::TextureCache::TextureCache (C++ function) +
  • kn::TextureCache::TextureCache (C++ function)
  • kn::TextureCache::unload (C++ function)
  • @@ -341,7 +341,7 @@

    K

  • kn::TileMap::getObjects (C++ function)
  • -
  • kn::TileMap::TileMap (C++ function) +
  • kn::TileMap::TileMap (C++ function)
  • kn::time::Clock (C++ class)
  • diff --git a/docs/build/html/objects.inv b/docs/build/html/objects.inv index c26a940..f4421fd 100644 Binary files a/docs/build/html/objects.inv and b/docs/build/html/objects.inv differ diff --git a/docs/build/html/reference/draw.html b/docs/build/html/reference/draw.html index fc5e6e8..0a02326 100644 --- a/docs/build/html/reference/draw.html +++ b/docs/build/html/reference/draw.html @@ -208,8 +208,8 @@

    draw#

    -
    -void kn::draw::rect(RenderWindow &window, Rect &rect, const SDL_Color color, int thickness = 0)#
    +
    +void kn::draw::rect(Rect &rect, const SDL_Color color, int thickness = 0)#

    Draw a rectangle.

    Note

    @@ -218,7 +218,6 @@

    draw#
    Parameters:
      -
    • window – Reference to the RenderWindow instance.

    • rect – The rectangle to draw.

    • color – The color of the rectangle.

    • thickness – The thickness of the rectangle.

    • @@ -285,7 +284,7 @@

      draw# diff --git a/docs/build/html/reference/entity.html b/docs/build/html/reference/entity.html index 51e6cc7..02f661d 100644 --- a/docs/build/html/reference/entity.html +++ b/docs/build/html/reference/entity.html @@ -214,15 +214,12 @@

      Entity#

      Public Functions

      -
      -Entity(RenderWindow &window, std::shared_ptr<Texture> texture)#
      +
      +Entity(std::shared_ptr<Texture> texture)#

      Create a entity.

      Parameters:
      -
        -
      • window – The renderer context.

      • -
      • texture – The texture of the entity.

      • -
      +

      texture – The texture of the entity.

      @@ -317,7 +314,7 @@

      Entity#
    • Entity
      • Entity diff --git a/docs/build/html/reference/font.html b/docs/build/html/reference/font.html index 49ff1a0..8ea18f6 100644 --- a/docs/build/html/reference/font.html +++ b/docs/build/html/reference/font.html @@ -214,13 +214,12 @@

        Font#

        Public Functions

        -
        -Font(RenderWindow &window, const std::string &fileDir, int ptSize)#
        +
        +Font(const std::string &fileDir, int ptSize)#

        Create a font.

        Parameters:
          -
        • window – The renderer context.

        • fileDir – The directory of the font file.

        • ptSize – The point size of the font.

        @@ -309,7 +308,7 @@

        Font#
      • Font
        • Font
        • diff --git a/docs/build/html/reference/texture_cache.html b/docs/build/html/reference/texture_cache.html index 3b6ea83..9150215 100644 --- a/docs/build/html/reference/texture_cache.html +++ b/docs/build/html/reference/texture_cache.html @@ -218,14 +218,9 @@

          TextureCache

          Public Functions

          -
          -inline explicit TextureCache(RenderWindow &window)#
          +
          +TextureCache() = default#

          Instantiate the texture cache.

          -
          -
          Parameters:
          -

          window – The renderer context.

          -
          -
          @@ -392,7 +387,7 @@

          TextureCacheTextureCache
          • TextureCache
              -
            • TextureCache::TextureCache()
            • +
            • TextureCache::TextureCache()
            • TextureCache::load()
            • TextureCache::create()
            • TextureCache::move()
            • diff --git a/docs/build/html/reference/tile_map.html b/docs/build/html/reference/tile_map.html index 7dd4626..ee33b0b 100644 --- a/docs/build/html/reference/tile_map.html +++ b/docs/build/html/reference/tile_map.html @@ -214,13 +214,12 @@

              TileMap#<

              Public Functions

              -
              -TileMap(RenderWindow &window, TextureCache &textureCache, const std::string &tmxPath)#
              +
              +TileMap(TextureCache &textureCache, const std::string &tmxPath)#

              Constructs a tile map from a TMX file.

              Parameters:
                -
              • window – The window to render to.

              • textureCache – The texture cache to use.

              • tmxPath – The path to the TMX file.

              @@ -319,7 +318,7 @@

              TileMap#<
              • TileMap
                • TileMap
                    -
                  • TileMap::TileMap()
                  • +
                  • TileMap::TileMap()
                  • TileMap::drawTiles()
                  • TileMap::drawObjects()
                  • TileMap::drawAll()
                  • diff --git a/docs/build/html/searchindex.js b/docs/build/html/searchindex.js index 353576a..f803bc7 100644 --- a/docs/build/html/searchindex.js +++ b/docs/build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["getting_started", "index", "installation", "reference/draw", "reference/entity", "reference/font", "reference/input", "reference/math", "reference/rect", "reference/ref_main", "reference/render_window", "reference/texture", "reference/texture_cache", "reference/tile_map", "reference/time"], "filenames": ["getting_started.rst", "index.rst", "installation.rst", "reference/draw.rst", "reference/entity.rst", "reference/font.rst", "reference/input.rst", "reference/math.rst", "reference/rect.rst", "reference/ref_main.rst", "reference/render_window.rst", "reference/texture.rst", "reference/texture_cache.rst", "reference/tile_map.rst", "reference/time.rst"], "titles": ["Getting Started", "Introduction", "Installation", "draw", "Entity", "Font", "input", "math", "Rect", "API Reference", "RenderWindow", "Texture", "TextureCache", "TileMap", "time"], "terms": {"after": 0, "follow": [0, 2], "instal": [0, 1], "guid": 0, "you": [0, 2], "ar": 0, "readi": [0, 2], "your": [0, 2], "first": [0, 7, 10], "kraken": [0, 1, 2], "engin": [0, 1, 2], "program": [0, 2], "includ": [0, 1, 2], "krakenengin": 0, "hpp": 0, "const": [0, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13], "kn": [0, 3, 6, 7], "math": [0, 1, 6, 8, 9, 10, 11, 12], "vec2": [0, 6, 7, 8, 10, 11, 12], "screen_siz": [0, 8], "800": 0, "600": 0, "int": [0, 3, 5, 6, 10, 14], "main": 0, "renderwindow": [0, 1, 3, 4, 5, 9, 12, 13], "window": [0, 2, 3, 4, 5, 10, 12, 13], "time": [0, 1, 4, 7, 9, 10], "clock": [0, 14], "bool": [0, 5, 8, 10], "done": 0, "fals": [0, 10], "while": [0, 4, 11], "doubl": [0, 4, 10, 14], "deltatim": [0, 4], "tick": [0, 14], "60": [0, 14], "auto": 0, "event": [0, 10], "getev": [0, 10], "type": 0, "kn_quit": 0, "true": [0, 10], "cl": [0, 10], "flip": [0, 10], "return": [0, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14], "exit_success": 0, "thi": [0, 2, 11, 12, 14], "code": 0, "open": [0, 2], "close": 0, "when": 0, "user": [0, 10, 11], "press": [0, 6], "": [0, 4], "x": [0, 8, 10], "button": [0, 6], "It": 0, "also": 0, "clear": [0, 10], "screen": [0, 10], "everi": 0, "frame": [0, 4, 10, 14], "buffer": [0, 10], "The": [0, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14], "function": [0, 1, 4, 5, 7, 8, 10, 11, 12, 13, 14], "elaps": 0, "sinc": [0, 4], "last": [0, 4], "call": [0, 12], "second": [0, 7], "paramet": [0, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14], "i": [0, 2, 10, 11, 12, 14], "cap": 0, "rate": [0, 14], "extend": 1, "sdl2": 1, "easi": 1, "us": [1, 2, 10, 11, 13], "featur": 1, "like": 1, "textur": [1, 4, 5, 9, 10, 12, 13], "cach": [1, 12, 13], "collis": [1, 4], "logic": 1, "futur": 1, "plan": [1, 12, 14], "implement": 1, "handi": 1, "mathemat": 1, "pathfind": 1, "raycast": 1, "built": [1, 2], "physic": 1, "get": [1, 4, 6, 7, 8, 10, 11, 12, 13, 14], "start": [1, 2], "hello": 1, "world": 1, "api": 1, "refer": [1, 3, 10, 12], "draw": [1, 9, 10, 13], "entiti": [1, 9], "font": [1, 9, 12], "input": [1, 9], "rect": [1, 3, 9, 10, 11], "texturecach": [1, 9, 11, 13], "tilemap": [1, 9], "now": 2, "ha": 2, "onli": [2, 10], "been": 2, "test": 2, "confirm": 2, "work": 2, "system": 2, "mingw64": 2, "10": 2, "11": 2, "manjaro": 2, "arch": 2, "ubuntu": 2, "debian": 2, "still": 2, "develop": 2, "product": 2, "mean": 2, "aren": 2, "t": [2, 4, 7], "ani": 2, "pre": 2, "binari": 2, "yet": 2, "so": 2, "have": 2, "build": 2, "yourself": 2, "befor": [2, 10], "ensur": 2, "c": 2, "compil": 2, "cmake": 2, "git": 2, "clone": 2, "repositori": 2, "directori": [2, 5], "cmd": 2, "enter": 2, "command": 2, "termin": 2, "md": 2, "cd": 2, "g": 2, "unix": 2, "makefil": 2, "d": 2, "cmake_cxx_compil": 2, "x86_64": 2, "w64": 2, "mingw32": 2, "make": 2, "drag": 2, "dll": 2, "file": [2, 5, 12, 13], "from": [2, 4, 10, 12, 13], "bin": 2, "next": 2, "execut": 2, "mai": 2, "own": 2, "gener": 2, "long": 2, "64": 2, "bit": 2, "cmakelist": 2, "txt": 2, "under": 2, "current": 2, "difficult": 2, "process": 2, "link": 2, "depend": 2, "As": 2, "must": 2, "_dep": 2, "sdl": [2, 11], "src": 2, "sdl_ttf": 2, "sdl_mixer": 2, "sdl_imag": 2, "tmxlite": 2, "And": 2, "freetyp": 2, "void": [3, 4, 7, 8, 10, 11, 12, 13], "sdl_color": [3, 5, 10, 12], "color": [3, 5, 10, 12], "thick": 3, "0": [3, 5, 7, 10], "rectangl": [3, 8, 10], "If": 3, "remain": 3, "fill": 3, "instanc": [3, 10], "class": [4, 5, 7, 10, 11, 12, 13, 14], "an": [4, 12], "inherit": 4, "public": [4, 5, 7, 8, 10, 11, 12, 13, 14], "std": [4, 5, 6, 10, 12, 13], "shared_ptr": [4, 5, 10, 12], "creat": [4, 5, 11, 12], "render": [4, 5, 10, 12, 13], "context": [4, 5, 10, 12], "gettextur": [4, 12], "pointer": [4, 12], "A": [5, 7, 8, 11, 12, 13, 14], "text": 5, "string": [5, 10, 12, 13], "filedir": 5, "ptsize": 5, "point": [5, 8], "size": [5, 8, 11, 12], "antialia": 5, "wraplength": 5, "whether": [5, 8, 10], "length": [5, 7], "wrap": 5, "getmousepo": 6, "mous": 6, "posit": [6, 8, 10], "getmousebuttonpress": 6, "uint8": 6, "getkeyspress": 6, "kei": 6, "getvector": 6, "vector": [4, 6, 7, 10, 13], "sdl_scancod": 6, "left": 6, "right": 6, "up": 6, "down": 6, "move": [4, 6, 11, 12], "struct": [7, 8], "2d": [7, 8], "float": [7, 8, 11], "getlength": 7, "normal": 7, "distanceto": 7, "other": [4, 7], "distanc": 7, "anoth": [7, 8], "static": [7, 10], "zero": 7, "all": [7, 12], "compon": 7, "set": [7, 8, 10, 11], "clampvec": 7, "vec": 7, "min": [7, 8], "max": [7, 8], "clamp": [7, 8], "minimum": [7, 8], "valu": [7, 8], "maximum": [7, 8], "lerpvec": 7, "b": 7, "linearli": 7, "interpol": 7, "templat": [4, 7], "digit": 7, "val": 7, "sdl_frect": 8, "inlin": [4, 8, 10, 12], "y": [8, 10], "w": 8, "h": 8, "construct": [8, 13], "new": [8, 10], "width": [8, 11], "height": [8, 11], "getpo": 8, "getsiz": [8, 11], "setsiz": [8, 11], "collidepoint": 8, "po": 8, "check": [4, 8], "collid": 8, "colliderect": 8, "255": 10, "blit": 10, "crop": 10, "blitex": 10, "angl": 10, "flipx": 10, "flipi": 10, "axi": 10, "sdl_render": 10, "getrender": 10, "kn_event": 10, "getfullscreen": 10, "fullscreen": 10, "settitl": 10, "newtitl": 10, "titl": 10, "setfullscreen": 10, "otherwis": 10, "getinst": 10, "singleton": [10, 12, 14], "getscal": 10, "scale": [10, 11], "setscal": 10, "newscal": 10, "valid": 10, "instanti": [10, 12], "contain": 11, "explicit": [11, 12], "sdl_textur": 11, "load": [11, 12], "meant": 11, "getrect": 11, "getsdltextur": 11, "scalebi": 11, "factor": 11, "fitwidth": 11, "fit": 11, "maintain": 11, "aspect": 11, "ratio": 11, "fitheight": 11, "becom": [12, 14], "name": 12, "path": [12, 13], "solid": 12, "exist": 12, "recommend": 12, "map": [12, 13], "getcach": 12, "unload": 12, "unloadal": 12, "method": 12, "destructor": 12, "repres": 13, "tile": 13, "tmxpath": 13, "tmx": 13, "drawtil": 13, "drawobject": 13, "object": 13, "drawal": 13, "getobject": 13, "keep": 14, "track": 14, "framer": 14, "delta": 14, "between": 14, "calcul": 14, "protect": 4, "typenam": 4, "moveandcollid": 4}, "objects": {"": [[4, 0, 1, "_CPPv4N2kn6EntityE", "kn::Entity"], [4, 1, 1, "_CPPv4N2kn6Entity6EntityER12RenderWindowNSt10shared_ptrI7TextureEE", "kn::Entity::Entity"], [4, 2, 1, "_CPPv4N2kn6Entity6EntityER12RenderWindowNSt10shared_ptrI7TextureEE", "kn::Entity::Entity::texture"], [4, 2, 1, "_CPPv4N2kn6Entity6EntityER12RenderWindowNSt10shared_ptrI7TextureEE", "kn::Entity::Entity::window"], [4, 1, 1, "_CPPv4NK2kn6Entity10getTextureEv", "kn::Entity::getTexture"], [4, 1, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide"], [4, 3, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide::T"], [4, 2, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide::deltaTime"], [4, 2, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide::others"], [5, 0, 1, "_CPPv4N2kn4FontE", "kn::Font"], [5, 1, 1, "_CPPv4N2kn4Font4FontER12RenderWindowRKNSt6stringEi", "kn::Font::Font"], [5, 2, 1, "_CPPv4N2kn4Font4FontER12RenderWindowRKNSt6stringEi", "kn::Font::Font::fileDir"], [5, 2, 1, "_CPPv4N2kn4Font4FontER12RenderWindowRKNSt6stringEi", "kn::Font::Font::ptSize"], [5, 2, 1, "_CPPv4N2kn4Font4FontER12RenderWindowRKNSt6stringEi", "kn::Font::Font::window"], [5, 1, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::antialias"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::color"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::text"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::wrapLength"], [8, 0, 1, "_CPPv4N2kn4RectE", "kn::Rect"], [8, 1, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::h"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::w"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::x"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::y"], [8, 1, 1, "_CPPv4N2kn4Rect5clampERKN4math4Vec2ERKN4math4Vec2E", "kn::Rect::clamp"], [8, 2, 1, "_CPPv4N2kn4Rect5clampERKN4math4Vec2ERKN4math4Vec2E", "kn::Rect::clamp::max"], [8, 2, 1, "_CPPv4N2kn4Rect5clampERKN4math4Vec2ERKN4math4Vec2E", "kn::Rect::clamp::min"], [8, 1, 1, "_CPPv4N2kn4Rect12collidePointERKN4math4Vec2E", "kn::Rect::collidePoint"], [8, 2, 1, "_CPPv4N2kn4Rect12collidePointERKN4math4Vec2E", "kn::Rect::collidePoint::pos"], [8, 1, 1, "_CPPv4N2kn4Rect11collideRectERK4Rect", "kn::Rect::collideRect"], [8, 2, 1, "_CPPv4N2kn4Rect11collideRectERK4Rect", "kn::Rect::collideRect::rect"], [8, 1, 1, "_CPPv4N2kn4Rect6getPosEv", "kn::Rect::getPos"], [8, 1, 1, "_CPPv4N2kn4Rect7getSizeEv", "kn::Rect::getSize"], [8, 1, 1, "_CPPv4N2kn4Rect7setSizeERKN4math4Vec2E", "kn::Rect::setSize"], [8, 2, 1, "_CPPv4N2kn4Rect7setSizeERKN4math4Vec2E", "kn::Rect::setSize::size"], [10, 0, 1, "_CPPv4N2kn12RenderWindowE", "kn::RenderWindow"], [10, 1, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit"], [10, 1, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEERKN4math4Vec2E", "kn::RenderWindow::blit"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit::crop"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEERKN4math4Vec2E", "kn::RenderWindow::blit::position"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit::rect"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit::texture"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEERKN4math4Vec2E", "kn::RenderWindow::blit::texture"], [10, 1, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx"], [10, 1, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::angle"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::angle"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::crop"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::flipX"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::flipX"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::flipY"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::flipY"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::position"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::rect"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::texture"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::texture"], [10, 1, 1, "_CPPv4N2kn12RenderWindow3clsE9SDL_Color", "kn::RenderWindow::cls"], [10, 2, 1, "_CPPv4N2kn12RenderWindow3clsE9SDL_Color", "kn::RenderWindow::cls::color"], [10, 1, 1, "_CPPv4N2kn12RenderWindow4flipEv", "kn::RenderWindow::flip"], [10, 1, 1, "_CPPv4N2kn12RenderWindow9getEventsEv", "kn::RenderWindow::getEvents"], [10, 1, 1, "_CPPv4NK2kn12RenderWindow13getFullscreenEv", "kn::RenderWindow::getFullscreen"], [10, 1, 1, "_CPPv4N2kn12RenderWindow11getInstanceEv", "kn::RenderWindow::getInstance"], [10, 1, 1, "_CPPv4N2kn12RenderWindow11getRendererEv", "kn::RenderWindow::getRenderer"], [10, 1, 1, "_CPPv4N2kn12RenderWindow8getScaleEv", "kn::RenderWindow::getScale"], [10, 1, 1, "_CPPv4N2kn12RenderWindow13setFullscreenEb", "kn::RenderWindow::setFullscreen"], [10, 2, 1, "_CPPv4N2kn12RenderWindow13setFullscreenEb", "kn::RenderWindow::setFullscreen::fullscreen"], [10, 1, 1, "_CPPv4N2kn12RenderWindow8setScaleEi", "kn::RenderWindow::setScale"], [10, 2, 1, "_CPPv4N2kn12RenderWindow8setScaleEi", "kn::RenderWindow::setScale::newScale"], [10, 1, 1, "_CPPv4N2kn12RenderWindow8setTitleERKNSt6stringE", "kn::RenderWindow::setTitle"], [10, 2, 1, "_CPPv4N2kn12RenderWindow8setTitleERKNSt6stringE", "kn::RenderWindow::setTitle::newTitle"], [11, 0, 1, "_CPPv4N2kn7TextureE", "kn::Texture"], [11, 1, 1, "_CPPv4N2kn7Texture7TextureEP11SDL_Texture", "kn::Texture::Texture"], [11, 2, 1, "_CPPv4N2kn7Texture7TextureEP11SDL_Texture", "kn::Texture::Texture::texture"], [11, 1, 1, "_CPPv4N2kn7Texture9fitHeightEf", "kn::Texture::fitHeight"], [11, 2, 1, "_CPPv4N2kn7Texture9fitHeightEf", "kn::Texture::fitHeight::height"], [11, 1, 1, "_CPPv4N2kn7Texture8fitWidthEf", "kn::Texture::fitWidth"], [11, 2, 1, "_CPPv4N2kn7Texture8fitWidthEf", "kn::Texture::fitWidth::width"], [11, 1, 1, "_CPPv4NK2kn7Texture7getRectEv", "kn::Texture::getRect"], [11, 1, 1, "_CPPv4NK2kn7Texture13getSDLTextureEv", "kn::Texture::getSDLTexture"], [11, 1, 1, "_CPPv4NK2kn7Texture7getSizeEv", "kn::Texture::getSize"], [11, 1, 1, "_CPPv4N2kn7Texture7scaleByEf", "kn::Texture::scaleBy"], [11, 2, 1, "_CPPv4N2kn7Texture7scaleByEf", "kn::Texture::scaleBy::factor"], [11, 1, 1, "_CPPv4N2kn7Texture7setSizeERKN4math4Vec2E", "kn::Texture::setSize"], [11, 2, 1, "_CPPv4N2kn7Texture7setSizeERKN4math4Vec2E", "kn::Texture::setSize::size"], [12, 0, 1, "_CPPv4N2kn12TextureCacheE", "kn::TextureCache"], [12, 1, 1, "_CPPv4N2kn12TextureCache12TextureCacheER12RenderWindow", "kn::TextureCache::TextureCache"], [12, 2, 1, "_CPPv4N2kn12TextureCache12TextureCacheER12RenderWindow", "kn::TextureCache::TextureCache::window"], [12, 1, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create"], [12, 2, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create::color"], [12, 2, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create::name"], [12, 2, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create::size"], [12, 1, 1, "_CPPv4NK2kn12TextureCache8getCacheEv", "kn::TextureCache::getCache"], [12, 1, 1, "_CPPv4NK2kn12TextureCache10getTextureERKNSt6stringE", "kn::TextureCache::getTexture"], [12, 2, 1, "_CPPv4NK2kn12TextureCache10getTextureERKNSt6stringE", "kn::TextureCache::getTexture::name"], [12, 1, 1, "_CPPv4N2kn12TextureCache4loadERKNSt6stringERKNSt6stringE", "kn::TextureCache::load"], [12, 2, 1, "_CPPv4N2kn12TextureCache4loadERKNSt6stringERKNSt6stringE", "kn::TextureCache::load::name"], [12, 2, 1, "_CPPv4N2kn12TextureCache4loadERKNSt6stringERKNSt6stringE", "kn::TextureCache::load::path"], [12, 1, 1, "_CPPv4N2kn12TextureCache4moveERKNSt6stringENSt10shared_ptrI7TextureEE", "kn::TextureCache::move"], [12, 2, 1, "_CPPv4N2kn12TextureCache4moveERKNSt6stringENSt10shared_ptrI7TextureEE", "kn::TextureCache::move::name"], [12, 2, 1, "_CPPv4N2kn12TextureCache4moveERKNSt6stringENSt10shared_ptrI7TextureEE", "kn::TextureCache::move::texture"], [12, 1, 1, "_CPPv4N2kn12TextureCache6unloadERKNSt6stringE", "kn::TextureCache::unload"], [12, 2, 1, "_CPPv4N2kn12TextureCache6unloadERKNSt6stringE", "kn::TextureCache::unload::name"], [12, 1, 1, "_CPPv4N2kn12TextureCache9unloadAllEv", "kn::TextureCache::unloadAll"], [13, 0, 1, "_CPPv4N2kn7TileMapE", "kn::TileMap"], [13, 1, 1, "_CPPv4N2kn7TileMap7TileMapER12RenderWindowR12TextureCacheRKNSt6stringE", "kn::TileMap::TileMap"], [13, 2, 1, "_CPPv4N2kn7TileMap7TileMapER12RenderWindowR12TextureCacheRKNSt6stringE", "kn::TileMap::TileMap::textureCache"], [13, 2, 1, "_CPPv4N2kn7TileMap7TileMapER12RenderWindowR12TextureCacheRKNSt6stringE", "kn::TileMap::TileMap::tmxPath"], [13, 2, 1, "_CPPv4N2kn7TileMap7TileMapER12RenderWindowR12TextureCacheRKNSt6stringE", "kn::TileMap::TileMap::window"], [13, 1, 1, "_CPPv4N2kn7TileMap7drawAllEv", "kn::TileMap::drawAll"], [13, 1, 1, "_CPPv4N2kn7TileMap11drawObjectsEv", "kn::TileMap::drawObjects"], [13, 1, 1, "_CPPv4N2kn7TileMap9drawTilesEv", "kn::TileMap::drawTiles"], [13, 1, 1, "_CPPv4NK2kn7TileMap10getObjectsEv", "kn::TileMap::getObjects"], [3, 1, 1, "_CPPv4N2kn4draw4rectER12RenderWindowR4RectK9SDL_Colori", "kn::draw::rect"], [3, 2, 1, "_CPPv4N2kn4draw4rectER12RenderWindowR4RectK9SDL_Colori", "kn::draw::rect::color"], [3, 2, 1, "_CPPv4N2kn4draw4rectER12RenderWindowR4RectK9SDL_Colori", "kn::draw::rect::rect"], [3, 2, 1, "_CPPv4N2kn4draw4rectER12RenderWindowR4RectK9SDL_Colori", "kn::draw::rect::thickness"], [3, 2, 1, "_CPPv4N2kn4draw4rectER12RenderWindowR4RectK9SDL_Colori", "kn::draw::rect::window"], [6, 1, 1, "_CPPv4N2kn5input14getKeysPressedEv", "kn::input::getKeysPressed"], [6, 1, 1, "_CPPv4N2kn5input21getMouseButtonPressedEv", "kn::input::getMouseButtonPressed"], [6, 1, 1, "_CPPv4N2kn5input11getMousePosEv", "kn::input::getMousePos"], [6, 1, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::down"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::left"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::right"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::up"], [7, 0, 1, "_CPPv4N2kn4math4Vec2E", "kn::math::Vec2"], [7, 1, 1, "_CPPv4N2kn4math4Vec24ZEROEv", "kn::math::Vec2::ZERO"], [7, 1, 1, "_CPPv4NK2kn4math4Vec210distanceToERK4Vec2", "kn::math::Vec2::distanceTo"], [7, 2, 1, "_CPPv4NK2kn4math4Vec210distanceToERK4Vec2", "kn::math::Vec2::distanceTo::other"], [7, 1, 1, "_CPPv4NK2kn4math4Vec29getLengthEv", "kn::math::Vec2::getLength"], [7, 1, 1, "_CPPv4N2kn4math4Vec29normalizeEv", "kn::math::Vec2::normalize"], [7, 1, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp"], [7, 3, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::digit"], [7, 2, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::max"], [7, 2, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::min"], [7, 2, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::val"], [7, 1, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec"], [7, 2, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec::max"], [7, 2, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec::min"], [7, 2, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec::vec"], [7, 1, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec"], [7, 2, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec::a"], [7, 2, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec::b"], [7, 2, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec::t"], [14, 0, 1, "_CPPv4N2kn4time5ClockE", "kn::time::Clock"], [14, 1, 1, "_CPPv4N2kn4time5Clock4tickEi", "kn::time::Clock::tick"], [14, 2, 1, "_CPPv4N2kn4time5Clock4tickEi", "kn::time::Clock::tick::frameRate"]]}, "objtypes": {"0": "cpp:class", "1": "cpp:function", "2": "cpp:functionParam", "3": "cpp:templateParam"}, "objnames": {"0": ["cpp", "class", "C++ class"], "1": ["cpp", "function", "C++ function"], "2": ["cpp", "functionParam", "C++ function parameter"], "3": ["cpp", "templateParam", "C++ template parameter"]}, "titleterms": {"get": 0, "start": 0, "hello": 0, "world": 0, "introduct": 1, "tabl": 1, "content": 1, "instal": 2, "draw": 3, "entiti": 4, "font": 5, "input": 6, "math": 7, "rect": 8, "api": 9, "refer": 9, "renderwindow": 10, "textur": 11, "texturecach": 12, "tilemap": 13, "time": 14}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"Getting Started": [[0, "getting-started"]], "Hello World": [[0, "hello-world"]], "Introduction": [[1, "introduction"]], "Table of Contents": [[1, "table-of-contents"]], "Installation": [[2, "installation"]], "draw": [[3, "draw"]], "Font": [[5, "font"]], "input": [[6, "input"]], "math": [[7, "math"]], "Rect": [[8, "rect"]], "API Reference": [[9, "api-reference"]], "RenderWindow": [[10, "renderwindow"]], "Texture": [[11, "texture"]], "TextureCache": [[12, "texturecache"]], "TileMap": [[13, "tilemap"]], "time": [[14, "time"]], "Entity": [[4, "entity"]]}, "indexentries": {"kn::entity (c++ class)": [[4, "_CPPv4N2kn6EntityE"]], "kn::entity::entity (c++ function)": [[4, "_CPPv4N2kn6Entity6EntityER12RenderWindowNSt10shared_ptrI7TextureEE"]], "kn::entity::gettexture (c++ function)": [[4, "_CPPv4NK2kn6Entity10getTextureEv"]], "kn::entity::moveandcollide (c++ function)": [[4, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["getting_started", "index", "installation", "reference/draw", "reference/entity", "reference/font", "reference/input", "reference/math", "reference/rect", "reference/ref_main", "reference/render_window", "reference/texture", "reference/texture_cache", "reference/tile_map", "reference/time"], "filenames": ["getting_started.rst", "index.rst", "installation.rst", "reference/draw.rst", "reference/entity.rst", "reference/font.rst", "reference/input.rst", "reference/math.rst", "reference/rect.rst", "reference/ref_main.rst", "reference/render_window.rst", "reference/texture.rst", "reference/texture_cache.rst", "reference/tile_map.rst", "reference/time.rst"], "titles": ["Getting Started", "Introduction", "Installation", "draw", "Entity", "Font", "input", "math", "Rect", "API Reference", "RenderWindow", "Texture", "TextureCache", "TileMap", "time"], "terms": {"after": 0, "follow": [0, 2], "instal": [0, 1], "guid": 0, "you": [0, 2], "ar": 0, "readi": [0, 2], "your": [0, 2], "first": [0, 7, 10], "kraken": [0, 1, 2], "engin": [0, 1, 2], "program": [0, 2], "includ": [0, 1, 2], "krakenengin": 0, "hpp": 0, "const": [0, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13], "kn": [0, 3, 6, 7], "math": [0, 1, 6, 8, 9, 10, 11, 12], "vec2": [0, 6, 7, 8, 10, 11, 12], "screen_siz": [0, 8], "800": 0, "600": 0, "int": [0, 3, 5, 6, 10, 14], "main": 0, "renderwindow": [0, 1, 9], "window": [0, 2, 10], "time": [0, 1, 4, 7, 9, 10], "clock": [0, 14], "bool": [0, 5, 8, 10], "done": 0, "fals": [0, 10], "while": [0, 4, 11], "doubl": [0, 4, 10, 14], "deltatim": [0, 4], "tick": [0, 14], "60": [0, 14], "auto": 0, "event": [0, 10], "getev": [0, 10], "type": 0, "kn_quit": 0, "true": [0, 10], "cl": [0, 10], "flip": [0, 10], "return": [0, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14], "exit_success": 0, "thi": [0, 2, 11, 12, 14], "code": 0, "open": [0, 2], "close": 0, "when": 0, "user": [0, 10, 11], "press": [0, 6], "": [0, 4], "x": [0, 8, 10], "button": [0, 6], "It": 0, "also": 0, "clear": [0, 10], "screen": [0, 10], "everi": 0, "frame": [0, 4, 10, 14], "buffer": [0, 10], "The": [0, 2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14], "function": [0, 1, 4, 5, 7, 8, 10, 11, 12, 13, 14], "elaps": 0, "sinc": [0, 4], "last": [0, 4], "call": [0, 12], "second": [0, 7], "paramet": [0, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14], "i": [0, 2, 10, 11, 12, 14], "cap": 0, "rate": [0, 14], "extend": 1, "sdl2": 1, "easi": 1, "us": [1, 2, 10, 11, 13], "featur": 1, "like": 1, "textur": [1, 4, 5, 9, 10, 12, 13], "cach": [1, 12, 13], "collis": [1, 4], "logic": 1, "futur": 1, "plan": [1, 12, 14], "implement": 1, "handi": 1, "mathemat": 1, "pathfind": 1, "raycast": 1, "built": [1, 2], "physic": 1, "get": [1, 4, 6, 7, 8, 10, 11, 12, 13, 14], "start": [1, 2], "hello": 1, "world": 1, "api": 1, "refer": [1, 10, 12], "draw": [1, 9, 10, 13], "entiti": [1, 9], "font": [1, 9, 12], "input": [1, 9], "rect": [1, 3, 9, 10, 11], "texturecach": [1, 9, 11, 13], "tilemap": [1, 9], "now": 2, "ha": 2, "onli": [2, 10], "been": 2, "test": 2, "confirm": 2, "work": 2, "system": 2, "mingw64": 2, "10": 2, "11": 2, "manjaro": 2, "arch": 2, "ubuntu": 2, "debian": 2, "still": 2, "develop": 2, "product": 2, "mean": 2, "aren": 2, "t": [2, 4, 7], "ani": 2, "pre": 2, "binari": 2, "yet": 2, "so": 2, "have": 2, "build": 2, "yourself": 2, "befor": [2, 10], "ensur": 2, "c": 2, "compil": 2, "cmake": 2, "git": 2, "clone": 2, "repositori": 2, "directori": [2, 5], "cmd": 2, "enter": 2, "command": 2, "termin": 2, "md": 2, "cd": 2, "g": 2, "unix": 2, "makefil": 2, "d": 2, "cmake_cxx_compil": 2, "x86_64": 2, "w64": 2, "mingw32": 2, "make": 2, "drag": 2, "dll": 2, "file": [2, 5, 12, 13], "from": [2, 4, 10, 12, 13], "bin": 2, "next": 2, "execut": 2, "mai": 2, "own": 2, "gener": 2, "long": 2, "64": 2, "bit": 2, "cmakelist": 2, "txt": 2, "under": 2, "current": 2, "difficult": 2, "process": 2, "link": 2, "depend": 2, "As": 2, "must": 2, "_dep": 2, "sdl": [2, 11], "src": 2, "sdl_ttf": 2, "sdl_mixer": 2, "sdl_imag": 2, "tmxlite": 2, "And": 2, "freetyp": 2, "void": [3, 4, 7, 8, 10, 11, 12, 13], "sdl_color": [3, 5, 10, 12], "color": [3, 5, 10, 12], "thick": 3, "0": [3, 5, 7, 10], "rectangl": [3, 8, 10], "If": 3, "remain": 3, "fill": 3, "class": [4, 5, 7, 10, 11, 12, 13, 14], "an": [4, 12], "inherit": 4, "public": [4, 5, 7, 8, 10, 11, 12, 13, 14], "std": [4, 5, 6, 10, 12, 13], "shared_ptr": [4, 5, 10, 12], "creat": [4, 5, 11, 12], "gettextur": [4, 12], "pointer": [4, 12], "protect": 4, "templat": [4, 7], "typenam": 4, "inlin": [4, 8, 10], "moveandcollid": 4, "vector": [4, 6, 7, 10, 13], "other": [4, 7], "move": [4, 6, 11, 12], "check": [4, 8], "A": [5, 7, 8, 11, 12, 13, 14], "render": [5, 10], "text": 5, "string": [5, 10, 12, 13], "filedir": 5, "ptsize": 5, "point": [5, 8], "size": [5, 8, 11, 12], "antialia": 5, "wraplength": 5, "whether": [5, 8, 10], "length": [5, 7], "wrap": 5, "getmousepo": 6, "mous": 6, "posit": [6, 8, 10], "getmousebuttonpress": 6, "uint8": 6, "getkeyspress": 6, "kei": 6, "getvector": 6, "sdl_scancod": 6, "left": 6, "right": 6, "up": 6, "down": 6, "struct": [7, 8], "2d": [7, 8], "float": [7, 8, 11], "getlength": 7, "normal": 7, "distanceto": 7, "distanc": 7, "anoth": [7, 8], "static": [7, 10], "zero": 7, "all": [7, 12], "compon": 7, "set": [7, 8, 10, 11], "clampvec": 7, "vec": 7, "min": [7, 8], "max": [7, 8], "clamp": [7, 8], "minimum": [7, 8], "valu": [7, 8], "maximum": [7, 8], "lerpvec": 7, "b": 7, "linearli": 7, "interpol": 7, "digit": 7, "val": 7, "sdl_frect": 8, "y": [8, 10], "w": 8, "h": 8, "construct": [8, 13], "new": [8, 10], "width": [8, 11], "height": [8, 11], "getpo": 8, "getsiz": [8, 11], "setsiz": [8, 11], "collidepoint": 8, "po": 8, "collid": 8, "colliderect": 8, "context": 10, "255": 10, "blit": 10, "crop": 10, "blitex": 10, "angl": 10, "flipx": 10, "flipi": 10, "axi": 10, "sdl_render": 10, "getrender": 10, "kn_event": 10, "getfullscreen": 10, "fullscreen": 10, "settitl": 10, "newtitl": 10, "titl": 10, "setfullscreen": 10, "otherwis": 10, "getinst": 10, "instanc": 10, "singleton": [10, 12, 14], "getscal": 10, "scale": [10, 11], "setscal": 10, "newscal": 10, "valid": 10, "instanti": [10, 12], "contain": 11, "explicit": 11, "sdl_textur": 11, "load": [11, 12], "meant": 11, "getrect": 11, "getsdltextur": 11, "scalebi": 11, "factor": 11, "fitwidth": 11, "fit": 11, "maintain": 11, "aspect": 11, "ratio": 11, "fitheight": 11, "becom": [12, 14], "default": 12, "name": 12, "path": [12, 13], "solid": 12, "exist": 12, "recommend": 12, "map": [12, 13], "getcach": 12, "unload": 12, "unloadal": 12, "method": 12, "destructor": 12, "repres": 13, "tile": 13, "tmxpath": 13, "tmx": 13, "drawtil": 13, "drawobject": 13, "object": 13, "drawal": 13, "getobject": 13, "keep": 14, "track": 14, "framer": 14, "delta": 14, "between": 14, "calcul": 14}, "objects": {"": [[4, 0, 1, "_CPPv4N2kn6EntityE", "kn::Entity"], [4, 1, 1, "_CPPv4N2kn6Entity6EntityENSt10shared_ptrI7TextureEE", "kn::Entity::Entity"], [4, 2, 1, "_CPPv4N2kn6Entity6EntityENSt10shared_ptrI7TextureEE", "kn::Entity::Entity::texture"], [4, 1, 1, "_CPPv4NK2kn6Entity10getTextureEv", "kn::Entity::getTexture"], [4, 1, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide"], [4, 3, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide::T"], [4, 2, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide::deltaTime"], [4, 2, 1, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE", "kn::Entity::moveAndCollide::others"], [5, 0, 1, "_CPPv4N2kn4FontE", "kn::Font"], [5, 1, 1, "_CPPv4N2kn4Font4FontERKNSt6stringEi", "kn::Font::Font"], [5, 2, 1, "_CPPv4N2kn4Font4FontERKNSt6stringEi", "kn::Font::Font::fileDir"], [5, 2, 1, "_CPPv4N2kn4Font4FontERKNSt6stringEi", "kn::Font::Font::ptSize"], [5, 1, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::antialias"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::color"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::text"], [5, 2, 1, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori", "kn::Font::render::wrapLength"], [8, 0, 1, "_CPPv4N2kn4RectE", "kn::Rect"], [8, 1, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::h"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::w"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::x"], [8, 2, 1, "_CPPv4N2kn4Rect4RectEffff", "kn::Rect::Rect::y"], [8, 1, 1, "_CPPv4N2kn4Rect5clampERKN4math4Vec2ERKN4math4Vec2E", "kn::Rect::clamp"], [8, 2, 1, "_CPPv4N2kn4Rect5clampERKN4math4Vec2ERKN4math4Vec2E", "kn::Rect::clamp::max"], [8, 2, 1, "_CPPv4N2kn4Rect5clampERKN4math4Vec2ERKN4math4Vec2E", "kn::Rect::clamp::min"], [8, 1, 1, "_CPPv4N2kn4Rect12collidePointERKN4math4Vec2E", "kn::Rect::collidePoint"], [8, 2, 1, "_CPPv4N2kn4Rect12collidePointERKN4math4Vec2E", "kn::Rect::collidePoint::pos"], [8, 1, 1, "_CPPv4N2kn4Rect11collideRectERK4Rect", "kn::Rect::collideRect"], [8, 2, 1, "_CPPv4N2kn4Rect11collideRectERK4Rect", "kn::Rect::collideRect::rect"], [8, 1, 1, "_CPPv4N2kn4Rect6getPosEv", "kn::Rect::getPos"], [8, 1, 1, "_CPPv4N2kn4Rect7getSizeEv", "kn::Rect::getSize"], [8, 1, 1, "_CPPv4N2kn4Rect7setSizeERKN4math4Vec2E", "kn::Rect::setSize"], [8, 2, 1, "_CPPv4N2kn4Rect7setSizeERKN4math4Vec2E", "kn::Rect::setSize::size"], [10, 0, 1, "_CPPv4N2kn12RenderWindowE", "kn::RenderWindow"], [10, 1, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit"], [10, 1, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEERKN4math4Vec2E", "kn::RenderWindow::blit"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit::crop"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEERKN4math4Vec2E", "kn::RenderWindow::blit::position"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit::rect"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect", "kn::RenderWindow::blit::texture"], [10, 2, 1, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEERKN4math4Vec2E", "kn::RenderWindow::blit::texture"], [10, 1, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx"], [10, 1, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::angle"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::angle"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::crop"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::flipX"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::flipX"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::flipY"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::flipY"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::position"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::rect"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb", "kn::RenderWindow::blitEx::texture"], [10, 2, 1, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb", "kn::RenderWindow::blitEx::texture"], [10, 1, 1, "_CPPv4N2kn12RenderWindow3clsE9SDL_Color", "kn::RenderWindow::cls"], [10, 2, 1, "_CPPv4N2kn12RenderWindow3clsE9SDL_Color", "kn::RenderWindow::cls::color"], [10, 1, 1, "_CPPv4N2kn12RenderWindow4flipEv", "kn::RenderWindow::flip"], [10, 1, 1, "_CPPv4N2kn12RenderWindow9getEventsEv", "kn::RenderWindow::getEvents"], [10, 1, 1, "_CPPv4NK2kn12RenderWindow13getFullscreenEv", "kn::RenderWindow::getFullscreen"], [10, 1, 1, "_CPPv4N2kn12RenderWindow11getInstanceEv", "kn::RenderWindow::getInstance"], [10, 1, 1, "_CPPv4N2kn12RenderWindow11getRendererEv", "kn::RenderWindow::getRenderer"], [10, 1, 1, "_CPPv4N2kn12RenderWindow8getScaleEv", "kn::RenderWindow::getScale"], [10, 1, 1, "_CPPv4N2kn12RenderWindow13setFullscreenEb", "kn::RenderWindow::setFullscreen"], [10, 2, 1, "_CPPv4N2kn12RenderWindow13setFullscreenEb", "kn::RenderWindow::setFullscreen::fullscreen"], [10, 1, 1, "_CPPv4N2kn12RenderWindow8setScaleEi", "kn::RenderWindow::setScale"], [10, 2, 1, "_CPPv4N2kn12RenderWindow8setScaleEi", "kn::RenderWindow::setScale::newScale"], [10, 1, 1, "_CPPv4N2kn12RenderWindow8setTitleERKNSt6stringE", "kn::RenderWindow::setTitle"], [10, 2, 1, "_CPPv4N2kn12RenderWindow8setTitleERKNSt6stringE", "kn::RenderWindow::setTitle::newTitle"], [11, 0, 1, "_CPPv4N2kn7TextureE", "kn::Texture"], [11, 1, 1, "_CPPv4N2kn7Texture7TextureEP11SDL_Texture", "kn::Texture::Texture"], [11, 2, 1, "_CPPv4N2kn7Texture7TextureEP11SDL_Texture", "kn::Texture::Texture::texture"], [11, 1, 1, "_CPPv4N2kn7Texture9fitHeightEf", "kn::Texture::fitHeight"], [11, 2, 1, "_CPPv4N2kn7Texture9fitHeightEf", "kn::Texture::fitHeight::height"], [11, 1, 1, "_CPPv4N2kn7Texture8fitWidthEf", "kn::Texture::fitWidth"], [11, 2, 1, "_CPPv4N2kn7Texture8fitWidthEf", "kn::Texture::fitWidth::width"], [11, 1, 1, "_CPPv4NK2kn7Texture7getRectEv", "kn::Texture::getRect"], [11, 1, 1, "_CPPv4NK2kn7Texture13getSDLTextureEv", "kn::Texture::getSDLTexture"], [11, 1, 1, "_CPPv4NK2kn7Texture7getSizeEv", "kn::Texture::getSize"], [11, 1, 1, "_CPPv4N2kn7Texture7scaleByEf", "kn::Texture::scaleBy"], [11, 2, 1, "_CPPv4N2kn7Texture7scaleByEf", "kn::Texture::scaleBy::factor"], [11, 1, 1, "_CPPv4N2kn7Texture7setSizeERKN4math4Vec2E", "kn::Texture::setSize"], [11, 2, 1, "_CPPv4N2kn7Texture7setSizeERKN4math4Vec2E", "kn::Texture::setSize::size"], [12, 0, 1, "_CPPv4N2kn12TextureCacheE", "kn::TextureCache"], [12, 1, 1, "_CPPv4N2kn12TextureCache12TextureCacheEv", "kn::TextureCache::TextureCache"], [12, 1, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create"], [12, 2, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create::color"], [12, 2, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create::name"], [12, 2, 1, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color", "kn::TextureCache::create::size"], [12, 1, 1, "_CPPv4NK2kn12TextureCache8getCacheEv", "kn::TextureCache::getCache"], [12, 1, 1, "_CPPv4NK2kn12TextureCache10getTextureERKNSt6stringE", "kn::TextureCache::getTexture"], [12, 2, 1, "_CPPv4NK2kn12TextureCache10getTextureERKNSt6stringE", "kn::TextureCache::getTexture::name"], [12, 1, 1, "_CPPv4N2kn12TextureCache4loadERKNSt6stringERKNSt6stringE", "kn::TextureCache::load"], [12, 2, 1, "_CPPv4N2kn12TextureCache4loadERKNSt6stringERKNSt6stringE", "kn::TextureCache::load::name"], [12, 2, 1, "_CPPv4N2kn12TextureCache4loadERKNSt6stringERKNSt6stringE", "kn::TextureCache::load::path"], [12, 1, 1, "_CPPv4N2kn12TextureCache4moveERKNSt6stringENSt10shared_ptrI7TextureEE", "kn::TextureCache::move"], [12, 2, 1, "_CPPv4N2kn12TextureCache4moveERKNSt6stringENSt10shared_ptrI7TextureEE", "kn::TextureCache::move::name"], [12, 2, 1, "_CPPv4N2kn12TextureCache4moveERKNSt6stringENSt10shared_ptrI7TextureEE", "kn::TextureCache::move::texture"], [12, 1, 1, "_CPPv4N2kn12TextureCache6unloadERKNSt6stringE", "kn::TextureCache::unload"], [12, 2, 1, "_CPPv4N2kn12TextureCache6unloadERKNSt6stringE", "kn::TextureCache::unload::name"], [12, 1, 1, "_CPPv4N2kn12TextureCache9unloadAllEv", "kn::TextureCache::unloadAll"], [13, 0, 1, "_CPPv4N2kn7TileMapE", "kn::TileMap"], [13, 1, 1, "_CPPv4N2kn7TileMap7TileMapER12TextureCacheRKNSt6stringE", "kn::TileMap::TileMap"], [13, 2, 1, "_CPPv4N2kn7TileMap7TileMapER12TextureCacheRKNSt6stringE", "kn::TileMap::TileMap::textureCache"], [13, 2, 1, "_CPPv4N2kn7TileMap7TileMapER12TextureCacheRKNSt6stringE", "kn::TileMap::TileMap::tmxPath"], [13, 1, 1, "_CPPv4N2kn7TileMap7drawAllEv", "kn::TileMap::drawAll"], [13, 1, 1, "_CPPv4N2kn7TileMap11drawObjectsEv", "kn::TileMap::drawObjects"], [13, 1, 1, "_CPPv4N2kn7TileMap9drawTilesEv", "kn::TileMap::drawTiles"], [13, 1, 1, "_CPPv4NK2kn7TileMap10getObjectsEv", "kn::TileMap::getObjects"], [3, 1, 1, "_CPPv4N2kn4draw4rectER4RectK9SDL_Colori", "kn::draw::rect"], [3, 2, 1, "_CPPv4N2kn4draw4rectER4RectK9SDL_Colori", "kn::draw::rect::color"], [3, 2, 1, "_CPPv4N2kn4draw4rectER4RectK9SDL_Colori", "kn::draw::rect::rect"], [3, 2, 1, "_CPPv4N2kn4draw4rectER4RectK9SDL_Colori", "kn::draw::rect::thickness"], [6, 1, 1, "_CPPv4N2kn5input14getKeysPressedEv", "kn::input::getKeysPressed"], [6, 1, 1, "_CPPv4N2kn5input21getMouseButtonPressedEv", "kn::input::getMouseButtonPressed"], [6, 1, 1, "_CPPv4N2kn5input11getMousePosEv", "kn::input::getMousePos"], [6, 1, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::down"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::left"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::right"], [6, 2, 1, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE", "kn::input::getVector::up"], [7, 0, 1, "_CPPv4N2kn4math4Vec2E", "kn::math::Vec2"], [7, 1, 1, "_CPPv4N2kn4math4Vec24ZEROEv", "kn::math::Vec2::ZERO"], [7, 1, 1, "_CPPv4NK2kn4math4Vec210distanceToERK4Vec2", "kn::math::Vec2::distanceTo"], [7, 2, 1, "_CPPv4NK2kn4math4Vec210distanceToERK4Vec2", "kn::math::Vec2::distanceTo::other"], [7, 1, 1, "_CPPv4NK2kn4math4Vec29getLengthEv", "kn::math::Vec2::getLength"], [7, 1, 1, "_CPPv4N2kn4math4Vec29normalizeEv", "kn::math::Vec2::normalize"], [7, 1, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp"], [7, 3, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::digit"], [7, 2, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::max"], [7, 2, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::min"], [7, 2, 1, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit", "kn::math::clamp::val"], [7, 1, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec"], [7, 2, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec::max"], [7, 2, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec::min"], [7, 2, 1, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2", "kn::math::clampVec::vec"], [7, 1, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec"], [7, 2, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec::a"], [7, 2, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec::b"], [7, 2, 1, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f", "kn::math::lerpVec::t"], [14, 0, 1, "_CPPv4N2kn4time5ClockE", "kn::time::Clock"], [14, 1, 1, "_CPPv4N2kn4time5Clock4tickEi", "kn::time::Clock::tick"], [14, 2, 1, "_CPPv4N2kn4time5Clock4tickEi", "kn::time::Clock::tick::frameRate"]]}, "objtypes": {"0": "cpp:class", "1": "cpp:function", "2": "cpp:functionParam", "3": "cpp:templateParam"}, "objnames": {"0": ["cpp", "class", "C++ class"], "1": ["cpp", "function", "C++ function"], "2": ["cpp", "functionParam", "C++ function parameter"], "3": ["cpp", "templateParam", "C++ template parameter"]}, "titleterms": {"get": 0, "start": 0, "hello": 0, "world": 0, "introduct": 1, "tabl": 1, "content": 1, "instal": 2, "draw": 3, "entiti": 4, "font": 5, "input": 6, "math": 7, "rect": 8, "api": 9, "refer": 9, "renderwindow": 10, "textur": 11, "texturecach": 12, "tilemap": 13, "time": 14}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx": 60}, "alltitles": {"Getting Started": [[0, "getting-started"]], "Hello World": [[0, "hello-world"]], "Introduction": [[1, "introduction"]], "Table of Contents": [[1, "table-of-contents"]], "Installation": [[2, "installation"]], "draw": [[3, "draw"]], "Entity": [[4, "entity"]], "Font": [[5, "font"]], "input": [[6, "input"]], "math": [[7, "math"]], "Rect": [[8, "rect"]], "API Reference": [[9, "api-reference"]], "RenderWindow": [[10, "renderwindow"]], "Texture": [[11, "texture"]], "TextureCache": [[12, "texturecache"]], "TileMap": [[13, "tilemap"]], "time": [[14, "time"]]}, "indexentries": {"kn::draw::rect (c++ function)": [[3, "_CPPv4N2kn4draw4rectER4RectK9SDL_Colori"]], "kn::entity (c++ class)": [[4, "_CPPv4N2kn6EntityE"]], "kn::entity::entity (c++ function)": [[4, "_CPPv4N2kn6Entity6EntityENSt10shared_ptrI7TextureEE"]], "kn::entity::gettexture (c++ function)": [[4, "_CPPv4NK2kn6Entity10getTextureEv"]], "kn::entity::moveandcollide (c++ function)": [[4, "_CPPv4I0EN2kn6Entity14moveAndCollideEvdRKNSt6vectorINSt10shared_ptrI1TEEEE"]], "kn::font (c++ class)": [[5, "_CPPv4N2kn4FontE"]], "kn::font::font (c++ function)": [[5, "_CPPv4N2kn4Font4FontERKNSt6stringEi"]], "kn::font::render (c++ function)": [[5, "_CPPv4N2kn4Font6renderERKNSt6stringEb9SDL_Colori"]], "kn::input::getkeyspressed (c++ function)": [[6, "_CPPv4N2kn5input14getKeysPressedEv"]], "kn::input::getmousebuttonpressed (c++ function)": [[6, "_CPPv4N2kn5input21getMouseButtonPressedEv"]], "kn::input::getmousepos (c++ function)": [[6, "_CPPv4N2kn5input11getMousePosEv"]], "kn::input::getvector (c++ function)": [[6, "_CPPv4N2kn5input9getVectorERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEERKNSt6vectorI12SDL_ScancodeEE"]], "kn::math::vec2 (c++ struct)": [[7, "_CPPv4N2kn4math4Vec2E"]], "kn::math::vec2::zero (c++ function)": [[7, "_CPPv4N2kn4math4Vec24ZEROEv"]], "kn::math::vec2::distanceto (c++ function)": [[7, "_CPPv4NK2kn4math4Vec210distanceToERK4Vec2"]], "kn::math::vec2::getlength (c++ function)": [[7, "_CPPv4NK2kn4math4Vec29getLengthEv"]], "kn::math::vec2::normalize (c++ function)": [[7, "_CPPv4N2kn4math4Vec29normalizeEv"]], "kn::math::clamp (c++ function)": [[7, "_CPPv4I0EN2kn4math5clampE5digit5digit5digit5digit"]], "kn::math::clampvec (c++ function)": [[7, "_CPPv4N2kn4math8clampVecE4Vec2RK4Vec2RK4Vec2"]], "kn::math::lerpvec (c++ function)": [[7, "_CPPv4N2kn4math7lerpVecERK4Vec2RK4Vec2f"]], "kn::rect (c++ struct)": [[8, "_CPPv4N2kn4RectE"]], "kn::rect::rect (c++ function)": [[8, "_CPPv4N2kn4Rect4RectEffff"]], "kn::rect::clamp (c++ function)": [[8, "_CPPv4N2kn4Rect5clampERKN4math4Vec2ERKN4math4Vec2E"]], "kn::rect::collidepoint (c++ function)": [[8, "_CPPv4N2kn4Rect12collidePointERKN4math4Vec2E"]], "kn::rect::colliderect (c++ function)": [[8, "_CPPv4N2kn4Rect11collideRectERK4Rect"]], "kn::rect::getpos (c++ function)": [[8, "_CPPv4N2kn4Rect6getPosEv"]], "kn::rect::getsize (c++ function)": [[8, "_CPPv4N2kn4Rect7getSizeEv"]], "kn::rect::setsize (c++ function)": [[8, "_CPPv4N2kn4Rect7setSizeERKN4math4Vec2E"]], "kn::renderwindow (c++ class)": [[10, "_CPPv4N2kn12RenderWindowE"]], "kn::renderwindow::blit (c++ function)": [[10, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEE4Rect4Rect"], [10, "_CPPv4N2kn12RenderWindow4blitERKNSt10shared_ptrI7TextureEERKN4math4Vec2E"]], "kn::renderwindow::blitex (c++ function)": [[10, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEE4Rect4Rectdbb"], [10, "_CPPv4N2kn12RenderWindow6blitExERKNSt10shared_ptrI7TextureEERKN4math4Vec2Edbb"]], "kn::renderwindow::cls (c++ function)": [[10, "_CPPv4N2kn12RenderWindow3clsE9SDL_Color"]], "kn::renderwindow::flip (c++ function)": [[10, "_CPPv4N2kn12RenderWindow4flipEv"]], "kn::renderwindow::getevents (c++ function)": [[10, "_CPPv4N2kn12RenderWindow9getEventsEv"]], "kn::renderwindow::getfullscreen (c++ function)": [[10, "_CPPv4NK2kn12RenderWindow13getFullscreenEv"]], "kn::renderwindow::getinstance (c++ function)": [[10, "_CPPv4N2kn12RenderWindow11getInstanceEv"]], "kn::renderwindow::getrenderer (c++ function)": [[10, "_CPPv4N2kn12RenderWindow11getRendererEv"]], "kn::renderwindow::getscale (c++ function)": [[10, "_CPPv4N2kn12RenderWindow8getScaleEv"]], "kn::renderwindow::setfullscreen (c++ function)": [[10, "_CPPv4N2kn12RenderWindow13setFullscreenEb"]], "kn::renderwindow::setscale (c++ function)": [[10, "_CPPv4N2kn12RenderWindow8setScaleEi"]], "kn::renderwindow::settitle (c++ function)": [[10, "_CPPv4N2kn12RenderWindow8setTitleERKNSt6stringE"]], "kn::texture (c++ class)": [[11, "_CPPv4N2kn7TextureE"]], "kn::texture::texture (c++ function)": [[11, "_CPPv4N2kn7Texture7TextureEP11SDL_Texture"]], "kn::texture::fitheight (c++ function)": [[11, "_CPPv4N2kn7Texture9fitHeightEf"]], "kn::texture::fitwidth (c++ function)": [[11, "_CPPv4N2kn7Texture8fitWidthEf"]], "kn::texture::getrect (c++ function)": [[11, "_CPPv4NK2kn7Texture7getRectEv"]], "kn::texture::getsdltexture (c++ function)": [[11, "_CPPv4NK2kn7Texture13getSDLTextureEv"]], "kn::texture::getsize (c++ function)": [[11, "_CPPv4NK2kn7Texture7getSizeEv"]], "kn::texture::scaleby (c++ function)": [[11, "_CPPv4N2kn7Texture7scaleByEf"]], "kn::texture::setsize (c++ function)": [[11, "_CPPv4N2kn7Texture7setSizeERKN4math4Vec2E"]], "kn::texturecache (c++ class)": [[12, "_CPPv4N2kn12TextureCacheE"]], "kn::texturecache::texturecache (c++ function)": [[12, "_CPPv4N2kn12TextureCache12TextureCacheEv"]], "kn::texturecache::create (c++ function)": [[12, "_CPPv4N2kn12TextureCache6createERKNSt6stringERKN4math4Vec2E9SDL_Color"]], "kn::texturecache::getcache (c++ function)": [[12, "_CPPv4NK2kn12TextureCache8getCacheEv"]], "kn::texturecache::gettexture (c++ function)": [[12, "_CPPv4NK2kn12TextureCache10getTextureERKNSt6stringE"]], "kn::texturecache::load (c++ function)": [[12, "_CPPv4N2kn12TextureCache4loadERKNSt6stringERKNSt6stringE"]], "kn::texturecache::move (c++ function)": [[12, "_CPPv4N2kn12TextureCache4moveERKNSt6stringENSt10shared_ptrI7TextureEE"]], "kn::texturecache::unload (c++ function)": [[12, "_CPPv4N2kn12TextureCache6unloadERKNSt6stringE"]], "kn::texturecache::unloadall (c++ function)": [[12, "_CPPv4N2kn12TextureCache9unloadAllEv"]], "kn::tilemap (c++ class)": [[13, "_CPPv4N2kn7TileMapE"]], "kn::tilemap::tilemap (c++ function)": [[13, "_CPPv4N2kn7TileMap7TileMapER12TextureCacheRKNSt6stringE"]], "kn::tilemap::drawall (c++ function)": [[13, "_CPPv4N2kn7TileMap7drawAllEv"]], "kn::tilemap::drawobjects (c++ function)": [[13, "_CPPv4N2kn7TileMap11drawObjectsEv"]], "kn::tilemap::drawtiles (c++ function)": [[13, "_CPPv4N2kn7TileMap9drawTilesEv"]], "kn::tilemap::getobjects (c++ function)": [[13, "_CPPv4NK2kn7TileMap10getObjectsEv"]], "kn::time::clock (c++ class)": [[14, "_CPPv4N2kn4time5ClockE"]], "kn::time::clock::tick (c++ function)": [[14, "_CPPv4N2kn4time5Clock4tickEi"]]}}) \ No newline at end of file diff --git a/docs/source/xml/_constants_8hpp.xml b/docs/source/xml/_constants_8hpp.xml index c3d35a2..dec9a48 100644 --- a/docs/source/xml/_constants_8hpp.xml +++ b/docs/source/xml/_constants_8hpp.xml @@ -26,23 +26,11 @@ - - - - - - - - - - - - - + @@ -54,26 +42,12 @@ - - - - - - - - - - - - - - - + - + diff --git a/docs/source/xml/_draw_8hpp.xml b/docs/source/xml/_draw_8hpp.xml index 2fd575e..90161d6 100644 --- a/docs/source/xml/_draw_8hpp.xml +++ b/docs/source/xml/_draw_8hpp.xml @@ -3,16 +3,9 @@ Draw.hpp SDL.h - RenderWindow.hpp Rect.hpp D:/Code/c++/Kraken-Engine/include/KrakenEngine.hpp - - - - - - @@ -20,86 +13,30 @@ - - - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -124,18 +61,17 @@ #include<SDL.h> -#include"RenderWindow.hpp" -#include"Rect.hpp" - -namespacekn -{ -namespacedraw -{ - -voidrect(RenderWindow&window,Rect&rect,constSDL_Colorcolor,intthickness=0); - -} -} +#include"Rect.hpp" + +namespacekn +{ +namespacedraw +{ + +voidrect(Rect&rect,constSDL_Colorcolor,intthickness=0); + +} +} diff --git a/docs/source/xml/_entity_8hpp.xml b/docs/source/xml/_entity_8hpp.xml index 6dfdf81..d782148 100644 --- a/docs/source/xml/_entity_8hpp.xml +++ b/docs/source/xml/_entity_8hpp.xml @@ -159,7 +159,7 @@ classEntity { protected: -RenderWindow&window; +RenderWindow&window=RenderWindow::getInstance(); std::shared_ptr<Texture>texture; boolonGround=false; @@ -223,19 +223,19 @@ } public: -Entity(RenderWindow&window,std::shared_ptr<Texture>texture); -~Entity()=default; - -std::shared_ptr<Texture>getTexture()const; - -Rectcrop={0,0,0,0}; -Rectrect; -math::Vec2position; -math::Vec2direction; -math::Vec2velocity; -}; - -} +Entity(std::shared_ptr<Texture>texture); +~Entity()=default; + +std::shared_ptr<Texture>getTexture()const; + +Rectcrop={0,0,0,0}; +Rectrect; +math::Vec2position; +math::Vec2direction; +math::Vec2velocity; +}; + +} diff --git a/docs/source/xml/_font_8hpp.xml b/docs/source/xml/_font_8hpp.xml index 196a5a3..8bccf0d 100644 --- a/docs/source/xml/_font_8hpp.xml +++ b/docs/source/xml/_font_8hpp.xml @@ -7,15 +7,8 @@ SDL.h SDL_ttf.h Texture.hpp - RenderWindow.hpp D:/Code/c++/Kraken-Engine/include/KrakenEngine.hpp - - - - - - @@ -29,8 +22,6 @@ - - @@ -52,32 +43,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -91,12 +56,6 @@ - - - - - - @@ -106,9 +65,6 @@ - - - @@ -138,29 +94,27 @@ #include<SDL_ttf.h> #include"Texture.hpp" -#include"RenderWindow.hpp" - -namespacekn -{ - -classFontfinal -{ -public: -Font(RenderWindow&window,conststd::string&fileDir,intptSize); -~Font() -{ -if(font) -TTF_CloseFont(font); -} - -std::shared_ptr<Texture>render(conststd::string&text,boolantialias,SDL_Colorcolor,intwrapLength=0); - -private: -RenderWindow&window; -TTF_Font*font; -}; - -} + +namespacekn +{ + +classFontfinal +{ +public: +Font(conststd::string&fileDir,intptSize); +~Font() +{ +if(font) +TTF_CloseFont(font); +} + +std::shared_ptr<Texture>render(conststd::string&text,boolantialias,SDL_Colorcolor,intwrapLength=0); + +private: +TTF_Font*font; +}; + +} diff --git a/docs/source/xml/_globals_8hpp.xml b/docs/source/xml/_globals_8hpp.xml index 628dc26..000ac51 100644 --- a/docs/source/xml/_globals_8hpp.xml +++ b/docs/source/xml/_globals_8hpp.xml @@ -68,16 +68,10 @@ - - - - - - diff --git a/docs/source/xml/_kraken_engine_8hpp.xml b/docs/source/xml/_kraken_engine_8hpp.xml index 61adfe1..f44bddf 100644 --- a/docs/source/xml/_kraken_engine_8hpp.xml +++ b/docs/source/xml/_kraken_engine_8hpp.xml @@ -4,13 +4,13 @@ KrakenEngine.hpp Constants.hpp Draw.hpp + Entity.hpp Font.hpp Globals.hpp Input.hpp Math.hpp Rect.hpp RenderWindow.hpp - Entity.hpp Texture.hpp TextureCache.hpp TileMap.hpp @@ -30,57 +30,53 @@ - - - + - + - + - + - + - + - + - + - + - + - - - + - + - + - + - + - + - + @@ -90,22 +86,22 @@ - - - + - + - + - + - + + + @@ -115,54 +111,54 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -170,43 +166,41 @@ - - - + - + - + - + - + - + - + - + - + - + - + @@ -218,28 +212,28 @@ - + - + - + - + - + - + @@ -265,13 +259,13 @@ #include"Constants.hpp" #include"Draw.hpp" -#include"Font.hpp" -#include"Globals.hpp" -#include"Input.hpp" -#include"Math.hpp" -#include"Rect.hpp" -#include"RenderWindow.hpp" -#include"Entity.hpp" +#include"Entity.hpp" +#include"Font.hpp" +#include"Globals.hpp" +#include"Input.hpp" +#include"Math.hpp" +#include"Rect.hpp" +#include"RenderWindow.hpp" #include"Texture.hpp" #include"TextureCache.hpp" #include"TileMap.hpp" diff --git a/docs/source/xml/_math_8hpp.xml b/docs/source/xml/_math_8hpp.xml index f051132..7d14641 100644 --- a/docs/source/xml/_math_8hpp.xml +++ b/docs/source/xml/_math_8hpp.xml @@ -86,16 +86,10 @@ - - - - - - diff --git a/docs/source/xml/_rect_8hpp.xml b/docs/source/xml/_rect_8hpp.xml index 925a47e..1fc948c 100644 --- a/docs/source/xml/_rect_8hpp.xml +++ b/docs/source/xml/_rect_8hpp.xml @@ -74,16 +74,10 @@ - - - - - - diff --git a/docs/source/xml/_render_window_8hpp.xml b/docs/source/xml/_render_window_8hpp.xml index d5ca09a..16c5408 100644 --- a/docs/source/xml/_render_window_8hpp.xml +++ b/docs/source/xml/_render_window_8hpp.xml @@ -13,11 +13,8 @@ Math.hpp Constants.hpp Globals.hpp - D:/Code/c++/Kraken-Engine/include/Draw.hpp D:/Code/c++/Kraken-Engine/include/Entity.hpp - D:/Code/c++/Kraken-Engine/include/Font.hpp D:/Code/c++/Kraken-Engine/include/KrakenEngine.hpp - D:/Code/c++/Kraken-Engine/include/TextureCache.hpp D:/Code/c++/Kraken-Engine/include/TileMap.hpp @@ -106,23 +103,11 @@ - - - - - - - - - - - - - + @@ -134,26 +119,12 @@ - - - - - - - - - - - - - - - + - + diff --git a/docs/source/xml/_texture_8hpp.xml b/docs/source/xml/_texture_8hpp.xml index 028aca2..15bde11 100644 --- a/docs/source/xml/_texture_8hpp.xml +++ b/docs/source/xml/_texture_8hpp.xml @@ -47,12 +47,6 @@ - - - - - - @@ -74,16 +68,10 @@ - - - - - - @@ -98,12 +86,12 @@ - + - + - + @@ -117,7 +105,7 @@ - + diff --git a/docs/source/xml/_texture_cache_8hpp.xml b/docs/source/xml/_texture_cache_8hpp.xml index 77c92e0..46927f2 100644 --- a/docs/source/xml/_texture_cache_8hpp.xml +++ b/docs/source/xml/_texture_cache_8hpp.xml @@ -4,72 +4,39 @@ TextureCache.hpp map memory - RenderWindow.hpp Texture.hpp Math.hpp D:/Code/c++/Kraken-Engine/include/KrakenEngine.hpp D:/Code/c++/Kraken-Engine/include/TileMap.hpp - - - - - - - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + @@ -81,35 +48,18 @@ - - - + - + - - - - - - - - - - - - - - - @@ -143,39 +93,37 @@ #include<map> #include<memory> -#include"RenderWindow.hpp" -#include"Texture.hpp" -#include"Math.hpp" - -namespacekn -{ - -classTextureCachefinal -{ -public: -explicitTextureCache(RenderWindow&window):window(window){} -~TextureCache(){unloadAll();} - -[[maybe_unused]]std::shared_ptr<Texture>load(conststd::string&name,conststd::string&path); - -[[maybe_unused]]std::shared_ptr<Texture>create(conststd::string&name,constmath::Vec2&size,SDL_Colorcolor); - -[[maybe_unused]]std::shared_ptr<Texture>move(conststd::string&name,std::shared_ptr<Texture>texture); - -conststd::map<std::string,std::shared_ptr<Texture>>&getCache()const; - -voidunload(conststd::string&name); - -voidunloadAll(); - -std::shared_ptr<Texture>getTexture(conststd::string&name)const; - -private: -RenderWindow&window; -std::map<std::string,std::shared_ptr<Texture>>textures; -}; - -} +#include"Texture.hpp" +#include"Math.hpp" + +namespacekn +{ + +classTextureCachefinal +{ +public: +TextureCache()=default; +~TextureCache(){unloadAll();} + +[[maybe_unused]]std::shared_ptr<Texture>load(conststd::string&name,conststd::string&path); + +[[maybe_unused]]std::shared_ptr<Texture>create(conststd::string&name,constmath::Vec2&size,SDL_Colorcolor); + +[[maybe_unused]]std::shared_ptr<Texture>move(conststd::string&name,std::shared_ptr<Texture>texture); + +conststd::map<std::string,std::shared_ptr<Texture>>&getCache()const; + +voidunload(conststd::string&name); + +voidunloadAll(); + +std::shared_ptr<Texture>getTexture(conststd::string&name)const; + +private: +std::map<std::string,std::shared_ptr<Texture>>textures; +}; + +} diff --git a/docs/source/xml/_tile_map_8hpp.xml b/docs/source/xml/_tile_map_8hpp.xml index 7cb430a..9f9c49a 100644 --- a/docs/source/xml/_tile_map_8hpp.xml +++ b/docs/source/xml/_tile_map_8hpp.xml @@ -99,8 +99,6 @@ - - @@ -202,27 +200,27 @@ classTileMapfinal { public: -TileMap(RenderWindow&window,TextureCache&textureCache,conststd::string&tmxPath); -~TileMap()=default; - -voiddrawTiles(); - -voiddrawObjects(); - -voiddrawAll(); - -conststd::vector<Object>&getObjects()const; - -private: -RenderWindow&window; -tmx::Mapm_map; - -std::vector<Tile>tileVec; -std::vector<Object>objectVec; -std::map<int,std::shared_ptr<Texture>>tileSetMap; -}; - -} +TileMap(TextureCache&textureCache,conststd::string&tmxPath); +~TileMap()=default; + +voiddrawTiles(); + +voiddrawObjects(); + +voiddrawAll(); + +conststd::vector<Object>&getObjects()const; + +private: +RenderWindow&window=RenderWindow::getInstance(); +tmx::Mapm_map; + +std::vector<Tile>tileVec; +std::vector<Object>objectVec; +std::map<int,std::shared_ptr<Texture>>tileSetMap; +}; + +} diff --git a/docs/source/xml/_tile_types_8hpp.xml b/docs/source/xml/_tile_types_8hpp.xml index b0b2d8d..84f0bed 100644 --- a/docs/source/xml/_tile_types_8hpp.xml +++ b/docs/source/xml/_tile_types_8hpp.xml @@ -109,7 +109,7 @@ structObjectfinal:publicTile { -Object(std::shared_ptr<Texture>texture,Rectcrop,Rectrect,std::stringname,std::stringtype) +Object(std::shared_ptr<Texture>texture,Rectcrop,Rectrect,conststd::string&name,conststd::string&type) :Tile(texture,crop,rect),name(name),type(type){} ~Object()=default; diff --git a/docs/source/xml/classkn_1_1_entity.xml b/docs/source/xml/classkn_1_1_entity.xml index a1b6659..af8666e 100644 --- a/docs/source/xml/classkn_1_1_entity.xml +++ b/docs/source/xml/classkn_1_1_entity.xml @@ -10,6 +10,7 @@ window kn::Entity::window + = RenderWindow::getInstance() @@ -77,7 +78,7 @@ - + Rect @@ -91,7 +92,7 @@ - + math::Vec2 @@ -105,7 +106,7 @@ - + math::Vec2 @@ -119,7 +120,7 @@ - + math::Vec2 @@ -133,7 +134,7 @@ - + @@ -185,16 +186,12 @@ - + kn::Entity::Entity - (RenderWindow &window, std::shared_ptr< Texture > texture) + (std::shared_ptr< Texture > texture) Entity kn::Entity::Entity - - RenderWindow & - window - std::shared_ptr< Texture > texture @@ -205,14 +202,6 @@ -window - - -The renderer context. - - - - texture @@ -224,7 +213,7 @@ - + @@ -238,7 +227,7 @@ - + std::shared_ptr< Texture > @@ -256,7 +245,7 @@ - + @@ -299,11 +288,11 @@ - + kn::Entitycrop kn::Entitydirection - kn::EntityEntity + kn::EntityEntity kn::EntitygetTexture kn::EntitymoveAndCollide kn::EntityonCeiling diff --git a/docs/source/xml/classkn_1_1_font.xml b/docs/source/xml/classkn_1_1_font.xml index 40dc536..08e1310 100644 --- a/docs/source/xml/classkn_1_1_font.xml +++ b/docs/source/xml/classkn_1_1_font.xml @@ -4,20 +4,6 @@ kn::Font Font.hpp - - RenderWindow & - RenderWindow& kn::Font::window - - window - kn::Font::window - - - - - - - - TTF_Font * TTF_Font* kn::Font::font @@ -30,20 +16,16 @@ - + - + kn::Font::Font - (RenderWindow &window, const std::string &fileDir, int ptSize) + (const std::string &fileDir, int ptSize) Font kn::Font::Font - - RenderWindow & - window - const std::string & fileDir @@ -58,14 +40,6 @@ -window - - -The renderer context. - - - - fileDir @@ -85,7 +59,7 @@ - + @@ -99,7 +73,7 @@ - + std::shared_ptr< Texture > @@ -167,7 +141,7 @@ - + @@ -175,25 +149,11 @@ - - - - - - window - - - - - - - - + kn::Fontfont - kn::FontFont + kn::FontFont kn::Fontrender - kn::Fontwindow kn::Font~Font diff --git a/docs/source/xml/classkn_1_1_texture_cache.xml b/docs/source/xml/classkn_1_1_texture_cache.xml index 2aeaab9..f50126c 100644 --- a/docs/source/xml/classkn_1_1_texture_cache.xml +++ b/docs/source/xml/classkn_1_1_texture_cache.xml @@ -4,20 +4,6 @@ kn::TextureCache TextureCache.hpp - - RenderWindow & - RenderWindow& kn::TextureCache::window - - window - kn::TextureCache::window - - - - - - - - std::map< std::string, std::shared_ptr< Texture > > std::map<std::string, std::shared_ptr<Texture> > kn::TextureCache::textures @@ -30,38 +16,24 @@ - + - + kn::TextureCache::TextureCache - (RenderWindow &window) + ()=default TextureCache kn::TextureCache::TextureCache - - RenderWindow & - window - Instantiate the texture cache. - - -window - - -The renderer context. - - - - - + @@ -75,7 +47,7 @@ - + std::shared_ptr< Texture > @@ -118,7 +90,7 @@ - + std::shared_ptr< Texture > @@ -173,7 +145,7 @@ - + std::shared_ptr< Texture > @@ -218,7 +190,7 @@ - + const std::map< std::string, std::shared_ptr< Texture > > & @@ -236,7 +208,7 @@ - + void @@ -265,7 +237,7 @@ - + void @@ -283,7 +255,7 @@ - + std::shared_ptr< Texture > @@ -314,7 +286,7 @@ - + @@ -325,31 +297,17 @@ - - - - - - - - - - window - - - - + kn::TextureCachecreate kn::TextureCachegetCache kn::TextureCachegetTexture kn::TextureCacheload kn::TextureCachemove - kn::TextureCacheTextureCache + kn::TextureCacheTextureCache kn::TextureCachetextures kn::TextureCacheunload kn::TextureCacheunloadAll - kn::TextureCachewindow kn::TextureCache~TextureCache diff --git a/docs/source/xml/classkn_1_1_tile_map.xml b/docs/source/xml/classkn_1_1_tile_map.xml index 4ab6881..c019b95 100644 --- a/docs/source/xml/classkn_1_1_tile_map.xml +++ b/docs/source/xml/classkn_1_1_tile_map.xml @@ -10,13 +10,14 @@ window kn::TileMap::window + = RenderWindow::getInstance() - + tmx::Map @@ -30,7 +31,7 @@ - + std::vector< Tile > @@ -44,7 +45,7 @@ - + std::vector< Object > @@ -58,7 +59,7 @@ - + std::map< int, std::shared_ptr< Texture > > @@ -72,20 +73,16 @@ - + - + kn::TileMap::TileMap - (RenderWindow &window, TextureCache &textureCache, const std::string &tmxPath) + (TextureCache &textureCache, const std::string &tmxPath) TileMap kn::TileMap::TileMap - - RenderWindow & - window - TextureCache & textureCache @@ -100,14 +97,6 @@ -window - - -The window to render to. - - - - textureCache @@ -127,7 +116,7 @@ - + @@ -141,7 +130,7 @@ - + void @@ -156,7 +145,7 @@ - + void @@ -171,7 +160,7 @@ - + void @@ -186,7 +175,7 @@ - + const std::vector< Object > & @@ -204,7 +193,7 @@ - + @@ -225,7 +214,7 @@ - + kn::TileMapdrawAll kn::TileMapdrawObjects @@ -233,7 +222,7 @@ kn::TileMapgetObjects kn::TileMapm_map kn::TileMapobjectVec - kn::TileMapTileMap + kn::TileMapTileMap kn::TileMaptileSetMap kn::TileMaptileVec kn::TileMapwindow diff --git a/docs/source/xml/index.xml b/docs/source/xml/index.xml index e201bc0..19c6d29 100644 --- a/docs/source/xml/index.xml +++ b/docs/source/xml/index.xml @@ -22,21 +22,20 @@ direction velocity moveAndCollide - Entity + Entity ~Entity getTexture kn::Font - window font - Font + Font ~Font render kn::Object name type - Object + Object ~Object kn::Rect @@ -115,9 +114,8 @@ query kn::TextureCache - window textures - TextureCache + TextureCache ~TextureCache load create @@ -140,7 +138,7 @@ tileVec objectVec tileSetMap - TileMap + TileMap ~TileMap drawTiles drawObjects @@ -172,7 +170,7 @@ GRAVITY kn::draw - rect + rect kn::input getMousePos diff --git a/docs/source/xml/namespacekn.xml b/docs/source/xml/namespacekn.xml index 4576293..c976f2d 100644 --- a/docs/source/xml/namespacekn.xml +++ b/docs/source/xml/namespacekn.xml @@ -54,6 +54,6 @@ - + diff --git a/docs/source/xml/namespacekn_1_1draw.xml b/docs/source/xml/namespacekn_1_1draw.xml index 1ae4f84..0c4c006 100644 --- a/docs/source/xml/namespacekn_1_1draw.xml +++ b/docs/source/xml/namespacekn_1_1draw.xml @@ -3,16 +3,12 @@ kn::draw - + void void kn::draw::rect - (RenderWindow &window, Rect &rect, const SDL_Color color, int thickness=0) + (Rect &rect, const SDL_Color color, int thickness=0) rect kn::draw::rect - - RenderWindow & - window - Rect & rect @@ -32,14 +28,6 @@ -window - - -Reference to the RenderWindow instance. - - - - rect @@ -69,13 +57,13 @@ - + - + diff --git a/docs/source/xml/structkn_1_1_object.xml b/docs/source/xml/structkn_1_1_object.xml index 80a6c07..f746bb9 100644 --- a/docs/source/xml/structkn_1_1_object.xml +++ b/docs/source/xml/structkn_1_1_object.xml @@ -35,10 +35,10 @@ - + kn::Object::Object - (std::shared_ptr< Texture > texture, Rect crop, Rect rect, std::string name, std::string type) + (std::shared_ptr< Texture > texture, Rect crop, Rect rect, const std::string &name, const std::string &type) Object kn::Object::Object @@ -54,11 +54,11 @@ rect - std::string + const std::string & name - std::string + const std::string & type @@ -176,7 +176,7 @@ kn::Objectcrop kn::Objectname - kn::ObjectObject + kn::ObjectObject kn::Objectrect kn::Objecttexture kn::ObjectTile diff --git a/include/Draw.hpp b/include/Draw.hpp index 7e6e489..6172a2f 100644 --- a/include/Draw.hpp +++ b/include/Draw.hpp @@ -2,7 +2,6 @@ #include -#include "RenderWindow.hpp" #include "Rect.hpp" namespace kn @@ -13,14 +12,13 @@ namespace draw /** * @brief Draw a rectangle. * - * @param window Reference to the RenderWindow instance. * @param rect The rectangle to draw. * @param color The color of the rectangle. * @param thickness The thickness of the rectangle. * * @note If thickness remains 0, the rectangle will be filled. */ -void rect(RenderWindow &window, Rect &rect, const SDL_Color color, int thickness = 0); +void rect(Rect &rect, const SDL_Color color, int thickness = 0); } } \ No newline at end of file diff --git a/include/Entity.hpp b/include/Entity.hpp index 520f1c6..c92fc3f 100644 --- a/include/Entity.hpp +++ b/include/Entity.hpp @@ -19,7 +19,7 @@ namespace kn class Entity { protected: - RenderWindow &window; + RenderWindow &window = RenderWindow::getInstance(); std::shared_ptr texture; bool onGround = false; @@ -92,10 +92,9 @@ class Entity /** * @brief Create a entity. * - * @param window The renderer context. * @param texture The texture of the entity. */ - Entity(RenderWindow &window, std::shared_ptr texture); + Entity(std::shared_ptr texture); ~Entity() = default; /** diff --git a/include/Font.hpp b/include/Font.hpp index 1efd1be..2b1fce7 100644 --- a/include/Font.hpp +++ b/include/Font.hpp @@ -7,7 +7,6 @@ #include #include "Texture.hpp" -#include "RenderWindow.hpp" namespace kn { @@ -21,11 +20,10 @@ class Font final /** * @brief Create a font. * - * @param window The renderer context. * @param fileDir The directory of the font file. * @param ptSize The point size of the font. */ - Font(RenderWindow &window, const std::string &fileDir, int ptSize); + Font(const std::string &fileDir, int ptSize); ~Font() { if (font) @@ -45,7 +43,6 @@ class Font final std::shared_ptr render(const std::string &text, bool antialias, SDL_Color color, int wrapLength = 0); private: - RenderWindow &window; TTF_Font *font; }; diff --git a/include/KrakenEngine.hpp b/include/KrakenEngine.hpp index af118b2..a3c7495 100644 --- a/include/KrakenEngine.hpp +++ b/include/KrakenEngine.hpp @@ -3,13 +3,13 @@ #include "Constants.hpp" #include "Draw.hpp" +#include "Entity.hpp" #include "Font.hpp" #include "Globals.hpp" #include "Input.hpp" #include "Math.hpp" #include "Rect.hpp" #include "RenderWindow.hpp" -#include "Entity.hpp" #include "Texture.hpp" #include "TextureCache.hpp" #include "TileMap.hpp" diff --git a/include/TextureCache.hpp b/include/TextureCache.hpp index f448436..24db17e 100644 --- a/include/TextureCache.hpp +++ b/include/TextureCache.hpp @@ -3,7 +3,6 @@ #include #include -#include "RenderWindow.hpp" #include "Texture.hpp" #include "Math.hpp" @@ -20,10 +19,8 @@ class TextureCache final public: /** * @brief Instantiate the texture cache. - * - * @param window The renderer context. */ - explicit TextureCache(RenderWindow &window) : window(window) {} + TextureCache() = default; ~TextureCache() { unloadAll(); } /** @@ -90,7 +87,6 @@ class TextureCache final std::shared_ptr getTexture(const std::string &name) const; private: - RenderWindow &window; std::map> textures; }; diff --git a/include/TileMap.hpp b/include/TileMap.hpp index a685cae..8ee57c4 100644 --- a/include/TileMap.hpp +++ b/include/TileMap.hpp @@ -23,11 +23,10 @@ class TileMap final /** * @brief Constructs a tile map from a TMX file. * - * @param window The window to render to. * @param textureCache The texture cache to use. * @param tmxPath The path to the TMX file. */ - TileMap(RenderWindow &window, TextureCache &textureCache, const std::string &tmxPath); + TileMap(TextureCache &textureCache, const std::string &tmxPath); ~TileMap() = default; /** @@ -53,7 +52,7 @@ class TileMap final const std::vector &getObjects() const; private: - RenderWindow &window; + RenderWindow &window = RenderWindow::getInstance(); tmx::Map m_map; std::vector tileVec; diff --git a/include/TileTypes.hpp b/include/TileTypes.hpp index e0289e3..fa4a3bf 100644 --- a/include/TileTypes.hpp +++ b/include/TileTypes.hpp @@ -45,7 +45,7 @@ struct Object final : public Tile * @param name The name of the object. * @param type The type of the object. */ - Object(std::shared_ptr texture, Rect crop, Rect rect, std::string name, std::string type) + Object(std::shared_ptr texture, Rect crop, Rect rect, const std::string &name, const std::string &type) : Tile(texture, crop, rect), name(name), type(type) {} ~Object() = default; diff --git a/src/draw.cpp b/src/draw.cpp index ef8f5bf..0446282 100644 --- a/src/draw.cpp +++ b/src/draw.cpp @@ -1,12 +1,14 @@ #include "../include/Draw.hpp" +#include "../include/RenderWindow.hpp" namespace kn { namespace draw { -void rect(RenderWindow &window, Rect &rect, const SDL_Color color, int thickness) +void rect(Rect &rect, const SDL_Color color, int thickness) { + RenderWindow &window = RenderWindow::getInstance(); SDL_SetRenderDrawColor(window.getRenderer(), color.r, color.g, color.b, color.a); if (thickness == 0) diff --git a/src/entity.cpp b/src/entity.cpp index 90db79b..bf6b753 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -5,8 +5,8 @@ namespace kn { -Entity::Entity(RenderWindow &window, std::shared_ptr texture) - : window(window), texture(texture), rect(texture->getRect()) +Entity::Entity(std::shared_ptr texture) + : texture(texture), rect(texture->getRect()) { crop.w = rect.w; crop.h = rect.h; diff --git a/src/font.cpp b/src/font.cpp index 7f980c1..8229a5e 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -1,12 +1,12 @@ #include #include "../include/Font.hpp" +#include "../include/RenderWindow.hpp" namespace kn { -Font::Font(RenderWindow &window, const std::string &fileDir, int ptSize) - : window(window) +Font::Font(const std::string &fileDir, int ptSize) { font = TTF_OpenFont(fileDir.c_str(), ptSize); if (!font) @@ -49,7 +49,7 @@ std::shared_ptr Font::render(const std::string &text, bool antialias, S exit(3); } - SDL_Texture *sdlTexture = SDL_CreateTextureFromSurface(window.getRenderer(), surface); + SDL_Texture *sdlTexture = SDL_CreateTextureFromSurface(RenderWindow::getInstance().getRenderer(), surface); if (sdlTexture == nullptr) { std::cerr << "Failed to create texture: " << SDL_GetError() << std::endl; diff --git a/src/texture_cache.cpp b/src/texture_cache.cpp index c9ae506..f8d517d 100644 --- a/src/texture_cache.cpp +++ b/src/texture_cache.cpp @@ -1,13 +1,14 @@ #include #include "../include/TextureCache.hpp" +#include "../include/RenderWindow.hpp" namespace kn { std::shared_ptr TextureCache::load(const std::string &name, const std::string &path) { - SDL_Texture *texture = IMG_LoadTexture(window.getRenderer(), path.c_str()); + SDL_Texture *texture = IMG_LoadTexture(RenderWindow::getInstance().getRenderer(), path.c_str()); if (!texture) { std::cerr << "Failed to create texture from: " << path << std::endl; @@ -32,7 +33,7 @@ std::shared_ptr TextureCache::create(const std::string &name, const mat SDL_FillRect(surface, nullptr, SDL_MapRGB(surface->format, color.r, color.g, color.b)); - SDL_Texture *texture = SDL_CreateTextureFromSurface(window.getRenderer(), surface); + SDL_Texture *texture = SDL_CreateTextureFromSurface(RenderWindow::getInstance().getRenderer(), surface); if (!texture) { std::cerr << "Failed to create texture from surface: " << name << std::endl; diff --git a/src/tile_map.cpp b/src/tile_map.cpp index 4fda8f3..dc889c8 100644 --- a/src/tile_map.cpp +++ b/src/tile_map.cpp @@ -8,8 +8,7 @@ namespace kn { -TileMap::TileMap(RenderWindow &window, TextureCache &textureCache, const std::string &tmxPath) - : window(window) +TileMap::TileMap(TextureCache &textureCache, const std::string &tmxPath) { if (!m_map.load(tmxPath)) { @@ -22,7 +21,7 @@ TileMap::TileMap(RenderWindow &window, TextureCache &textureCache, const std::st int tileWidth = m_map.getTileSize().x; int tileHeight = m_map.getTileSize().y; - auto &tileSets = m_map.getTilesets(); + const auto &tileSets = m_map.getTilesets(); for (const auto &set : tileSets) { auto tex = textureCache.load("tileset", set.getImagePath()); @@ -30,7 +29,7 @@ TileMap::TileMap(RenderWindow &window, TextureCache &textureCache, const std::st textureCache.unload("tileset"); } - auto &layers = m_map.getLayers(); + const auto &layers = m_map.getLayers(); for (const auto &layer : layers) { if (layer->getType() == tmx::Layer::Type::Object) @@ -43,12 +42,13 @@ TileMap::TileMap(RenderWindow &window, TextureCache &textureCache, const std::st int currentGID = obj.getTileID(); int tileSetGID = -1; - for (const auto &tileSet : tileSetMap) - if (currentGID >= tileSet.first) - { - tileSetGID = tileSet.first; - break; - } + auto it = std::find_if( + tileSetMap.rbegin(), tileSetMap.rend(), [currentGID](const auto &tileSet) + { return currentGID >= tileSet.first; }); + if (it != tileSetMap.rend()) + { + tileSetGID = it->first; + } if (tileSetGID == -1) continue; @@ -82,12 +82,13 @@ TileMap::TileMap(RenderWindow &window, TextureCache &textureCache, const std::st continue; int tileSetGID = -1; - for (const auto &tileSet : tileSetMap) - if (currentGID >= tileSet.first) - { - tileSetGID = tileSet.first; - break; - } + auto it = std::find_if( + tileSetMap.rbegin(), tileSetMap.rend(), [currentGID](const auto &tileSet) + { return currentGID >= tileSet.first; }); + if (it != tileSetMap.rend()) + { + tileSetGID = it->first; + } if (tileSetGID == -1) continue;