TUTORIEL INSTALLATION ET COMPILATION OPENGL & SDL2 AVEC UN MAKEFILE – MissBidule
Non je ne lance pas une chaine de tutoriel.
Tout ce que je dis dans cette vidéo n’est pas forcément exact mais ça marche donc bon 😉
Librairies installées dans ce tutoriel (pas sûr que freeglut soit demandé) :
brew install glfw
brew install freeglut
brew install sdl2
brew install sdl2_image
Headpath et Libpath pour compiler les librairies :
#mac Intel
#LIB et HEAD PATHS
HEADPATH = -I/usr/local/Cellar/sdl2/2.0.20/include -I/usr/local/Cellar/sdl2_image/2.0.5/include
LIBPATH = -L/usr/local/Cellar/sdl2/2.0.20/lib -L/usr/local/Cellar/sdl2_image/2.0.5/lib -framework GLUT -framework OpenGL
#mac M1
#LIB et HEAD PATHS
HEADPATH = -I/opt/homebrew/Cellar/sdl2/2.0.20/include -I/opt/homebrew/Cellar/sdl2_image/2.0.5/include
LIBPATH = -L/opt/homebrew/Cellar/sdl2/2.0.20/lib -L/opt/homebrew/Cellar/sdl2_image/2.0.5/lib -framework GLUT -framework OpenGL
Inclusion à changer pour faire marcher un code existant (ajoutez les chevrons non autorisés par YouTube) :
#if defined(__APPLE__)
#include OpenGL/gl.h
#include OpenGL/glu.h
#else
#include GL/gl.h
#include GL/glu.h
#endif
Inclusion à ajouter SI vous voulez faire compiler TOUTES les libs du tuto (ajoutez les chevrons non autorisés par YouTube) :
#include SDL2/SDL.h
#include SDL2/SDL_image.h
#if defined(__APPLE__)
#include OpenGL/gl.h
#include OpenGL/glu.h
#include GLUT/glut.h
#else
#include GL/gl.h
#include GL/glu.h
#include GL/glut.h
#endif
#include stdlib.h
#include stdio.h
Merci beaucoup !