Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How to setup SDL and Opengl on Visual Studio (2010 express, don't worry, if you have slightly different version).
- Step 1 - download the SDL, go to http://www.libsdl.org/download-1.2.php and download the library for Visual studio (SDL-devel-1.2.14-VC8.zip (Visual C++ 2005 Service Pack 1)) and uncompress it somewhere (just remember where)
- Step 2 - create a new project in Visual Studio (Win32 Consol application and empty project) and copy (or write the code in it)
- Step 3 - go to project/project_name properties and then VC++ directories and set your include directories (click on it, arrow on the right side/edit... and the new sign, and browse it) to the directiory you downloaded in step 1\include\ for example in my case it's (G:\include\SDL-1.2.14\include) and then do the same to the library directiories and the path should be the downloaded SDL directory/lib for example in my case it's G:\include\SDL-1.2.14\lib
- Step 4 - don't close this property windows and go to linker/input and edit the additional dependencies (just copy the followings):
- SDL.lib
- SDLmain.lib
- opengl32.lib
- glu32.lib
- Step 5 - Depend on the SDL version you will need to include SDL.h or SDL/SDL.h (check the include directory), and you have to include windows.h before you include the OpenGL header files.
- Step 6 - Copy the SDL.dll (from the SDL library, you downloaded) (and in case of project which use some other files like images and objs...)
- to your project directory\name\name\ (for example my project directory is: G:\Users\computer\Documents\Visual Studio 2010\Projects\)
- Step 6 - now you can run the program from Visual Studio copy the SDl.dll and the other files to projetct/name/debug, to be able to run the exe file.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement