YourGameLib
Loading...
Searching...
No Matches
include
toolbox
yourgame
gl
spritegrid.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2019-2024 Alexander Scholz
3
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
8
Permission is granted to anyone to use this software for any purpose,
9
including commercial applications, and to alter it and redistribute it
10
freely, subject to the following restrictions:
11
12
1. The origin of this software must not be misrepresented; you must not
13
claim that you wrote the original software. If you use this software
14
in a product, an acknowledgment in the product documentation would be
15
appreciated but is not required.
16
2. Altered source versions must be plainly marked as such, and must not be
17
misrepresented as being the original software.
18
3. This notice may not be removed or altered from any source distribution.
19
*/
20
#ifndef YOURGAME_GLSPRITEGRID_H
21
#define YOURGAME_GLSPRITEGRID_H
22
23
#include <string>
24
#include <vector>
25
#include "
yourgame/gl/geometry.h
"
26
#include "
yourgame/gl/texture.h
"
27
28
namespace
yourgame
29
{
30
namespace
gl
31
{
32
class
SpriteGrid
33
{
34
public
:
35
SpriteGrid
();
36
37
/* deleting the copy constructor and the copy assignment operator
38
prevents copying (and moving) of the object. */
39
SpriteGrid
(
SpriteGrid
const
&) =
delete
;
40
SpriteGrid
&
operator=
(
SpriteGrid
const
&) =
delete
;
41
42
~SpriteGrid
();
43
60
int
make
(
const
yourgame::gl::Texture
*atlas,
61
const
std::vector<std::string> &tiles,
62
unsigned
int
width,
63
float
gridWidth,
64
float
gridHeight);
65
67
Geometry
*
geo
()
const
{
return
m_geo; }
68
69
private
:
70
Geometry
*m_geo =
nullptr
;
71
};
72
}
// namespace gl
73
}
// namespace yourgame
74
75
#endif
yourgame::gl::Geometry
Definition
geometry.h:35
yourgame::gl::SpriteGrid
Definition
spritegrid.h:33
yourgame::gl::SpriteGrid::geo
Geometry * geo() const
Definition
spritegrid.h:67
yourgame::gl::SpriteGrid::SpriteGrid
SpriteGrid()
Definition
spritegrid.cpp:27
yourgame::gl::SpriteGrid::~SpriteGrid
~SpriteGrid()
Definition
spritegrid.cpp:202
yourgame::gl::SpriteGrid::SpriteGrid
SpriteGrid(SpriteGrid const &)=delete
yourgame::gl::SpriteGrid::operator=
SpriteGrid & operator=(SpriteGrid const &)=delete
yourgame::gl::SpriteGrid::make
int make(const yourgame::gl::Texture *atlas, const std::vector< std::string > &tiles, unsigned int width, float gridWidth, float gridHeight)
creates grid geometry in x-y plane (z = 0)
Definition
spritegrid.cpp:29
yourgame::gl::Texture
Definition
texture.h:69
geometry.h
yourgame
Definition
audio.h:27
texture.h
Generated by
1.9.8