What does a completely basic #openGL #cpp app structure look like on #archlinux, using #glad and #glfw3, assuming that I have installed glfw from the arch repos and downloaded glad from the website generator? What should I stick into the Makefile? What does the main.cpp look like? Most material I find is centered around VSCode, and everything else confuses the f*ck out of me. I would like to be able to follow along learnopengl.com from the comfort of #emacs... #askfedi
@kf The tutorials are good already. When you install glad via arch, only the shared library gets install (i.e. libglad.so) and not the headers. For the headers, you should generate them at https://glad.dav1d.de/ with 'local files' checked and copy glad.h
, glad.c
and khrplatform.h
to your project. In your main.cpp, you will need to change the glad include to #include "glad.h"
(note that this is a relative path).
The compile flags will then look like this: g++ main.cpp glad.c -I. -lglfw -lGL -o main
. I don't know make so I can't help you there. If you have the chance, I recommend CMake :)
@some thanks!
@kf I actually have one in C, but you probably need some basics of OpenGL 3 to understand it: https://sink.krj.st/mwe/file/glfw/triangle.c
@kst cool, looks pretty easy to follow at first glance. Very informative!
@kf just noticed that I haven't updated that example to glad2 though, but there is another sdl example using glad2: https://tig.krj.st/mwe/file/opengl/trig_gl3.c
@kst that mwe repo of yours is a proper goldmine... Need to spend a bit of time digging through that!