[表示 : 全て 最新50 1-99 101- 201- 301- 401- 501- 601- 701- 2chのread.cgiへ]
Update time : 05/09 17:51 / Filesize : 171 KB / Number-of Response : 726
[このスレッドの書き込みを削除する]
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧] [類似スレッド一覧]


↑キャッシュ検索、類似スレ動作を修正しました、ご迷惑をお掛けしました

ドラゴンクエストクローンを作ろう



1 名前:dq [03/03/01 02:44 ID:A/IG49Gl]
ドラゴンクエストクローンを作ろう

19 名前:名前は開発中のものです。 mailto:sage [03/03/03 07:04 ID:pxhSxl9y]
>>15
DirectDrawでのTCanvasの使い方がなっていない。
WindowsAPIを使うなどとは・・・。
以下のようなクラスを作って

interface
uses
  Windows, Graphics, DirectX;
type
  TDirectDrawCanvas = class(TCanvas)
  protected
    FSurface: IDirectDrawSurface;
    FDeviceContext: HDC;
    FEnabled: Boolean;
    procedure CreateHandle; override;
  public
    constructor Create(ASurface: IDirectDrawSurface);
    destructor Destroy; override;

    procedure Release;
    property Enabled: Boolean read FEnabled;
  end;

implementation



20 名前:名前は開発中のものです。 mailto:sage [03/03/03 07:05 ID:pxhSxl9y]
開業多すぎうざい。連投規制に引っかかるかも知れんので続きは後になるかも
{ TDirectDrawCanvas }
constructor TDirectDrawCanvas.Create(ASurface: IDirectDrawSurface);
begin
  inherited Create;
  FSurface := ASurface;
  FDeviceContext := 0;
  FEnabled := ASurface.IsLost = DD_OK;
end;

destructor TDirectDrawCanvas.Destroy;
begin
  Release;
  inherited;
end;

procedure TDirectDrawCanvas.Release;
begin
 if FDeviceContext <> 0 then begin
    Handle := 0;
    FSurface.ReleaseDC(FDeviceContext);
    FDeviceContext := 0;
  end;
end;

21 名前:名前は開発中のものです。 mailto:sage [03/03/03 07:08 ID:pxhSxl9y]
procedure TDirectDrawCanvas.CreateHandle;
begin
  if FDeviceContext = 0 then begin
    FEnabled := FSurface.GetDC(FDeviceContext) = DD_OK;
    if FEnabled then
      Handle := FDeviceContext
    else begin
      Handle := 0;
      FDeviceContext := 0;
    end;
  end;
end;

使い方は
 Canvas := TCanvas.Create(BackBufferSurface);
しておいて
 with Canvas do
  if Enabled then try
   Pen.Style := psSolid;
   :
  finally
   Release;
  end;






[ 続きを読む ] / [ 携帯版 ]

次100 最新50 [ このスレをブックマーク! 携帯に送る ] 2chのread.cgiへ
[+板 最近立ったスレ&熱いスレ一覧 : +板 最近立ったスレ/記者別一覧]( ´∀`)<171KB

read.cgi ver5.27 [feat.BBS2 +1.6] / e.0.2 (02/09/03) / eucaly.net products.
担当:undef