VisualC.html
changeset 0 74212992fb08
child 368 180837a1db89
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/VisualC.html	Thu Apr 26 16:45:43 2001 +0000
     1.3 @@ -0,0 +1,235 @@
     1.4 +<HTML>
     1.5 +
     1.6 +
     1.7 +
     1.8 +<HEAD>
     1.9 +
    1.10 +
    1.11 +
    1.12 +<TITLE> Using SDL with Microsoft Visual C++ 5 and 6 </TITLE>
    1.13 +
    1.14 +
    1.15 +
    1.16 +</HEAD>
    1.17 +
    1.18 +
    1.19 +
    1.20 +<BODY>
    1.21 +
    1.22 +
    1.23 +
    1.24 +<H1> Using SDL with Microsoft Visual C++ 5 and 6 </H1>
    1.25 +
    1.26 +<H3>
    1.27 +     by <A HREF="mailto:snowlion@sprynet.com"> Lion Kimbro </A>
    1.28 +</H3>
    1.29 +
    1.30 +
    1.31 +
    1.32 +<p>
    1.33 +    You can either use the precompiled libraries from
    1.34 +    <A HREF="http://www.libsdl.org/download.html">
    1.35 +    the SDL Download web site </A>,
    1.36 +    or you can build SDL yourself.
    1.37 +</p>
    1.38 +
    1.39 +
    1.40 +<H3> Building SDL </H3>
    1.41 +
    1.42 +<P>
    1.43 +     Unzip the <CODE>VisualC.zip</CODE> file into the directory
    1.44 +     that contains this file (<CODE>VisualC.html</CODE>).
    1.45 +</P>
    1.46 +
    1.47 +<P>
    1.48 +     Be certain that you unzip <CODE> VisualC.zip </CODE>
    1.49 +     into <strong>this</strong> directory and not any other
    1.50 +     directory. If you are using WinZip, be careful to
    1.51 +     make sure that it extracts to <strong>this</strong>
    1.52 +     folder, because it's convenient feature of
    1.53 +     unzipping to a folder with the name of the
    1.54 +     file currently being unzipped will get you in
    1.55 +     trouble if you use it right now. And that's all
    1.56 +     I have to say about that.
    1.57 +</P>
    1.58 +
    1.59 +<P>
    1.60 +     Now that it's unzipped, go into the VisualC directory
    1.61 +     that is created, and double-click on the VC++
    1.62 +     workspace file &quot;<CODE>SDL.dsw</CODE>&quot;.
    1.63 +     This should open up VisualC.
    1.64 +</P>
    1.65 +
    1.66 +<P>
    1.67 +     You may be prompted at this point to upgrade the
    1.68 +     workspace, should you be using a more recent version
    1.69 +     of Visual C++. If so, allow the workspace to be
    1.70 +     upgraded.
    1.71 +</P>
    1.72 +
    1.73 +
    1.74 +<P>
    1.75 +     Build the <CODE>.dll</CODE> and <CODE>.lib</CODE> files.
    1.76 +</P>
    1.77 +
    1.78 +<P>
    1.79 +     This is done by right clicking on each project in turn
    1.80 +     (Projects are listed in the Workspace panel in the
    1.81 +     FileView tab), and selecting &quot;Build&quot;.
    1.82 +</P>
    1.83 +
    1.84 +<P>
    1.85 +     You may get a few warnings, but you should not get
    1.86 +     any errors. You do have to have at least the DirectX
    1.87 +     5 SDK installed, however. (I believe...) The latest
    1.88 +     version of DirectX can be downloaded or purchased
    1.89 +     on a cheap CD (my recommendation) from
    1.90 +     <A HREF="http://www.microsoft.com"> Microsoft </A>.
    1.91 +</P>
    1.92 +
    1.93 +<P>
    1.94 +    Later, we will refer to the following .lib and .dll
    1.95 +    files that have just been generated:
    1.96 +</P>
    1.97 +
    1.98 +    <list>
    1.99 +    <li> SDL.dll
   1.100 +    <li> SDL.lib
   1.101 +    <li> SDLmain.lib
   1.102 +    </list>
   1.103 +
   1.104 +<P>
   1.105 +    Search for these using the Windows Find (Windows-F)
   1.106 +    utility, if you don't already know where they should be.
   1.107 +    For those of you with a clue, look inside the Debug
   1.108 +    or Release directories of the subdirectories of the
   1.109 +    VisualC folder. (It might be easier to just use
   1.110 +    Windows Find if this sounds confusing. And don't worry
   1.111 +    about needing a clue; we all need visits from the
   1.112 +    clue fairy frequently.)
   1.113 +</P>
   1.114 +
   1.115 +
   1.116 +
   1.117 +<H3> Creating a Project with SDL </H3>
   1.118 +
   1.119 +<P>
   1.120 +     Create a project as a Win32 Application.
   1.121 +</P>
   1.122 +
   1.123 +<P>
   1.124 +     Create a C++ file for your project.
   1.125 +</P>
   1.126 +
   1.127 +<P>
   1.128 +     Set the C runtime to "Multi-threaded DLL" in the menu:
   1.129 +     <CODE> Project|Settings|C/C++ tab|Code Generation|Runtime Library </CODE>.
   1.130 +</P>
   1.131 +
   1.132 +<P>
   1.133 +     Add the SDL <CODE>include</CODE> directory to your list
   1.134 +     of includes in the menu:
   1.135 +     <CODE> Project|Settings|C/C++ tab|Preprocessor|Additional include directories </CODE>.
   1.136 +</P>
   1.137 +
   1.138 +<P>
   1.139 +     The &quot;include directory&quot; I am referring to is the
   1.140 +     <CODE>include</CODE> folder within the main SDL
   1.141 +     directory (the one that this HTML file located
   1.142 +     within.
   1.143 +</P>
   1.144 +
   1.145 +<P>
   1.146 +     Now we're going to use the files that we had created
   1.147 +     earlier in the Build SDL step.
   1.148 +</P>
   1.149 +
   1.150 +<P>
   1.151 +     Copy the following files into your Project directory:
   1.152 +</P>
   1.153 +
   1.154 +     <list>
   1.155 +     <li> SDL.dll </li>
   1.156 +     </list>
   1.157 +
   1.158 +<P>
   1.159 +     Copy the following files into your Project directory,
   1.160 +     and <em>add them to your Project</em> as well:
   1.161 +</P>
   1.162 +
   1.163 +     <list>
   1.164 +     <li> SDL.lib </li>
   1.165 +     <li> SDLmain.lib </li>
   1.166 +     </list>
   1.167 +
   1.168 +<P>
   1.169 +     (To add them to your project, right click on your
   1.170 +     project, and select &quot;Add files to project&quot;)
   1.171 +</P>
   1.172 +
   1.173 +<P>
   1.174 +     (I believe that it's not necessary to actually
   1.175 +     copy the .lib files into your directory; you only
   1.176 +     have to be certain that you add them to your Project.
   1.177 +     If someone is so inclined, correct this document, or
   1.178 +     <A HREF="mailto:snowlion@sprynet.com">
   1.179 +     e-mail me </A>,
   1.180 +     and I'll fix this document.)
   1.181 +</P>
   1.182 +
   1.183 +
   1.184 +
   1.185 +<H3> SDL 101, First Day of Class </H3>
   1.186 +
   1.187 +<P>
   1.188 +     Now create the basic body of your project.
   1.189 +     The body of your program should take the following form:
   1.190 +
   1.191 +<CODE>
   1.192 +<PRE>
   1.193 +#include &quot;SDL.h&quot;
   1.194 +
   1.195 +int main( int argc, char* argv[] )
   1.196 +{
   1.197 +  // Body of the program goes here.
   1.198 +  return 0;
   1.199 +}
   1.200 +</PRE>
   1.201 +</CODE>
   1.202 +</P>
   1.203 +
   1.204 +<H3> That's it! </H3>
   1.205 +
   1.206 +<P>
   1.207 +     I hope that this document has helped you get
   1.208 +     through the most difficult part of using the
   1.209 +     SDL: installing it. Suggestions for improvements
   1.210 +     to this document should be sent to the writers
   1.211 +     of this document.
   1.212 +</P>
   1.213 +
   1.214 +<P>
   1.215 +     Thanks to Paulus Esterhazy (pesterhazy@gmx.net), for the work on VC++ port.
   1.216 +</P>
   1.217 +
   1.218 +<P>
   1.219 +     This document was originally called &quot;VisualC.txt&quot;,
   1.220 +     and was written by 
   1.221 +     <A HREF="mailto:slouken@libsdl.org">Sam Lantinga</A>.
   1.222 +</P>
   1.223 +
   1.224 +<P>
   1.225 +     Later, it was converted to HTML and expanded into
   1.226 +     the document that you see today by 
   1.227 +     <A HREF="mailto:snowlion@sprynet.com">Lion Kimbro</A>.
   1.228 +</P>
   1.229 +
   1.230 +
   1.231 +
   1.232 +</BODY>
   1.233 +
   1.234 +
   1.235 +
   1.236 +</HTML>
   1.237 +
   1.238 +