使用 Emscripten 编译 GLUT

Compiling GLUT using Emscripten

我正在尝试编译以下代码: http://pastebin.com/024Ew4fK

我正在使用以下指令: -s LEGACY_GL_EMULATION=1 -lglut -lGLU -lGL

我收到以下警告:

warning: unresolved symbol: glPointSize
warning: unresolved symbol: glutSolidSphere
warning: unresolved symbol: glutWireSphere

这些是错误:

WARNING: using emscripten GL immediate mode emulation. This is very limited in what it supports

missing function: glPointSize

uncaught exception: abort(-1) at jsStackTrace@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:1173:13
stackTrace@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:1190:22
abort@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:15901:44
_glPointSize@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:2135:56
_main@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:11483:2
asm._main@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:15672:8
callMain@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:15766:15
doRun@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:15824:42
run/<@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:15835:7
setTimeout handler*run@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:15831:5
@file:///C:/Users/Tyrion/Documents/Proyectos/GLUT_SolarSystem/out.js:15927:1

为什么说缺少glPointSize?

以下是 Emscripten 支持的 Glut 功能: https://github.com/kripken/emscripten/blob/master/src/library_glut.js

为了画一些东西,例如球体,Kripken 建议在某处寻找一个用 C 编写的函数,它可以自己完成,然后将该函数移植到我的程序中。