AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Andorra - Imagelist.Add -> SIGSEGV
Thema durchsuchen
Ansicht
Themen-Optionen

Andorra - Imagelist.Add -> SIGSEGV

Ein Thema von Noobmaster · begonnen am 25. Jun 2011 · letzter Beitrag vom 28. Jun 2011
Antwort Antwort
Noobmaster

Registriert seit: 18. Jul 2010
114 Beiträge
 
FreePascal / Lazarus
 
#1

Andorra - Imagelist.Add -> SIGSEGV

  Alt 25. Jun 2011, 19:18
Hallo!

Folgender Quellcode erzeugt eine SIGSEGV Fehlermeldung
Delphi-Quellcode:
//-----FillImagelist
//-----fills in the imagelist with alle the necessary images/textures
procedure TMainForm.FillImagelist(path: String);
begin
   { Tables }
   if ImageList <> nil then
   begin
      with Imagelist.Add('Table_Blue') do
      begin
         Texture.LoadGraphicFromFile(path+'/Tische/blau.bmp');
      end;
      with Imagelist.Add('Table_Red') do
      begin
         Texture.LoadGraphicFromFile(path+'/Tische/rot.bmp');
      end;
      with Imagelist.Add('Table_Green') do
      begin
         Texture.LoadGraphicFromFile(path+'/Tische/gruen.bmp');
      end;
      ImageList.Restore; //very important line!
   end;
end;
Anschließend springt der Compiler in folgende Prozedur der Unit "AdDraws":
Delphi-Quellcode:
procedure TAdCustomImage.Initialize;
begin
  //Finalize the image, if it is still initialized
  Finalize;

  //Create a new mesh
  AdMesh := FParent.AdAppl.CreateMesh;
end;
Ein Eine Instanz des Typs "TAdDraw" ist erstellt und der Imagelist zugewiesen:
Delphi-Quellcode:
procedure TMainForm.FormCreate(Sender: TObject);
begin
   //Surface:
   Surface := TAdDraw.Create(MainForm); //creates the Surface
   Surface.DllName := 'AndorraOGLLaz.dll'; //Loads the Dll-library; based on OpenGL

   //SpriteEngine:
   SpriteEngine := TSpriteEngine.Create(nil);
   SpriteEngine.Surface := Surface;

   //Connect the main-loop of the application with the andorra-loop
   Application.OnIdle := @Idle;

   //Create ImageList and fill in the images:
   ImageList := TAdImageList.Create(Surface);
   FillImagelist('Data/Bilder');

   NewGame();
end;
Danke schonmal für die Hilfe...
  Mit Zitat antworten Zitat
Noobmaster

Registriert seit: 18. Jul 2010
114 Beiträge
 
FreePascal / Lazarus
 
#2

AW: Andorra - Imagelist.Add -> SIGSEGV

  Alt 28. Jun 2011, 09:10
Hallo!

Das Problem tritt jetzt auch allgemein auf, wenn ich meiner AdImagelist ein Bild hinzufügen möchte:

Delphi-Quellcode:
procedure TMainForm.FormCreate(Sender: TObject);
begin
   //Surface:
   Surface := TAdDraw.Create(MainForm); //creates the Surface
   Surface.DllName := 'AndorraOGLLaz.dll'; //Loads the Dll-library; based on OpenGL

   //SpriteEngine:
   SpriteEngine := TSpriteEngine.Create(nil);
   SpriteEngine.Surface := Surface;

   //Connect the main-loop of the application with the andorra-loop
   Application.OnIdle := Idle;

   //Create ImageList and fill in the images:
   AdImageList := TAdImageList.Create(Surface);
   with AdImageList.Add('test') do
      Texture.LoadGraphicFromFile('Bilder/Data/Kugeln/Kugel1.bmp');
   //FillImagelist('Data/Bilder');

   NewGame();
end;
  Mit Zitat antworten Zitat
Progman

Registriert seit: 31. Aug 2007
Ort: 99974 MHL
695 Beiträge
 
Delphi 10.1 Berlin Starter
 
#3

AW: Andorra - Imagelist.Add -> SIGSEGV

  Alt 28. Jun 2011, 10:57
Du hast ein TAdDraw mit dem Namen "Surface"?
Diesen Namen vielleicht mal ändern, denn TAdDraw hat ebenfralls intern ein Surface. Vielleicht ist es ja nur der Namenskonflikt?
"Surface" mal durch "myDraw" (oder was du willst) ersetzen?
Karl-Heinz
Populanten von Domizilen mit fragiler, transparenter Aussenstruktur sollten sich von der Translation von gegen Deformierung resistenter Materie distanzieren!
(Wer im Glashaus sitzt sollte nicht mit Steinen werfen)

Geändert von Progman (28. Jun 2011 um 17:51 Uhr)
  Mit Zitat antworten Zitat
Noobmaster

Registriert seit: 18. Jul 2010
114 Beiträge
 
FreePascal / Lazarus
 
#4

AW: Andorra - Imagelist.Add -> SIGSEGV

  Alt 28. Jun 2011, 12:14
Delphi-Quellcode:
procedure TMainForm.FormCreate(Sender: TObject);
begin
   //Surface:
   AdDraw := TAdDraw.Create(MainForm); //creates the Surface
   AdDraw.DllName := 'AndorraOGLLaz.dll'; //Loads the Dll-library; based on OpenGL

   //SpriteEngine:
   SpriteEngine := TSpriteEngine.Create(nil);
   SpriteEngine.Surface := AdDraw;

   //Connect the main-loop of the application with the andorra-loop
   Application.OnIdle := Idle;

   //Create ImageList and fill in the images:
   AdImageList := TAdImageList.Create(AdDraw);
   with AdImageList.Add('test') do
      Texture.LoadGraphicFromFile('Bilder/Data/Kugeln/Kugel1.bmp');
   //FillImagelist('Data/Bilder');

   //NewGame();
end;
Danke für die Antwort, aber es tritt immer noch der selbe Fehler auf...
  Mit Zitat antworten Zitat
Antwort Antwort


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 20:22 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