| 38 | #include <assert.h> |
| 39 | |
| 40 | void verify() { |
| 41 | int width = 640, height = 480; |
| 42 | unsigned char *data = (unsigned char*)malloc(width*height*4); |
| 43 | glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); |
| 44 | int sum = 0; |
| 45 | for (int x = 0; x < width*height*4; x++) { |
| 46 | if (x % 4 != 3) sum += x * data[x]; |
| 47 | } |
| 48 | #ifdef __EMSCRIPTEN__ |
| 49 | REPORT_RESULT(sum); |
| 50 | #endif |
| 51 | } |
| 52 | |
| 53 | int main(int argc, char *argv[]) { |
| 54 | SDL_Surface *screen; |