+ m_surface.x = m_screen->w;
+ m_surface.y = m_screen->h;
+ m_surface.bpp = m_screen->format->BitsPerPixel;
+ m_surface.bypp = m_screen->format->BytesPerPixel;
+ m_surface.stride = m_screen->pitch;
+ m_surface.data = m_screen->pixels;
+
+ SDL_EnableUNICODE(1);
+}
+
+void gSDLDC::evFlip()
+{
+ SDL_Flip(m_screen);
+}
+
+void gSDLDC::thread()
+{
+ hasStarted();
+
+ bool stop = false;
+ while (!stop) {
+ SDL_Event event;
+ if (SDL_WaitEvent(&event)) {
+ switch (event.type) {
+ case SDL_KEYDOWN:
+ case SDL_KEYUP:
+ case SDL_QUIT:
+ m_pump.send(event);
+ break;
+ case SDL_USEREVENT:
+ switch (event.user.code) {
+ case EV_SET_VIDEO_MODE:
+ evSetVideoMode((unsigned long)event.user.data1, (unsigned long)event.user.data2);
+ break;
+ case EV_FLIP:
+ evFlip();
+ break;
+ case EV_QUIT:
+ stop = true;
+ break;
+ }
+ break;
+ }
+ }
+ }
+}
+
+eAutoInitPtr<gSDLDC> init_gSDLDC(eAutoInitNumbers::graphic-1, "gSDLDC");