]>
Dogcows Code - chaz/yoink/blob - src/moof/backend.cc
2dd199d216c846d11b0517f87c4e9a9fcc762d46
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
15 #include "fastevents.h"
26 static bool is_initialized
;
27 static int retain_count
;
30 bool impl::is_initialized
= false;
31 int impl::retain_count
= 0;
36 if (impl::retain_count
++ == 0)
39 if (SDL_Init(SDL_INIT_VIDEO
| SDL_INIT_TIMER
) != 0)
41 if (SDL_Init(SDL_INIT_VIDEO
| SDL_INIT_EVENTTHREAD
) != 0)
44 throw std::runtime_error(SDL_GetError());
49 SDL_VideoDriverName(name
, sizeof(name
));
50 log_info
<< "initialized SDL; using video driver `"
51 << name
<< "'" << std::endl
;
56 throw std::runtime_error(FE_GetError());
60 impl::is_initialized
= true;
63 backend::backend(const backend
& backend
)
68 backend
& backend::operator=(const backend
& backend
)
76 if (--impl::retain_count
== 0)
78 log_info("shutting down SDL...");
82 impl::is_initialized
= false;
86 bool backend::is_initialized()
88 return impl::is_initialized
;
This page took 0.038739 seconds and 3 git commands to generate.