]>
Dogcows Code - chaz/yoink/blob - src/moof/backend.cc
fa3ad3102ab546a9cc630f49ff3d4a8a2fcb046b
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
8 *****************************************************************************/
17 #include "fastevents.h"
26 static int retain_count
= 0;
30 if (retain_count
++ == 0)
33 if (SDL_Init(SDL_INIT_VIDEO
| SDL_INIT_TIMER
) != 0)
35 if (SDL_Init(SDL_INIT_VIDEO
| SDL_INIT_EVENTTHREAD
) != 0)
38 throw std::runtime_error(SDL_GetError());
43 SDL_VideoDriverName(name
, sizeof(name
));
44 log_info
<< "initialized SDL; using video driver `" <<
45 name
<< "'" << std::endl
;
49 throw std::runtime_error(FE_GetError());
54 backend::backend(const backend
& backend
)
59 backend
& backend::operator = (const backend
& backend
)
67 if (--retain_count
== 0)
69 log_info("shutting down SDL...");
75 bool backend::is_initialized()
77 return 0 < retain_count
;
This page took 0.037556 seconds and 4 git commands to generate.