dev.gamez.lv Forum Index dev.gamez.lv
Latvian Game Developers Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 

Nepieciešama palīdzība.

 
dev.gamez.lv Forum Index -> Iesācējiem
View previous topic :: View next topic  
Author Message
Vecis



Joined: 01 Jan 2007
Posts: 144

PostPosted: Fri May 11, 2007 1:29 pm    Post subject: Nepieciešama palīdzība.

Lasot ra001 apmācību iekš delphiX saskāros ar problēmu, kodā ir kļūda
Pasvītrošu tekstu kur rāda ka ir kļūda
Code:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DXClass, DXSounds, DXDraws;

type
  TForm1 = class(TDXForm)
    DXDraw1: TDXDraw;
    DXTimer1: TDXTimer;
    procedure DXDraw1Initialize(Sender: TObject);
    procedure DXDraw1Finalize(Sender: TObject);
    procedure DXTimer1Timer(Sender: TObject; LagCount: Integer);

  private
    Procedure DoDXDraw(LagCount: Integer);
    end;
  public
    { Public declarations }
 [u] end; [/u]

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.DXDraw1Initialize(Sender: TObject);
begin
DXTimer1.Enabled := True;
end;

procedure TForm1.DXDraw1Finalize(Sender: TObject);
begin
DXTimer1.Enabled := False;
end;

procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
 //Šitais te izdzēš visu iepriekš uzzīmēt
         DXDraw1.Surface.Fill(0);
         //Virtuāla procedūra spritu zīmēšana
         DoDXDraw(LagCount);
         //Šitais pārslēdz ekrāna buferi uz nupat uzzīmēto
         DXDraw1.Flip;
end;
   procedure DoDXDraw(LagCount: Integer);
      begin
      end;

end.
Back to top
View user's profile Send e-mail
ra001
Site Admin
Site Admin


Joined: 20 Jan 2003
Posts: 452
Location: Latvija

PostPosted: Fri May 11, 2007 2:18 pm    Post subject:

Code:
type
....

  private
    Procedure DoDXDraw(LagCount: Integer);
    end;  //Shito endu izdzēs
  public
    { Public declarations }
 end;
Back to top
View user's profile Send e-mail Visit poster's website
Vecis



Joined: 01 Jan 2007
Posts: 144

PostPosted: Fri May 11, 2007 2:22 pm    Post subject:

Izdzēsu, tagad rāda ka kļūda ir
Procedure DoDXDraw(LagCount: Integer);
Back to top
View user's profile Send e-mail
ra001
Site Admin
Site Admin


Joined: 20 Jan 2003
Posts: 452
Location: Latvija

PostPosted: Fri May 11, 2007 2:42 pm    Post subject:

Vismaz kļūdas aprakstu uzraksti.
Back to top
View user's profile Send e-mail Visit poster's website
bubu
Indago Uzvarētājs
Indago Uzvarētājs


Joined: 23 Mar 2004
Posts: 3223
Location: Riga

PostPosted: Fri May 11, 2007 4:02 pm    Post subject:

Sen neesmu Delphi programējis, bet vai aiz private un public nav koli jāliek?

Bet tiešām, ieraksti kļūdas paziņojumu!
Back to top
View user's profile Send e-mail
ra001
Site Admin
Site Admin


Joined: 20 Jan 2003
Posts: 452
Location: Latvija

PostPosted: Fri May 11, 2007 4:08 pm    Post subject:

bubu wrote:
Sen neesmu Delphi programējis, bet vai aiz private un public nav koli jāliek?


Nē nav.
Es tos piemērus pārrakstīju webā tā teikt ar roku, tā kā tur daudz kaut kādu drukas kļūdu varētu būt.
Back to top
View user's profile Send e-mail Visit poster's website
Vecis



Joined: 01 Jan 2007
Posts: 144

PostPosted: Fri May 11, 2007 5:05 pm    Post subject:

Back to top
View user's profile Send e-mail
Kamazs
Guru
Guru


Joined: 17 Jan 2003
Posts: 829
Location: The glorious ancient city of Loja

PostPosted: Fri May 11, 2007 5:17 pm    Post subject:

Ja tu to deklarē pie private tad taa ir TFrame funkcija, taadeelj kodaa to vajag arii deklareet kaa tframe klases funkciju.

Code:

procedure TForm1.DXTimer1Timer(Sender: TObject; LagCount: Integer);
begin
 //Šitais te izdzēš visu iepriekš uzzīmēt
         DXDraw1.Surface.Fill(0);
         //Virtuāla procedūra spritu zīmēšana
         DoDXDraw(LagCount);
         //Šitais pārslēdz ekrāna buferi uz nupat uzzīmēto
         DXDraw1.Flip;
end;

   procedure TForm1.DoDXDraw(LagCount: Integer);
      begin
      end;

end.


Alternatīva ir to sākumā deklarēt ārpus type..end;.
_________________
...un es uzskatu, ka Fallout ir etalons
Back to top
View user's profile Send e-mail Visit poster's website
ra001
Site Admin
Site Admin


Joined: 20 Jan 2003
Posts: 452
Location: Latvija

PostPosted: Fri May 11, 2007 5:26 pm    Post subject:

Vispār arī tutoriāli rakstīju - nospied shift+ctrl+c un automātiski būtu jānoģenerējas definētām procedūrām. Bet izskatās, ka pirms raksti iepazīsties ar Delfi pamatiem, jo tie man tutoriālos nav izskaidroti.
Back to top
View user's profile Send e-mail Visit poster's website
Vecis



Joined: 01 Jan 2007
Posts: 144

PostPosted: Fri May 11, 2007 5:29 pm    Post subject:

Delphi vai delphiX pamatiem?
īsti labas adreses kur tie pamati būtu īpaši smalki aprakstīti neesmu.
Pagaidām skatos tikai delphigamedev.com un tavā saitā.
Back to top
View user's profile Send e-mail
ra001
Site Admin
Site Admin


Joined: 20 Jan 2003
Posts: 452
Location: Latvija

PostPosted: Sat May 12, 2007 10:46 am    Post subject:

Vecis wrote:
Delphi vai delphiX pamatiem?

Delphi, jo DelphiX esmu nedaudz aprakstījis. Bet vispār šīs komponentes ir diezgan novecojušas un vajadzētu skatīties uz ko jaunāku un prograsīvāku
Back to top
View user's profile Send e-mail Visit poster's website
Vecis



Joined: 01 Jan 2007
Posts: 144

PostPosted: Sat May 12, 2007 12:34 pm    Post subject:

Kaut cik jau no paša Delphi zinu tikai nezinu vai tas ir pietiekami (māku izveidot teksta redaktoru un tādus mēslus...)
Back to top
View user's profile Send e-mail
Display posts from previous:   
dev.gamez.lv Forum Index -> Iesācējiem All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group