Autor Beitrag
spike0
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Sa 29.10.05 19:24 
Bei Delphi gibt es doch die Möglichkeit, die Parameter einer Funktion anzugucken (Strg+Leertaste). Kann ich, wenn ich die OpenGL.dcu Datei habe, diese Parameter irgendwie auslesen?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 29.10.05 21:38 
Ich möchte dich auf den dritten Teil meiner Signatur hinweisen ... Könntest Du dich bitte noch einmal darum bemühen, diesen Punkt klarer umzusetzen?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
spike0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Sa 29.10.05 21:46 
Wir haben die Funktion glBegin(). So, wir legen den Cursor zwischen die Klammern und drücken Strg + Leertaste. Dann kommt ein Hint "mode:variable" oder so. Das funktioniert, weil es in der OpenGL.dcu datei steht, oder? So, jetzt möchte ich so etwas auch bei meinem Programm einfügen, und deshalb möchte ich wissen, ob diese Datei mir behilflich sein könnte.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 29.10.05 22:00 
Nur bedingt, da das Format der DCU-Dateien nicht offen ist. Es gibt zwar Programme (DCUExplorer), die das DCU-Format lesen können, jedoch funktioniert das nur bedingt. Besser kommst Du, wenn Du PAS-Dateien als Eingaben nimmst, weil dann das Parsen um einiges einfacher ist ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Phobeus
ontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1280

Linux (FC6), WinXP Pro (Box)
D6 Pers, D7 Pro, FPC 2.x
BeitragVerfasst: So 30.10.05 09:54 
Und an diesem Punkt solltest Du Dich von den OpenGL-Headern von Borland trennen, da diese nicht sauber implementiert sind. wiki.delphigl.com/index.php/DGLOpenGL.pas Dort gibt es aktuelle Header von DGL, die als PAS-Datei vorliegen und damit auch dein Problem beheben. Bitte beachte, dass diese wie alle aktuellen Header initalisiert werden müssen. Beachte Bitte beiliegende Hilfen, Templates oder FAQ um diese korrekt in allen verwendeten Headern zu benutzten.

_________________
"Menschen sterben nicht wenn man sie zu Grabe trägt, sondern wenn sie ihre Träume verlieren..."
NeoInDerMATRIX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: So 30.10.05 17:32 
Hi,

@Phobeus: Machste gleich mal wieder Werbung für eure Header? *g*

@BenBE: Bist du dir sicher das er das so meint. Ich glaube das er eher diese Funktionalität in sein Programm implementieren möchte. Also ein editor der sowas kann. Korigiert mich wenn ich jetzt flasch liege. ;-)

CU
Neo
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 30.10.05 21:36 
user profile iconNeoInDerMATRIX hat folgendes geschrieben:
Hi,

@Phobeus: Machste gleich mal wieder Werbung für eure Header? *g*

@Neo: Machen wir doch auch nicht anders :mrgreen:

user profile iconNeoInDerMATRIX hat folgendes geschrieben:
@BenBE: Bist du dir sicher das er das so meint. Ich glaube das er eher diese Funktionalität in sein Programm implementieren möchte. Also ein editor der sowas kann. Korigiert mich wenn ich jetzt flasch liege. ;-)

CU
Neo

Jup. ich denk auch, dass er sowas in seinem Programm implementieren möchte. Daher hab ich ihn ja drauf hingewiesen, dass er von DCUs als Datenquelle abstand nehmen sollte und lieber PAS-Dateien selber parst. Das geht um vieles einfacher.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
spike0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Mo 31.10.05 17:20 
Die Datei hat mir weitergeholfen, jetzt brauche ich nur noch eine Sache:
Also, ich habe jetzt die ganzen Funktionen, GL-Typen und Variablen, z.B.:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
type
   TGLenum = Cardinal;;
   TGLfloat = Single;
            ...

  TglAccum = procedure(op: TGLenum; value: TGLfloat);
  TglAlphaFunc = procedure(func: TGLenum; ref: TGLclampf);
  TglAreTexturesResident = function(n: TGLsizei; const textures: PGLuint; residences: PGLboolean): TGLboolean;
            ...

var
  glAccum: TglAccum;
  glAlphaFunc: TglAlphaFunc;
  glAreTexturesResident: TglAreTexturesResident;
           ...


Ich möchte jetzt natürlich die Variablen einer Funktion rausbekommen, also z.b.:
Ich habe einen String s:
ausblenden Delphi-Quelltext
1:
s:=glAccum					

Jetzt möchte ich das hier bekommen (z.b. durch eine MessageBox oder ein TEdit):
"op: Cardinal; value: Single"
, also genau das gleiche, was in Delphi erscheint.

Wie kann ich das machen? Ich hab irgedwas mit "typeof" versucht (ist das richtig so?), aber ich hab das nicht so richtig geschafft :(
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 31.10.05 17:43 
Da das ganze teilweise in den Bereich Parserbau reinfällt, geb ich mal eine relativ primitive Lösung:

Programmiere dir 2 TStringLists mit folgender Nutzung:

SLTypes: Speichert die Deklarationszeile eines jeden unter Type aufgeführten Strings.
SLProcs: Jede unter VAR aufgeführte Deklarationszeile.

Als nächstes füllst Du die Listen so, dass Du jegliche Leerzeichen vor, nach der Zeile, sowie vor und nach dem =-Zeichen entfernst. Weiterhin ersetzt Du alle Doppelpunkte in SLProcs durch ein =. Das Semikolon am Ende einer Zeile entfernen.

Danach Prüfst Du, ob jede unter SLTypes aufgeführte Zeile eindeutig in SLProcs als Value enthalten ist.

D.h.

ausblenden Quelltext
1:
2:
glAccum=TglAccum
glAccum2=TglAccum


gäre ungültig und beide Einträge werden aus glProcs entfernt.

Danach führst Du SLTypes und SLProcs zusammen, indem Du für jeden verbliebenen Eintrag in SLProcs folgendes ausführst:

ausblenden Delphi-Quelltext
1:
SLProcs.Values[SLProcs.Names[Line]] := SLTypes.Values[SLProcs.Values[SLProcs.Names[Line]]];					


Nun enthält SLProcs.Values['glAccum'] die Deklaration von glAccum, die Du in ein Edit ausgeben kannst ;-)

That's it (Simple Version)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
spike0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Mo 31.10.05 20:40 
Also ich glaube, ich hab etwas falsch gemacht. Hier der ganze Quelltext:

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs;

type
  TForm1 = class(TForm)
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  TGLenum = Cardinal;
  TGLfloat = Single;
  TglAccum = procedure(op: TGLenum; value: TGLfloat);
  TglActiveTexture = procedure(texture: TGLenum);

var
  Form1: TForm1;
  glAccum: TglAccum;
  glActiveTexture: TglActiveTexture;
  SLTypes,SLProcs: tstringlist;
implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
SLTypes.Add('TglAccum=procedure(op: TGLenum; value: TGLfloat)'); //hier kommt ein Fehler
SLTypes.Add('TglActiveTexture=procedure(texture: TGLenum)');

SLProcs.Add('glAccum=TglAccum');
SLProcs.Add('glActiveTexture=TglActiveTexture');
SLProcs.Values[SLProcs.Names[0]] := SLTypes.Values[SLProcs.Values[SLProcs.Names[0]]];
end;

end.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 31.10.05 21:08 
Du musst eine Instanz vor der Nutzung immer erst erzeugen ...

ausblenden Delphi-Quelltext
1:
SLTypes := TStringList.Create;					

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
spike0 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77



BeitragVerfasst: Mo 31.10.05 21:19 
Oh man!! Ich vergesse das jedes Mal!!! Das Wichtigste aber: es funktioniert! Ich muss dann nur noch "procedure" wegmachen, und das schwierigste hab ich hinter mir...

Vielen Dank für alles!
NeoInDerMATRIX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: Di 01.11.05 18:55 
Hi,

kannst du den Titel bitte noch etwas aussage kräftiger gestalten, da das nicht wirklich sagt worum es hier geht.

@MODs: Gehört das dann eigentlich noch in die Sparte "Multimedia / Spiele / Grafik"?

Thx & Cu
Neo