This is a demo app trying to demonstrate using go-glfw to create a window do simple OpenGL ES Commands to draw screen
In main
branch, the OpenGL ES Commands are called in javascript in v8go (they are bound to v8 in C++ world) to draw UI in the glfw window created in golang world. However, it keeps getting gl error: 1282
for simple gl commands like glClear and glClearColor in Windows platform.
In bindGLInGolang
branch, the OpenGL ES Commands are also called in javascript in v8go (but they are bound to v8 in Golang world) to draw UI in the glfw window created in golang world; and this works correctly.
- github.com/go-gl/glfw/v3.3/glfw
- github.com/plato-app/v8go (for main branch for binding OpenGL ES in C++ world)
- https://github.com/rogchap/v8go (for bindGLInGolang branch for binding OpenGL ES in Golang world)
- V8 for windows (see below)
While no prebuilt static V8 library is included for Windows, MSYS2 provides a package containing a dynamically linked V8 library that works.
To set this up:
- Install MSYS2 (https://www.msys2.org/)
- Add the Mingw-w64 bin to your PATH environment variable (C:\msys64\mingw64\bin by default)
- Open MSYS2 MSYS and execute
pacman -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-v8
- This will allow building projects that depend on
v8go
, but, in order to actually run them, you will need to copy thesnapshot_blob.bin
file from the Mingw-w64 bin folder to your program's working directory (which is typically wherever main.go is) - V8 requires 64-bit on Windows, therefore will not work on 32-bit systems.