Simulant  21.12-246
A portable game engine for Windows, OSX, Linux, Dreamcast, and PSP
ogg_loader.h
1 /* * Copyright (c) 2011-2017 Luke Benstead https://simulant-engine.appspot.com
2  *
3  * This file is part of Simulant.
4  *
5  * Simulant is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * Simulant is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with Simulant. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef OGG_LOADER_H
20 #define OGG_LOADER_H
21 
22 #include <map>
23 #include <vector>
24 #include "../types.h"
25 #include "../loader.h"
26 
27 namespace smlt {
28 namespace loaders {
29 
30 class OGGLoader : public Loader {
31 public:
32  OGGLoader(const Path& filename, std::shared_ptr<std::istream> data):
33  Loader(filename, data) {}
34 
35  void into(Loadable& resource, const LoaderOptions &options=LoaderOptions());
36 
37 };
38 
39 class OGGLoaderType : public LoaderType {
40 public:
41  const char* name() { return "ogg"; }
42  bool supports(const Path& filename) const {
43  //FIXME: check magic
44  return filename.ext() == ".ogg";
45  }
46 
47  Loader::ptr loader_for(const Path& filename, std::shared_ptr<std::istream> data) const {
48  return Loader::ptr(new OGGLoader(filename, data));
49  }
50 };
51 
52 
53 }
54 }
55 
56 #endif // OGG_LOADER_H
smlt::loaders::OGGLoader
Definition: ogg_loader.h:30
smlt
Definition: animation.cpp:25
smlt::LoaderType
Definition: loader.h:111
smlt::Loader
Definition: loader.h:66
smlt::loaders::OGGLoaderType
Definition: ogg_loader.h:39
smlt::Path
Definition: path.h:7
smlt::Loadable
Definition: loadable.h:26