Графика с использованием SDL. Урок 1. Начало работы с SDL.

Marius Andra, “GFX with SDL. Lesson 1: Getting started with SDL”, public translation into Russian from English More about this translation.

See also 103 similar translations

Translate into another language.

Participants

Denisss2087 points
ciiccii567 points
algor_1206 points
Join Translated.by to translate! If you already have a Translated.by account, please sign in.
If you do not want to register an account, you can sign in with OpenID.
Pages: ← previous Ctrl next
1 2 3 4 5 6 7 8 9

GFX with SDL. Lesson 1: Getting started with SDL

Графика с использованием SDL. Урок 1. Начало работы с SDL.

History of edits (Latest: Denisss 2 years, 9 months ago) §

— А что ещё не переведено? Почему 99%? о_О algor_1

— В тексте трижды встречается строчка "Uint8 R, Uint8 G, Uint8 B)", и трижды она считается недопереведенной. Denisss

Welcome to the first tut in the "GFX with SDL" series.

Приветствую Вас на первом уроке серии "Графика с использованием SDL".

History of edits (Latest: algor_1 2 years, 9 months ago) §

Using SDL with Dev-C++

Подключаем SDL в Dev-C++

History of edits (Latest: algor_1 2 years, 10 months ago) §

The first thing you need is to download some files that you will need. They are in the zip sdlDevCPP-1.2.4.zip (click the name to download). Extract the zip INSIDE your Dev-C++ directory so that the files from the folders lib and include (from the zip) get extracted to the folders lib and include in your Dev-C++ directory. On my computer the Dec-C++ folder is c:\Dev-C++. So after extracting the zip I would have the files libSDL.a, libSDL.la, libSDLmain.a and SDL.dll inside c:\Dev-C++\lib and lots of .h files inside c:\Dev-C++\include\SDL.

Первое, что необходимо сделать - это скачать несколько файлов. Они находятся в ZIP-архиве sdlDevCPP-1.2.4.zip. Распакуйте этот архив в директорию Dev-C++ так, чтобы файлы из папок lib и include оказались в соответствующих папках. Например, в моей системе Dev-C++ установлен в директорию c:\Dev-C++. Таким образом после распаковки архива файлы libSDL.a, libSDL.la, libSDLmain.a и SDL.dll появились в каталоге c:\Dev-C++\lib, а множество файлов с расширением .h - в каталоге c:\Dev-C++\include\SDL.

History of edits (Latest: algor_1 2 years, 9 months ago) §

Now in Dev-C++ start a new console project. Now go to the project options dialog (found in the menu Project). The thing we need to set here is the field that says "Further object files or linker options:". Type in "-lmingw32 -lSDLmain -lSDL" (w/o the quotes) inside it. Now click OK.

Теперь нужно создать новый консольный проект (console project). В его свойствах (их можно найти в меню Project) в поле "Further object files or linker options:" нужно вписать "-lmingw32 -lSDLmain -lSDL" (без кавычек) и нажать кнопку ОК.

History of edits (Latest: algor_1 2 years, 9 months ago) §

One last thing: when you do printf(...) when having the SDL stuff in the project options in Dev-C++ the output of printf is written to a file called stdout.txt, not the screen.

Одно замечание: в Dev-C++ при подключенных к проекту библиотеках SDL функция printf(...) выводит текст не на экран, а в файл stdout.txt.

History of edits (Latest: Denisss 2 years, 10 months ago) §

And that's all the Dev-C++ related stuff.

Вот и все, что касается Dev-C++.

History of edits (Latest: Denisss 2 years, 10 months ago) §

Using SDL in Microsoft Visual C++ 6.0

Подключаем SDL в Microsoft Visual C++ 6.0

History of edits (Latest: algor_1 2 years, 9 months ago) §

To use SDL in MSVC6, download the file SDL-devel-1.2.4-VC6.zip (if a newer version of sdl is released, look in www.libsdl.org for a newer version of this file). In that file you'll find 2 important folders (amongst the others) - include and lib. Extract all the contents from the lib folder in the zip into your MSVC6 lib folder. On my system it's: C:\Program Files\Microsoft Visual Studio\VC98\Lib. Now create a new folder called SDL in your MSVC6 include folder and copy all the .h files from the include folder in the zip file into the newly created folder (on my system it would be C:\Program Files\Microsoft Visual Studio\VC98\Include\SDL) AND into the include folder itself (C:\Program Files\Microsoft Visual Studio\VC98\Include on my system).

Для применения SDL в MSVC6 нужно скачать файл SDL-devel-1.2.4-VC6.zip (свежую его версию можно найти на сайте www.libsdl.org). В нём находятся две важные папки - include и lib. Извлеките содержимое папки lib в папку lib вашего MSVC6. В моей системе это C:\Program Files\Microsoft Visual Studio\VC98\Lib. Теперь создайте новую папку с именем SDL в директории include MSVC6 и скопируйте в нее (на моей системе это C:\Program Files\Microsoft Visual Studio\VC98\Include\SDL), а также в саму директорию include (C:\Program Files\Microsoft Visual Studio\VC98\Include) все .h файлы из каталога include ZIP-архива.

History of edits (Latest: algor_1 2 years, 9 months ago) §

— Как-то странно написано... Очень сложно читается. algor_1

Now in Visual C++, create a new project. Choose 'WIN32 Application' and, when prompted, select 'an empty project'. Now you need to create some .cpp file for your project. Click file->new and select 'c++ source file'. Name it 'main.cpp'. Now go to the project settings (from the menu: project->settings). Click the 'LINK' tab and add 'sdl.lib sdlmain.lib' to the end of the long line of other listed .lib files (Object/library modules). One last thing: click the 'C/C++' tab in 'Project Settings'. From the drop-down menu choose 'Code Generation'. Now select 'Multithreaded DLL' from the 'Use run-time library' drop-down menu. And you're basically all set with MSVC6. Now just code :).

Теперь создайте новый пустой проект: выберите "WIN32 Application" (приложение WIN32) и установите флажок напротив пункта 'an empty project' (пустой проект). После этого нужно создать .cpp файл для Вашего проекта. Нажмите File->New и выберите "c++ source file", назовите его main.cpp. В настройках проекта (пункт меню Project->Settings) перейдите на вкладку LINK и в конец списка "Object/library modules" допишите через пробел "sdl.lib sdlmain.lib" (без кавычек). На вкладке C/C++ в выпадающем списке "Use run-time library" выберите пункт "Multithreaded DLL". Вот и всё, ваш MSVC6 готов к работе :).

History of edits (Latest: algor_1 2 years, 9 months ago) §
Pages: ← previous Ctrl next
1 2 3 4 5 6 7 8 9