diff options
author | mattkae <mattkae@protonmail.com> | 2022-05-01 18:37:59 -0400 |
---|---|---|
committer | mattkae <mattkae@protonmail.com> | 2022-05-01 18:37:59 -0400 |
commit | dfc387644939aada1edb69f8f730e62f116f1ae3 (patch) | |
tree | d38b17d0b21fd579f1330546394462964a08600e /themes/WebglContext.h~ | |
parent | 1db914466663a1e4d0d827b8b9bd18840d7742eb (diff) |
Fetching bunny model
Diffstat (limited to 'themes/WebglContext.h~')
-rw-r--r-- | themes/WebglContext.h~ | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/themes/WebglContext.h~ b/themes/WebglContext.h~ deleted file mode 100644 index 3997a51..0000000 --- a/themes/WebglContext.h~ +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once -#include "types.h" -#include <emscripten.h> -#include <emscripten/html5.h> -#include <GLES2/gl2.h> -#include <EGL/egl.h> - -struct WebglContext { - EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context; - int width = 800; - int height = 600; - - void init(const char* query, int inWidth = 800, int inHeight = 600) { - width = inWidth; - height = inHeight; - emscripten_set_canvas_element_size( query, width, height); - - EmscriptenWebGLContextAttributes attrs; - emscripten_webgl_init_context_attributes(&attrs); - - attrs.enableExtensionsByDefault = 1; - attrs.majorVersion = 3; - attrs.minorVersion = 0; - - context = emscripten_webgl_create_context(query, &attrs); - makeCurrentContext(); - - glClearColor(0.2f, 0.3f, 0.3f, 1.0f); - }; - - void makeCurrentContext() { - emscripten_webgl_make_context_current(context); - }; - - void destroy() { - emscripten_webgl_destroy_context(context); - } -}; |