21 #include "../../SDL_internal.h" 23 #if SDL_VIDEO_DRIVER_EMSCRIPTEN 35 Uint32 Rmask, Gmask, Bmask, Amask;
53 *format = surface_format;
55 *pitch = surface->
pitch;
66 return SDL_SetError(
"Couldn't find framebuffer surface for window");
73 var ctx = Module[
'canvas'].getContext(
'2d');
76 var
image = ctx.createImageData($0, $1);
77 var data = image.data;
82 if (typeof CanvasPixelArray !==
'undefined' && data instanceof CanvasPixelArray) {
90 data[
dst ] = val & 0xff;
91 data[dst+1] = (val >> 8) & 0xff;
92 data[dst+2] = (val >> 16) & 0xff;
93 data[dst+3] = isScreen ? 0xff : ((val >> 24) & 0xff);
98 var data32 =
new Uint32Array(data.buffer);
103 data32[dst++] = HEAP32[src++] | 0xff000000;
107 data32[dst++] = HEAP32[src++];
112 ctx.putImageData(image, 0, 0);
114 }, surface->
w, surface->
h, surface->
pixels);
uint32_t Uint32
An unsigned 32-bit integer type.
A collection of pixels used in software blitting.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
void Emscripten_DestroyWindowFramebuffer(_THIS, SDL_Window *window)
#define SDL_GetWindowSize
int Emscripten_CreateWindowFramebuffer(_THIS, SDL_Window *window, Uint32 *format, void **pixels, int *pitch)
#define SDL_PixelFormatEnumToMasks
#define SDL_CreateRGBSurface
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
The type used to identify a window.
SDL_Rect rects[MAX_RECTS]
GLubyte GLubyte GLubyte GLubyte w
int Emscripten_UpdateWindowFramebuffer(_THIS, SDL_Window *window, const SDL_Rect *rects, int numrects)
GLfloat GLfloat GLfloat GLfloat h
A rectangle, with the origin at the upper left.