20 enum class ImageId : int {
99 bool mInitialized{
false};
102 int mNextImageId{
static_cast<int>(ImageId::DynamicIdStart)};
105 std::map<ImageId,gm::Texture> mImageMap{};
111 template<
typename Iterator>
113 while (first != last) {
114 createIcon(context, *first);
122 void createSquareCorners(
gm::Context &context,
int radius,
int borderWidth,
126 void createRoundCorners(
gm::Context &context,
int scale,
int radius,
int borderWidth,
130 void createCenters(
gm::Context &context,
int scale,
int radius);
152 if (!store.mInitialized) {
154 store.mInitialized =
true;
161 return static_cast<ImageId
>(mNextImageId++);
165 void setImage(ImageId imageId,
gm::Texture &&texture);
169 return mImageMap.find(imageId) != mImageMap.end();
181 auto image = mImageMap.find(imageId);
182 if (image != mImageMap.end()) {
183 size = image->second.getSize();
197 if (
auto image = mImageMap.find(imageId); image != mImageMap.end())
198 return context.
renderCopy(image->second, dst);
211 if (
auto image = mImageMap.find(imageId); image != mImageMap.end())
212 return context.
renderCopy(image->second, src, dst);
227 if (
auto image = mImageMap.find(imageId); image != mImageMap.end())
228 return context.
renderCopyEx(image->second, src, dst, angle, flip);
Sheet of square corners beveled in.
Definition: Constants.h:220
int renderCopyEx(Texture &texture, Rectangle src, Rectangle dst, double angle, RenderFlip renderFlip, std::optional< Position< int >> point=std::nullopt) const
Render with extensions.
Definition: GraphicsModel.cpp:94
Center for the round corners in red hue.
Definition: Constants.h:215
void initialize(gm::Context &context)
Initialize the ImageStore.
Definition: ImageStore.cpp:99
The information required to create an Icon from the Entypo Font.
Definition: ImageStore.h:86
ImageId nextImageId()
Get the next dyname ImageId.
Definition: ImageStore.h:160
int renderCopy(gm::Context &context, ImageId imageId, Rectangle dst)
Render the Texture associated with an Image Id.
Definition: ImageStore.h:196
Red Green Blue Alpha representation of a color.
Definition: Color.h:64
Center for the square corners in theme invert color.
Definition: Constants.h:224
Sheet of square corners notched out.
Definition: Constants.h:221
Center for the round corners in yellow hue.
Definition: Constants.h:218
Center for the square corners in theme base color.
Definition: Constants.h:223
Definition: ImageStore.h:96
Sheet of round corners notched out.
Definition: Constants.h:211
Sheet of round corners beveled in.
Definition: Constants.h:210
void createIcons(gm::Context &context, Iterator first, Iterator last)
Create many Icons using a container of IconImage structures.
Definition: ImageStore.h:112
Sheet of round corners beveled out.
Definition: Constants.h:209
Center for the round corners in theme invert color.
Definition: Constants.h:214
Sheet of round corners notched in.
Definition: Constants.h:212
int renderCopy(const Texture &texture)
Copy a Texture to the current render target using the size of the Texture and the size of the target...
Definition: GraphicsModel.cpp:80
Abstraction of SDL_Texture.
Definition: Texture.h:46
Context
Definition: GraphicsModel.h:76
static ImageStore & getStore(gm::Context &context)
Get access to, and initialize, the Singleton ImageStore.
Definition: ImageStore.h:150
Sheet of square corners beveled out.
Definition: Constants.h:219
Abstraction of the graphics model.
static ImageStore & getStore()
Get access to the Singleton ImageStore.
Definition: ImageStore.h:138
Size size(ImageId imageId)
Get the size of the Texture associated with an ImageId.
Definition: ImageStore.h:179
Center for the round corners in theme base color.
Definition: Constants.h:213
bool exists(ImageId imageId)
Test to see if a Texture is associated with an ImageId.
Definition: ImageStore.h:168
A composite of a Position and a Size.
Definition: Types.h:307
int renderCopy(gm::Context &context, ImageId imageId, Rectangle src, Rectangle dst)
Render the Texture associated with an Image Id.
Definition: ImageStore.h:210
Sheet of square corners notched in.
Definition: Constants.h:222
A size in integer dimensions.
Definition: Types.h:230
int renderCopyEx(gm::Context &context, ImageId imageId, Rectangle src, Rectangle dst, double angle, gm::RenderFlip flip)
Render the Texture associated with an Image Id with with optional rotation and flipping.
Definition: ImageStore.h:226
A Widget manipulator to indicate if and how rendering a texture should be flipped.
Definition: GraphicsModel.h:62
Center for the round corners in green hue.
Definition: Constants.h:216
ToDo: There is an issue that the initial scroll interaction is lost if the click/press lands on a Wid...
Definition: CelestialOverlay.cpp:13
Center for the round corners in blue hue.
Definition: Constants.h:217
This is a list of icon codes for the entypo.ttf font by Daniel Bruce.