Make Problems
When I make the code on the terminal, it gives me this error:
fatal error: GL3/gl3.h: No such file or directory
So I changed on the cube2equirect.h the #include <GL3/gl3.h> to #include <GL/gl.h>
It solved the error but when I make it again this appened
make g++ -c -g -o objs/cube2equirect.o src/cube2equirect.cpp sdl2-config --cflags -I/usr/local/include -I/usr/X11R6/include src/cube2equirect.cpp: In member function ‘void cube2equirect::render()’: src/cube2equirect.cpp:36:5: error: ‘glBindFramebuffer’ was not declared in this scope; did you mean ‘equirectFramebuffer’? 36 | glBindFramebuffer(GL_FRAMEBUFFER, equirectFramebuffer); | ^~~~~~~~~~~~~~~~~ | equirectFramebuffer src/cube2equirect.cpp:44:5: error: ‘glUniform1i’ was not declared in this scope 44 | glUniform1i(cubeLeftUniform, 0); | ^~~~~~~~~~~ src/cube2equirect.cpp:71:5: error: ‘glBindVertexArray’ was not declared in this scope 71 | glBindVertexArray(vertexArrayObject); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp: In member function ‘void cube2equirect::initBuffers()’: src/cube2equirect.cpp:104:5: error: ‘glGenVertexArrays’ was not declared in this scope 104 | glGenVertexArrays(1, &vertexArrayObject); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:105:5: error: ‘glBindVertexArray’ was not declared in this scope 105 | glBindVertexArray(vertexArrayObject); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:108:5: error: ‘glGenBuffers’ was not declared in this scope; did you mean ‘glReadBuffer’? 108 | glGenBuffers(1, &vertexPositionBuffer); | ^~~~~~~~~~~~ | glReadBuffer src/cube2equirect.cpp:109:5: error: ‘glBindBuffer’ was not declared in this scope; did you mean ‘glReadBuffer’? 109 | glBindBuffer(GL_ARRAY_BUFFER, vertexPositionBuffer); | ^~~~~~~~~~~~ | glReadBuffer src/cube2equirect.cpp:116:5: error: ‘glBufferData’ was not declared in this scope 116 | glBufferData(GL_ARRAY_BUFFER, 12 * sizeof(GLfloat), vertices, GL_STATIC_DRAW); | ^~~~~~~~~~~~ src/cube2equirect.cpp:117:5: error: ‘glEnableVertexAttribArray’ was not declared in this scope 117 | glEnableVertexAttribArray(vertexPositionAttribute); | ^~~~~~~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:118:5: error: ‘glVertexAttribPointer’ was not declared in this scope; did you mean ‘glVertexPointer’? 118 | glVertexAttribPointer(vertexPositionAttribute, 3, GL_FLOAT, false, 0, 0); | ^~~~~~~~~~~~~~~~~~~~~ | glVertexPointer src/cube2equirect.cpp: In member function ‘void cube2equirect::initRenderToTexture()’: src/cube2equirect.cpp:146:5: error: ‘glGenFramebuffers’ was not declared in this scope 146 | glGenFramebuffers(1, &equirectFramebuffer); | ^~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:147:5: error: ‘glBindFramebuffer’ was not declared in this scope; did you mean ‘equirectFramebuffer’? 147 | glBindFramebuffer(GL_FRAMEBUFFER, equirectFramebuffer); | ^~~~~~~~~~~~~~~~~ | equirectFramebuffer src/cube2equirect.cpp:158:5: error: ‘glFramebufferTexture2D’ was not declared in this scope 158 | glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, equirectTexture, 0); | ^~~~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp: In member function ‘GLint cube2equirect::compileShader(std::string, GLint)’: src/cube2equirect.cpp:211:20: error: ‘glCreateShader’ was not declared in this scope 211 | GLint shader = glCreateShader(type); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:215:5: error: ‘glShaderSource’ was not declared in this scope 215 | glShaderSource(shader, 1, &srcBytes, &srcLength); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:216:5: error: ‘glCompileShader’ was not declared in this scope; did you mean ‘compileShader’? 216 | glCompileShader(shader); | ^~~~~~~~~~~~~~~ | compileShader src/cube2equirect.cpp:217:5: error: ‘glGetShaderiv’ was not declared in this scope 217 | glGetShaderiv(shader, GL_COMPILE_STATUS, &status); | ^~~~~~~~~~~~~ src/cube2equirect.cpp:224:9: error: ‘glGetShaderInfoLog’ was not declared in this scope 224 | glGetShaderInfoLog(shader, length, NULL, info); | ^~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp: In member function ‘void cube2equirect::createShaderProgram(std::string, GLint, GLint)’: src/cube2equirect.cpp:237:21: error: ‘glCreateProgram’ was not declared in this scope 237 | shaderProgram = glCreateProgram(); | ^~~~~~~~~~~~~~~ src/cube2equirect.cpp:238:5: error: ‘glAttachShader’ was not declared in this scope 238 | glAttachShader(shaderProgram, vertexShader); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:241:5: error: ‘glBindAttribLocation’ was not declared in this scope 241 | glBindAttribLocation(shaderProgram, 0, "aVertexPosition"); | ^~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:243:5: error: ‘glBindFragDataLocation’ was not declared in this scope 243 | glBindFragDataLocation(shaderProgram, 0, "FragColor"); | ^~~~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:245:5: error: ‘glLinkProgram’ was not declared in this scope; did you mean ‘glHistogram’? 245 | glLinkProgram(shaderProgram); | ^~~~~~~~~~~~~ | glHistogram src/cube2equirect.cpp:247:5: error: ‘glGetProgramiv’ was not declared in this scope 247 | glGetProgramiv(shaderProgram, GL_LINK_STATUS, &status); | ^~~~~~~~~~~~~~ src/cube2equirect.cpp:253:31: error: ‘glGetAttribLocation’ was not declared in this scope 253 | vertexPositionAttribute = glGetAttribLocation(shaderProgram, "aVertexPosition"); | ^~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:257:25: error: ‘glGetUniformLocation’ was not declared in this scope 257 | cubeLeftUniform = glGetUniformLocation(shaderProgram, "cubeLeftImage"); | ^~~~~~~~~~~~~~~~~~~~ src/cube2equirect.cpp:264:5: error: ‘glUseProgram’ was not declared in this scope 264 | glUseProgram(shaderProgram); | ^~~~~~~~~~~~ make: *** [Makefile:34: objs/cube2equirect.o] Error 1
I don't know how to solve this, I am using Ubuntu and I need much a code like this for my projects.
Thanks for letting me know. This is pretty old code and could use a bit of an overhaul. I just started a new branch "egl" where I am switching over from using SDL to now simply using EGL. This will allow for the creation of an OpenGL context without actually creating a window since you don't need to see anything for the conversion. The new branch isn't done yet, but if you can wait a short bit, hopefully it will suit your needs!
OK - I have finished the EGL implementation and merged it into the 'master' branch. Please let me know if you get it to compile now!