5 * Copyright (c) 2016 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/property-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 PropertyBuffer
50 * Model file is multi-architecture so can be loaded on little and big endian architectures
57 * Creates an instance of GameModel and loads the '.mod' file
58 * @param[in] filename Name of file to load
60 GameModel( const char* filename );
63 * Destroys an instance of GameModel
68 * Returns DALi geometry object
69 * @return Returns DALi geometry object
71 Dali::Geometry& GetGeometry();
74 * Checks status of model, returns false if failed to load
75 * @return true if model has been loaded, false otherwise
80 * Returns unique Id of the texture
83 uint32_t GetUniqueId();
87 Dali::Geometry mGeometry;
88 Dali::PropertyBuffer mVertexBuffer;