VertexArrayObjectLoadStore.hh 2.38 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/***********************************************************************
 * Copyright 2011-2012 Computer Graphics Group RWTH Aachen University. *
 * All rights reserved.                                                *
 * Distributed under the terms of the MIT License (see LICENSE.TXT).   *
 **********************************************************************/

#pragma once

#include <ACGL/ACGL.hh>
#include <ACGL/OpenGL/Objects/VertexArrayObject.hh>

#include <string>

namespace ACGL{
namespace OpenGL{

17
18
19
20
21
22
///////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                               generic load/save
///////////////////////////////////////////////////////////////////////////////////////////////////

//! Loads geometry data from a file and attaches the loaded array buffer data to a VertexArrayObject
//! Tries to guess the file format from the file extension
23
24
SharedVertexArrayObject loadVertexArrayObject(const std::string& _filename);

25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
///////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                           library specific load
///////////////////////////////////////////////////////////////////////////////////////////////////

//! Loads a VertexArrayObject from the ACGL binary VAO format, as specified here:
//! http://www.graphics.rwth-aachen.de/redmine/projects/acgl/wiki/Vao_File_Format
//! A VAO file can contain several named EABs. Only the EAB whose name matches _eabName will be loaded
//! and attached to the VAO. If _eabName is left blank, the first defined EAB will be used.
SharedVertexArrayObject loadVertexArrayObjectVAO(const std::string& _filename, const std::string& _eabName = "");

///////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                           library specific save
///////////////////////////////////////////////////////////////////////////////////////////////////

//! Stores a VertexArrayObject in a file using the ACGL binary VAO format
//! Each attached ArrayBuffer will be stored entirely in the VAO file but only those attributes which
//! are used by _vao will be defined.
bool saveVertexArrayObjectToVAO(ConstSharedVertexArrayObject _vao, const std::string& _filename);

44
45
}
}