5 * Copyright (c) 2020 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <dali/public-api/rendering/geometry.h>
22 #include <dali/public-api/rendering/vertex-buffer.h>
27 * @brief The ModelHeader struct
28 * Model file header structure
32 uint32_t tag; /// 'MODV' tag
33 uint32_t version; /// File version
34 uint32_t vertexBufferSize; /// total size of the vertex buffer to allocate
35 uint32_t attributeCount; /// number of stored attributes
36 uint32_t attributeFormat[16]; /// format encoded as ((type << 16)|(count)); 'type' represents primitive type, 'count' represents number of components ( 1-4 )
37 uint32_t attributeOffset[16]; /// attribute offsets
38 uint32_t attributeSize[16]; /// attribute size in bytes
39 uint32_t vertexStride; /// vertex stride
40 uint32_t reserved; /// reserved, may point at additional structure
41 uint32_t dataBeginOffset; /// start of actual vertex data
45 * @brief The GameModel class
46 * GameModel represents model geometry. It loads model data from external model file ( .mod file ).
47 * Such data is ready to be used as GL buffer so it can be copied directly into the VertexBuffer
50 * Model file is multi-architecture so can be loaded on little and big endian architectures
56 * Creates an instance of GameModel and loads the '.mod' file
57 * @param[in] filename Name of file to load
59 GameModel(const char* filename);
62 * Destroys an instance of GameModel
67 * Returns DALi geometry object
68 * @return Returns DALi geometry object
70 Dali::Geometry& GetGeometry();
73 * Checks status of model, returns false if failed to load
74 * @return true if model has been loaded, false otherwise
79 * Returns unique Id of the texture
82 uint32_t GetUniqueId();
85 Dali::Geometry mGeometry;
86 Dali::VertexBuffer mVertexBuffer;