AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Pointer auf Record

Ein Thema von Gargamel · begonnen am 27. Jul 2007 · letzter Beitrag vom 28. Jul 2007
Antwort Antwort
Seite 1 von 3  1 23      
Gargamel

Registriert seit: 19. Mär 2007
171 Beiträge
 
#1

Pointer auf Record

  Alt 27. Jul 2007, 13:30
Hallo

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

pd3dcaps : Pointer;      // pointer to the current D3DCAPS9
Wie komme ich jetzt an den Wert der Variable MaxTextureWidth?


Vielen Dank
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: Pointer auf Record

  Alt 27. Jul 2007, 13:34
Ersetze dies mal durch

Delphi-Quellcode:
var pd3dcaps: PD3DCaps9;
...
p3dcaps^.MaxTextureWidth
Markus Kinzler
  Mit Zitat antworten Zitat
Gargamel

Registriert seit: 19. Mär 2007
171 Beiträge
 
#3

Re: Pointer auf Record

  Alt 27. Jul 2007, 13:57
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 )
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#4

Re: Pointer auf Record

  Alt 27. Jul 2007, 14:02
Ich glaube nicht das as bei normalen pointern funktioniert. vielleicht mit Zuhilfenahme einer Hilfsvariablen:
Delphi-Quellcode:
var pd3dcaps: PD3DCaps9;
...
p3dcaps := ev.pd3dcaps;
p3dcaps^.MaxTextureWidth
Markus Kinzler
  Mit Zitat antworten Zitat
Benutzerbild von sirius
sirius

Registriert seit: 3. Jan 2007
Ort: Dresden
3.443 Beiträge
 
Delphi 7 Enterprise
 
#5

Re: Pointer auf Record

  Alt 27. Jul 2007, 14:05
Keine Ahnung, was du da oben hast

Aber vielleicht so:
result:=DWORD(ppointer(cardinal(ev.pd3dcaps)+sizeof(TD3DDevType)+sizeof(DWORD))^);
Dieser Beitrag ist für Jugendliche unter 18 Jahren nicht geeignet.
  Mit Zitat antworten Zitat
Dax
(Gast)

n/a Beiträge
 
#6

Re: Pointer auf Record

  Alt 27. Jul 2007, 14:07
Delphi-Quellcode:
//Oder
PD3DCaps9(pd3dcaps)^.MaxTextureWidth
  Mit Zitat antworten Zitat
Oxmyx

Registriert seit: 21. Sep 2004
499 Beiträge
 
#7

Re: Pointer auf Record

  Alt 27. Jul 2007, 14:08
Ist das Problem lediglich, dass du einen untypisierten Zeiger hast? Dann geht es einfach mit
PD3DCaps9(pd3dcaps).MaxTextureWidth
  Mit Zitat antworten Zitat
Gargamel

Registriert seit: 19. Mär 2007
171 Beiträge
 
#8

Re: Pointer auf Record

  Alt 27. Jul 2007, 14:18
Ihr habt wirklich etwas "auf dem Kasten". Hat richtig prima funktioniert.

Vielen Dank
  Mit Zitat antworten Zitat
Gargamel

Registriert seit: 19. Mär 2007
171 Beiträge
 
#9

Re: Pointer auf Record

  Alt 27. Jul 2007, 14:36
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.
  Mit Zitat antworten Zitat
Sidorion

Registriert seit: 23. Jun 2005
403 Beiträge
 
#10

Re: Pointer auf Record

  Alt 27. Jul 2007, 15:48
If (<Konstante> And PD3DCaps9(pd3dcaps)^.TextureOpCaps = <Konstante>)..
Manchmal sehen Dinge, die wie Dinge aussehen wollen mehr wie Dinge aus, als Dinge
<Esmerelda Wetterwachs>
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 1 von 3  1 23      


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:59 Uhr.
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