失效链接处理 |
Focus on SDL Premier Press PDF 下载
本站整理下载:
相关截图:
主要内容:
I am a programmer who, after programming for about 13 years, suddenly had opportunity to write books. The one you are holding in your
hands is the fourth book I have written. Moreover, I tend to be the
author who picks the “odd little topics.” My other books include Isometric
Game Programming with DirectX 7.0 (Premier Press, Inc. 0-7615-3089-4,
2001), the Game Developer’s Guide to the Cybiko (Wordware Publishing,
2001), and Focus On 2D in Direct3D (Premier Press, Inc., 2002).
After writing four books, I think I’ve learned my “style” of writing and
how I approach various topics. I don’t make lots of very game-like
demos when I’m talking about whatever API I happen to be writing
about that month. Instead, I write very simple code that demonstrates
a particular aspect of the API, so that the code for the new topic is
easily isolated and understood by the readers.
I am also a very object-oriented programmer. When I write real code
in C++, I use the three pillars of encapsulation, inheritance, and polymorphism. Much of the code in this book is, as I call it, “book code.”
Book code is a bit watered down and simplified to make it more
understandable to readers with varying levels of experience. If I were
to write code for a book the way I really write code, even I would have
a hard time following it.
Who You Are
You are the primary reason I write books. You are the reader. You and
you alone determine whether or not I have done my job sufficiently.
You looked at this book on a bookshelf or at some online bookstore
and said, “SDL? What is that?” Or maybe you already knew about SDL
and you wanted something to help you on your path besides the SDL
documentation, which is quality documentation but still rather dry
when you really think about it.
Maybe you are tired of DirectX. I hear you. Perhaps you want to use
OpenGL, but you want to use a nice cross-platform API for “the other
Team LRN
stuff” that OpenGL doesn’t do, such as sound and input. In any case,
you have decided that learning what SDL is all about can’t really hurt,
and you might even enjoy it. I certainly hope so.
What You Should
Already Know
This is a small book, folks. Books on game programming no longer
cover every single aspect like they once did. That task is impossible
because the subject matter has become too vast.
Also, this book does not teach computer programming in general.
You should already be rather comfortable with programming and C++.
By no means do you have to be at an expert level, but you should
know the basics.
Why You Are Here
You are here to explore the API known as SDL (Simple DirectMedia
Layer), a cross-platform multimedia API. SDL is an open source library
that takes care of most of the tasks that typically belong to the domain
of DirectX. The added bonus is that with SDL, you can compile the
same code for Windows or Linux and it works the same way. SDL also
removes the need for all of the code that typically exists in a Windows
program, such as code for setting up window classes, creating windows,
and creating window procedures. SDL hides all of that for you so you
don’t have to worry about it.
In other words, I am here to make your job shorter and easier.
With SDL, you can be up and running with a small program in less
than 20 lines, whereas a regular program for Windows would be five
or six times that long. That’s pretty cool, I think.
So let’s get started.
|