File: test_override_system_js_lib_symbol.c

package info (click to toggle)
emscripten 3.1.69%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 121,872 kB
  • sloc: ansic: 636,110; cpp: 425,974; javascript: 78,401; python: 58,404; sh: 49,154; pascal: 5,237; makefile: 3,365; asm: 2,415; lisp: 1,869
file content (21 lines) | stat: -rw-r--r-- 654 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <emscripten.h>
#include <emscripten/html5.h>
#include <assert.h>
#include <GLES3/gl3.h>
#include <stdio.h>

GLuint what_got_created(void);

int main() {
  EmscriptenWebGLContextAttributes attrs;
  emscripten_webgl_init_context_attributes(&attrs);
  attrs.majorVersion = 2;
  emscripten_webgl_make_context_current(emscripten_webgl_create_context("canvas", &attrs));

  GLuint createType = GL_UNSIGNED_BYTE;
  glTexImage3D(GL_TEXTURE_3D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, createType, 0);
  GLuint whatGotCreated = what_got_created();
  printf("Created texture of type 0x%x\n", whatGotCreated);
  assert(createType == whatGotCreated);
  return 0;
}