Talk:Tutorial2: VAOs, VBOs, Vertex and Fragment Shaders (C / SDL)

From OpenGL Wiki
Revision as of 19:19, 19 August 2009 by Dhe (talk | contribs) (→‎SDL include/compilation: new section)
Jump to navigation Jump to search
This article needs cleanup. A proper tutorial would actually explain how all of these things work, not just regurgitate code and commenting at the user. Also, the format is poor. Alfonse 18:30, 19 August 2009 (UTC)
Also, the article could use some nice Wiki links to appropriate pages. Alfonse 18:30, 19 August 2009 (UTC)

SDL include/compilation

For compilation on Linux, I think sdl-config should be used:

  • `sdl-config --cflags` gives the proper include path for SDL headers (for example: -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT);
  • `sdl-config --libs` gives the proper library path and links with SDL (for example: -L/usr/lib -lSDL);
  • This should help compilation configuration for non-standard installations (not in /usr or /usr/local);
  • sdl-config --cflags is provided/installed with SDL;
  • This mechanism is also used by other libraries (like libpng, which has libpng-config, OpenAL, XML2, etc.);
  • Therefore, the include in C/C++ programs should be <SDL.h>, not <SDL/SDL.h>.
--Dhe 19:19, 19 August 2009 (UTC)