ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
Loading...
Searching...
No Matches
AtlasImage.h
Go to the documentation of this file.
1/*
2 * ObjectivelyMVC: Object oriented MVC framework for SDL3 and C.
3 * Copyright (C) 2014 Jay Dolan <jay@jaydolan.com>
4 * This software is provided 'as-is', without any express or implied
5 * warranty. In no event will the authors be held liable for any damages
6 * arising from the use of this software.
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 * 1. The origin of this software must not be misrepresented; you must not
11 * claim that you wrote the original software. If you use this software
12 * in a product, an acknowledgment in the product documentation would be
13 * appreciated but is not required.
14 * 2. Altered source versions must be plainly marked as such, and must not be
15 * misrepresented as being the original software.
16 */
17
18
19#pragma once
20
22
28typedef struct ImageAtlas ImageAtlas;
29
30typedef struct AtlasImage AtlasImage;
31typedef struct AtlasImageInterface AtlasImageInterface;
32
41struct AtlasImage {
42
47
52 AtlasImageInterface *interface[0];
53
60
66 SDL_Rect rect;
67};
68
72struct AtlasImageInterface {
73
77 ImageInterface imageInterface;
78
89 AtlasImage *(*initWithImage)(AtlasImage *self, ImageAtlas *atlas, Image *image);
90
99 SDL_FRect (*texcoords)(const AtlasImage *self);
100};
101
OBJECTIVELYMVC_EXPORT Class * _AtlasImage(void)
Definition AtlasImage.c:84
Image loading.
static Image * image(Theme *self, const char *name, float pixelDensity)
Definition Theme.c:82
#define OBJECTIVELYMVC_EXPORT
Definition Types.h:40
An Image packed into an ImageAtlas.
Definition AtlasImage.h:41
AtlasImageInterface * interface[0]
The interface type.
Definition AtlasImage.h:52
SDL_Rect rect
This AtlasImage's rectangle within the atlas sheet, in texels.
Definition AtlasImage.h:66
Image image
The superclass.
Definition AtlasImage.h:46
ImageAtlas * atlas
The ImageAtlas this AtlasImage belongs to, or NULL once that atlas has been released,...
Definition AtlasImage.h:59
Packs many Images into one sheet, backed by one Texture.
Definition ImageAtlas.h:49
Image loading.
Definition Image.h:41