/*1* Copyright 2017 The Emscripten Authors. All rights reserved.2* Emscripten is available under two separate licenses, the MIT license and the3* University of Illinois/NCSA Open Source License. Both these licenses can be4* found in the LICENSE file.5*/67#include <assert.h>8#include <GL/gl.h>9#include <stdio.h>10#include <string.h>11#include "SDL/SDL.h"1213int main() {14SDL_Surface *screen;1516assert(SDL_Init(SDL_INIT_VIDEO) == 0);17SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);18screen = SDL_SetVideoMode( 256, 256, 16, SDL_OPENGL );19assert(screen);2021// glGetError again should return 0 initially22assert(glGetError() == 0);2324// pop from empty stack, causing an underflow error25glPopMatrix();26GLenum err = glGetError();27printf("glGetError -> %d\n", err);28assert(err == GL_STACK_UNDERFLOW);2930// Calling glGetError again should report no error.31assert(glGetError() == 0);3233return 0;34}353637