Delphi-PRAXiS
Seite 1 von 3  1 23      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Pointer auf Record (https://www.delphipraxis.net/96614-pointer-auf-record.html)

Gargamel 27. Jul 2007 13:30


Pointer auf Record
 
Hallo

Delphi-Quellcode:
PD3DCaps9 = ^TD3DCaps9;
  _D3DCAPS9 = record
    (* Device Info *)
    DeviceType: TD3DDevType;
    AdapterOrdinal: DWord;
    MaxTextureWidth, MaxTextureHeight: DWord;
End
Dazu gibt es noch einen Pointer

Delphi-Quellcode:
pd3dcaps : Pointer;      // pointer to the current D3DCAPS9

Wie komme ich jetzt an den Wert der Variable MaxTextureWidth?


Vielen Dank

mkinzler 27. Jul 2007 13:34

Re: Pointer auf Record
 
Ersetze dies mal durch

Delphi-Quellcode:
var pd3dcaps: PD3DCaps9;
...
p3dcaps^.MaxTextureWidth

Gargamel 27. Jul 2007 13:57

Re: Pointer auf Record
 
Vielen Dank. Leider funktioniert es nicht.
Sorry, ich hatte vergessen, folgendes zu erwähnen:

Ich kann nur so zugreifen

ev.pd3dcaps ( pd3dcaps ist vom Typ Pointer; ev ist eine Environment-Variable, welche alle nötigen Informationen enthält )

mkinzler 27. Jul 2007 14:02

Re: Pointer auf Record
 
Ich glaube nicht das as bei normalen pointern funktioniert. vielleicht mit Zuhilfenahme einer Hilfsvariablen:
Delphi-Quellcode:
var pd3dcaps: PD3DCaps9;
...
p3dcaps := ev.pd3dcaps;
p3dcaps^.MaxTextureWidth

sirius 27. Jul 2007 14:05

Re: Pointer auf Record
 
Keine Ahnung, was du da oben hast

Aber vielleicht so:
Delphi-Quellcode:
result:=DWORD(ppointer(cardinal(ev.pd3dcaps)+sizeof(TD3DDevType)+sizeof(DWORD))^);

Dax 27. Jul 2007 14:07

Re: Pointer auf Record
 
Delphi-Quellcode:
//Oder
PD3DCaps9(pd3dcaps)^.MaxTextureWidth

Oxmyx 27. Jul 2007 14:08

Re: Pointer auf Record
 
Ist das Problem lediglich, dass du einen untypisierten Zeiger hast? Dann geht es einfach mit
Delphi-Quellcode:
PD3DCaps9(pd3dcaps).MaxTextureWidth

Gargamel 27. Jul 2007 14:18

Re: Pointer auf Record
 
Ihr habt wirklich etwas "auf dem Kasten". Hat richtig prima funktioniert.

Vielen Dank

Gargamel 27. Jul 2007 14:36

Re: Pointer auf Record
 
Dadurch, dass ich jetzt darauf zugreifen kann, möchte ich logischerweise einige Informationen auslesen.
Bei MaxTextureWidth ist das relativ einfach.

Wie steht es aber mit TextureOpCaps?

DWORD TextureOpCaps; ( ist Bestandteil oben genannter Struktur )
Ich möchte also herausfinden, welche Texturoperationen mit der aktuell installierten Grafikkarte möglich sind.

Das steht dazu im MSDN:

TextureOpCaps
Combination of flags describing the texture operations supported by this device. The following flags are defined.

D3DTEXOPCAPS_ADD
The D3DTOP_ADD texture-blending operation is supported.
D3DTEXOPCAPS_ADDSIGNED
The D3DTOP_ADDSIGNED texture-blending operation is supported.
D3DTEXOPCAPS_ADDSIGNED2X
The D3DTOP_ADDSIGNED2X texture-blending operation is supported.
D3DTEXOPCAPS_ADDSMOOTH
The D3DTOP_ADDSMOOTH texture-blending operation is supported.
D3DTEXOPCAPS_BLENDCURRENTALPHA
The D3DTOP_BLENDCURRENTALPHA texture-blending operation is supported.
D3DTEXOPCAPS_BLENDDIFFUSEALPHA
The D3DTOP_BLENDDIFFUSEALPHA texture-blending operation is supported.
D3DTEXOPCAPS_BLENDFACTORALPHA
The D3DTOP_BLENDFACTORALPHA texture-blending operation is supported.
D3DTEXOPCAPS_BLENDTEXTUREALPHA
The D3DTOP_BLENDTEXTUREALPHA texture-blending operation is supported.
D3DTEXOPCAPS_BLENDTEXTUREALPHAPM
The D3DTOP_BLENDTEXTUREALPHAPM texture-blending operation is supported.
D3DTEXOPCAPS_BUMPENVMAP
The D3DTOP_BUMPENVMAP texture-blending operation is supported.
D3DTEXOPCAPS_BUMPENVMAPLUMINANCE
The D3DTOP_BUMPENVMAPLUMINANCE texture-blending operation is supported.
D3DTEXOPCAPS_DISABLE
The D3DTOP_DISABLE texture-blending operation is supported.
D3DTEXOPCAPS_DOTPRODUCT3
The D3DTOP_DOTPRODUCT3 texture-blending operation is supported.
D3DTEXOPCAPS_LERP
The D3DTOP_LERP texture-blending operation is supported.
D3DTEXOPCAPS_MODULATE
The D3DTOP_MODULATE texture-blending operation is supported.
D3DTEXOPCAPS_MODULATE2X
The D3DTOP_MODULATE2X texture-blending operation is supported.
D3DTEXOPCAPS_MODULATE4X
The D3DTOP_MODULATE4X texture-blending operation is supported.
D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR
The D3DTOP_MODULATEALPHA_ADDCOLOR texture-blending operation is supported.
D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA
The D3DTOP_MODULATECOLOR_ADDALPHA texture-blending operation is supported.
D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR
The D3DTOP_MODULATEINVALPHA_ADDCOLOR texture-blending operation is supported.
D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA
The D3DTOP_MODULATEINVCOLOR_ADDALPHA texture-blending operation is supported.
D3DTEXOPCAPS_MULTIPLYADD
The D3DTOP_MULTIPLYADD texture-blending operation is supported.
D3DTEXOPCAPS_PREMODULATE
The D3DTOP_PREMODULATE texture-blending operation is supported.
D3DTEXOPCAPS_SELECTARG1
The D3DTOP_SELECTARG1 texture-blending operation is supported.
D3DTEXOPCAPS_SELECTARG2
The D3DTOP_SELECTARG2 texture-blending operation is supported.
D3DTEXOPCAPS_SUBTRACT
The D3DTOP_SUBTRACT texture-blending operation is supported.

Sidorion 27. Jul 2007 15:48

Re: Pointer auf Record
 
Delphi-Quellcode:
If (<Konstante> And PD3DCaps9(pd3dcaps)^.TextureOpCaps = <Konstante>)..


Alle Zeitangaben in WEZ +1. Es ist jetzt 22:54 Uhr.
Seite 1 von 3  1 23      

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz