]>
Dogcows Code - chaz/yoink/blob - src/Moof/Backend.cc
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 **************************************************************************/
13 #include "fastevents.h"
26 static int retainCount
;
29 Error
Impl::error(Error::UNINITIALIZED
);
30 int Impl::retainCount
= 0;
35 if (Impl::retainCount
++ == 0)
38 if (SDL_Init(SDL_INIT_VIDEO
| SDL_INIT_TIMER
) != 0)
40 if (SDL_Init(SDL_INIT_VIDEO
| SDL_INIT_EVENTTHREAD
) != 0)
43 const char* error
= SDL_GetError();
44 Impl::error
.init(Error::SDL_INIT
, error
);
50 SDL_VideoDriverName(name
, sizeof(name
));
51 logInfo
<< "initialized SDL; using video driver `"
52 << name
<< "'" << std::endl
;
57 const char* error
= FE_GetError();
58 Impl::error
.init(Error::FASTEVENTS_INIT
, error
);
62 Impl::error
.init(Error::NONE
);
66 Backend::Backend(const Backend
& backend
)
73 if (--Impl::retainCount
== 0)
82 bool Backend::isInitialized()
84 return Impl::error
.code() == Error::NONE
;
87 const Error
& Backend::getError()
This page took 0.035592 seconds and 4 git commands to generate.