24 #if defined(USE_OPENGL) && !defined(ANDROID)
31 #include "render/graphics.h"
34 #ifdef __native_client__
65 SDL_SWSURFACE, w, h, 32,
66 0x00ff0000U, 0x0000ff00U, 0x000000ffU, 0xff000000U);
68 if (tmpImage ==
nullptr)
74 mglReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->pixels);
76 const size_t lineSize = 3 * w;
77 GLubyte *
const buf =
new GLubyte[lineSize];
80 SDL_SWSURFACE, w, h, 24,
81 0xff0000, 0x00ff00, 0x0000ff, 0x000000);
91 SDL_SetSurfaceAlphaMod(tmpImage, SDL_ALPHA_OPAQUE);
92 SDL_SetSurfaceBlendMode(tmpImage, SDL_BLENDMODE_NONE);
96 SDL_SetAlpha(tmpImage, 0, SDL_ALPHA_OPAQUE);
102 SDL_BlitSurface(tmpImage,
nullptr,
screenshot,
nullptr);
106 const int h2 = h / 2;
107 for (
int i = 0; i < h2; i++)
109 GLubyte *
const top =
static_cast<GLubyte*
>(
111 GLubyte *
const bot =
static_cast<GLubyte*
>(
114 memcpy(buf,
top, lineSize);
115 memcpy(
top, bot, lineSize);
116 memcpy(bot, buf, lineSize);
bool getBoolValue(const std::string &key) const
static void deleteFBO(FBOInfo *const fbo)
static void createFBO(const int width, const int height, FBOInfo *const fbo)
MobileOpenGLScreenshotHelper()
SDL_Surface * getScreenshot()
~MobileOpenGLScreenshotHelper()
#define MSDL_CreateRGBSurface(flags, w, h, d, r, g, b, a)
#define MSDL_FreeSurface(surface)
const Image *restrict const top
GraphicsManager graphicsManager
#define mglReadPixels(...)
#define mglGetIntegerv(...)
#define mglPixelStorei(...)
bool screenshot(InputEvent &event)