Mondschein Engine  0.3.0
mondschein_sdl.cpp
1 /* Mondschein Engine is a fast, powerful, and easy-to-use 3D realtime rendering engine.
2  *
3  * Copyright (C) 2009-2013 by Andreas Amereller
4  * E-Mail: andreas.amereller.dev@googlemail.com
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License as published by the Free
8  * Software Foundation; either version 3 of the License, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 #include "sdl_types.h"
22 #include "sdl/visual.h"
23 
24 using namespace mondschein;
25 
26 SDL_Factory::SDL_Factory()
27 {
28  return;
29 }
30 
31 SDL_Factory::~SDL_Factory()
32 {
33  return;
34 }
35 
36 display::SDL_Visual_p SDL_Factory::create_sdl_visual()
37 {
38  display::SDL_Visual_p v(new display::SDL_Visual());
39  Engine::init(renderer::Context_p(v));
40  Engine::init(display::Visual_p(v));
41  return v;
42 }
43 
44 display::SDL_Visual_p SDL_Factory::create_sdl_visual(uint32 _w,uint32 _h,uint32 _bpp,bool _fs,
45  Eigen::Vector4i _cd,Eigen::Vector4i _ad,int32 _dbs,int32 _sbs,
46  bool _db,bool _init)
47 {
48  display::SDL_Visual_p v(new display::SDL_Visual(display::visual_attribs_t(_w,_h,_bpp,_fs),
49  renderer::context_attribs_t(_cd,_ad,_dbs,_sbs,_db)));
50  if (_init) v->init();
51  Engine::init(renderer::Context_p(v));
52  Engine::init(display::Visual_p(v));
53  return v;
54 }