Chesto
0.9
A declarative and element-based library for creating GUIs on homebrew'd consoles
src
NetImageElement.hpp
1
#pragma once
2
3
#include <string>
4
#include <functional>
5
#include "Texture.hpp"
6
#include "DownloadQueue.hpp"
7
8
class
NetImageElement
:
public
Texture
9
{
10
public
:
18
NetImageElement
(
const
char
*url, std::function<
Texture
*(
void
)> getImageFallback = NULL,
bool
immediateLoad =
true
);
19
~NetImageElement
();
20
22
void
fetch
();
23
25
void
render
(
Element
*
parent
);
26
bool
loaded =
false
;
27
bool
updateSizeAfterLoad =
false
;
28
29
private
:
30
void
imgDownloadComplete(
DownloadOperation
*download);
31
32
DownloadOperation
*imgDownload =
nullptr
;
33
Texture
*imgFallback =
nullptr
;
34
bool
downloadStarted =
false
;
35
};
Element
Definition:
Element.hpp:32
Element::parent
Element * parent
the parent element (can sometimes be null if it isn't set)
Definition:
Element.hpp:102
NetImageElement
Definition:
NetImageElement.hpp:9
NetImageElement::render
void render(Element *parent)
Render the image.
Definition:
NetImageElement.cpp:81
NetImageElement::NetImageElement
NetImageElement(const char *url, std::function< Texture *(void)> getImageFallback=NULL, bool immediateLoad=true)
Creates a new image element, downloading the image from url If the url is not cached,...
Definition:
NetImageElement.cpp:3
NetImageElement::fetch
void fetch()
Start downloading the image (called in the constructor unless immediateLoad is false)
Definition:
NetImageElement.cpp:43
Texture
Definition:
Texture.hpp:24
DownloadOperation
Definition:
DownloadQueue.hpp:27
Generated by
1.9.4