screen.h

来自「俄罗斯方块,适于sdk初学者参考学习」· C头文件 代码 · 共 51 行

H
51
字号
//screen.h
//screen 类支持游戏的显示

#if !defined(AFX_SCREEN_H__17DE89E2_E929_4C7C_A31B_FE514F7F8711__INCLUDED_)
#define AFX_SCREEN_H__17DE89E2_E929_4C7C_A31B_FE514F7F8711__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "diamond.h"
#include "draw.h"

class screen  
{
public:
	screen(int left,int top,int width,int height,int scalewidth,int scaleheight,HWND hwnd,HDC memdc,int backcolor);
	virtual ~screen();
    void clear();
    void refresh(const map &,int top,int bottom);
    
	int width() const{ return m_width;};
	int height() const{ return m_height;};
    int scalewidth() const{return m_scalewidth;};
	int scaleheight() const{return m_scaleheight;};
    int getleft() const{return m_left;};
	int gettop() const{return m_top;};
    
	int drawdiamond(const diamond &thediamond);
	int drawfreezediamond(const diamond &thediamond);
	int cleardiamond(const diamond &thediamond);
    void drawdiamondoperate(int x,int y,int color);

	
private:
	draw   *m_draw;
	HWND   m_hwnd;
	HDC    m_memdc;
	int    m_left;
	int    m_top;
	int    m_width;
	int    m_height;
	int    m_scalewidth;
	int    m_scaleheight;
	int    m_unitwidth;
	int    m_unitheight;
    int    m_backcolor;
};

#endif // !defined(AFX_SCREEN_H__17DE89E2_E929_4C7C_A31B_FE514F7F8711__INCLUDED_)

⌨️ 快捷键说明

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