Difference between revisions of "FPC and DirectX/de"

From Free Pascal wiki
Jump to navigationJump to search
m
Line 7: Line 7:
 
This page is going to explain the basics how to setup DirectX with Free Pascal, where to obtain the pascal headers etc.
 
This page is going to explain the basics how to setup DirectX with Free Pascal, where to obtain the pascal headers etc.
  
== Besorgen der DirectX Header für FPC ==
+
== Beschaffen der DirectX Header für FPC ==
  
 
Sie werden Pascal Header benötigen, um DirectX mit FPC nutzen zu können.
 
Sie werden Pascal Header benötigen, um DirectX mit FPC nutzen zu können.
Sie können sie herunterladen von http://www.clootie.ru/fpc/index.html. In the downloadable file you will find the headers, and also the DLL files that need to go with your application. They always go together.
+
Sie können sie von http://www.clootie.ru/fpc/index.html herunterladen. In der Datei finden Sie die Header, und auch die DLL dateien, die sie mit Ihrer Applikation ausliefern müssen.
  
 
== Beispiele ==
 
== Beispiele ==

Revision as of 14:01, 2 February 2007

Deutsch (de) English (en) français (fr)

Einleitung

First of all, DirectX is only suited for Microsoft Windows. DirectX programming in Free Pascal is fast. Das Aufrufen einer DirectX Funktion unterscheidet sich nicht von anderen Sprachen wie C++ (mit einigen kleinen Ausnahmen). To use DirectX you will need to know some basic stuff about the language. A valuable resource is Google, und das MSDN Network. Da die meisten Tutorials und Beispiele in C++ geschrieben sind, sind grundlegende C++ Kenntnisse empfehlenswert, aber das Übersetzen nach Pascal ist nicht sehr schwierig. You will get the hang of it in no time. This page is going to explain the basics how to setup DirectX with Free Pascal, where to obtain the pascal headers etc.

Beschaffen der DirectX Header für FPC

Sie werden Pascal Header benötigen, um DirectX mit FPC nutzen zu können. Sie können sie von http://www.clootie.ru/fpc/index.html herunterladen. In der Datei finden Sie die Header, und auch die DLL dateien, die sie mit Ihrer Applikation ausliefern müssen.

Beispiele

It's conveniant to use a program like Lazarus to create DirectX applications, because it needs a window to draw all graphics and programming directly in Win32 is very awkward, in Lazarus you can just connect all your drawing objects to the Form and every works fine.

You just place the units you will use in your program in your uses section. Be sure to place the units in your program folder.Like this:

 interface
   uses  
 Windows, Classes, SysUtils, LResources, Forms,  Dialogs,  ExtCtrls,  // standard stuff
 Direct3D8, // die DirectX Units
 D3DX8,
 Directinput,
 DirectMusic,
 DirectSound;

If you have placed the DLL's in your program folder you now can use all DirectX calls in your program.