neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
sprite.hpp
Go to the documentation of this file.
1// sprite.hpp
2/*
3neogfx C++ App/Game Engine
4Copyright (c) 2018, 2020 Leigh Johnston. All Rights Reserved.
5
6This program is free software: you can redistribute it and / or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <neogfx/neogfx.hpp>
23#include <neolib/core/uuid.hpp>
26
27namespace neogfx::game
28{
29 struct sprite
30 {
32
34 {
35 static const neolib::uuid& id()
36 {
37 static const neolib::uuid sId = { 0xd61d920b, 0xde71, 0x400d, 0x9532, { 0x3b, 0x76, 0x1f, 0x26, 0x65, 0x56 } };
38 return sId;
39 }
40 static const i_string& name()
41 {
42 static const string sName = "Sprite";
43 return sName;
44 }
45 static uint32_t field_count()
46 {
47 return 1;
48 }
49 static component_data_field_type field_type(uint32_t aFieldIndex)
50 {
51 switch (aFieldIndex)
52 {
53 case 0:
54 return component_data_field_type::Vec3 | component_data_field_type::Array;
55 default:
56 throw invalid_field_index();
57 }
58 }
59 static const i_string& field_name(uint32_t aFieldIndex)
60 {
61 static const string sFieldNames[] =
62 {
63 "Path"
64 };
65 return sFieldNames[aFieldIndex];
66 }
67 };
68 };
69}
vec3_list vertices
static uint32_t field_count()
Definition sprite.hpp:45
static const neolib::uuid & id()
Definition sprite.hpp:35
static component_data_field_type field_type(uint32_t aFieldIndex)
Definition sprite.hpp:49
static const i_string & name()
Definition sprite.hpp:40
static const i_string & field_name(uint32_t aFieldIndex)
Definition sprite.hpp:59