Difference between revisions of "Talk:Tutorial2: VAOs, VBOs, Vertex and Fragment Shaders (C / SDL)"

From OpenGL Wiki
Jump to: navigation, search
(SDL include/compilation: new section)
Line 2: Line 2:
  
 
:: Also, the article could use some nice Wiki links to appropriate pages. [[User:Alfonse|Alfonse]] 18:30, 19 August 2009 (UTC)
 
:: Also, the article could use some nice Wiki links to appropriate pages. [[User:Alfonse|Alfonse]] 18:30, 19 August 2009 (UTC)
 +
 +
== SDL include/compilation ==
 +
 +
For compilation on Linux, I think <code>sdl-config</code> should be used:
 +
* <code>`sdl-config --cflags`</code> gives the proper include path for SDL headers (for example: <code>-I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT</code>);
 +
* <code>`sdl-config --libs`</code> gives the proper library path and links with SDL (for example: <code>-L/usr/lib -lSDL</code>);
 +
* This should help compilation configuration for non-standard installations (not in <code>/usr</code> or <code>/usr/local</code>);
 +
* <code>sdl-config --cflags</code> is provided/installed with SDL;
 +
* This mechanism is also used by other libraries (like libpng, which has <code>libpng-config</code>, OpenAL, XML2, etc.);
 +
* Therefore, the include in C/C++ programs should be <code><SDL.h></code>, not <code><SDL/SDL.h></code>.
 +
:--[[User:Dhe|Dhe]] 19:19, 19 August 2009 (UTC)

Revision as of 19:19, 19 August 2009

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)