⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bcuearthpong.h

📁 这是用C++BUILDER编写的开发3D界面的小程序
💻 H
字号:
//---------------------------------------------------------------------------
#ifndef BCUEarthPongH
#define BCUEarthPongH
//---------------------------------------------------------------------------
#include <vcl\Classes.hpp>
#include <vcl\Controls.hpp>
#include <vcl\StdCtrls.hpp>
#include <vcl\Forms.hpp>
#include <ddraw.h>
#include <vcl\ExtCtrls.hpp>
#include "ddutil.h"

#define NUM_GLOBE_SPRITES 38
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TLabel *Label1;
	void __fastcall FormActivate(TObject *Sender);
    void __fastcall FormKeyPress(TObject *Sender, char &Key);
    void __fastcall FormMouseMove(TObject *Sender, TShiftState Shift, int X,
    int Y);
    void __fastcall FormCreate(TObject *Sender);
private:	// User declarations
	IDirectDraw* DirectDraw;
    IDirectDrawSurface* PrimaryCanvas;
    IDirectDrawSurface* AttachedCanvas;
    IDirectDrawSurface* Globe[NUM_GLOBE_SPRITES], *Paddle;
    IDirectDrawPalette* GlobePalette, *PaddlePalette;
    IDirectDrawSurface* BackgroundCanvas, *NumHitsCanvas;
    IDirectDrawPalette* BackgroundPalette;
    int frame, xDir, yDir, globeX, globeY, dir, paddleX, paddleY, hits;
    bool EvenFrame;

public:		// User declarations
	__fastcall TForm1(TComponent* Owner);
    void __fastcall InitializeDirectDraw();
    void __fastcall IdleLoop(TObject *Sender, bool &done);
    void __fastcall SetupPrimaryCanvas();
    void __fastcall LoadArt();
    void __fastcall LoadBackgroundArt();
    void __fastcall LoadSprites();
    void __fastcall DisplayError(char* error);
};
//---------------------------------------------------------------------------
extern TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -