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

📄 bheader.h

📁 用VC++及DirectX实现的SuperMario小游戏
💻 H
字号:
/*
Author: Bear

This source is free to anybody.
If you have any problem with this or some advice to me, please:
    mailto: heyang22118952.student@sina.com
        or  yang45249.student@sina.com
or you can contact me through my QQ:     261570581

Welcome to discuss game programming techniques with me :)
And I like to play games!
*/
#pragma once

#define WIN32_LEAN_AND_MEAN

#define INITGUID

#include <windows.h>
#include <windowsx.h>
#include <malloc.h>
#include <memory.h>
#include <io.h>
#include <stdio.h>
#include <fcntl.h>
#include <math.h>
#include <assert.h>
#include <mmsystem.h>

#include <ddraw.h>
//disable error message "DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800"
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>
#include <dsound.h>
#include <dxerr8.h>

#define DD_INIT_STRUCT(s) {memset((void*)&s, 0, sizeof(s));s.dwSize = sizeof(s);}
#define KEY_DOWN(vkCode) ((GetAsyncKeyState(vkCode)&0x8000) ? 1 : 0)
#define KEY_UP(vkCode) ((GetAsyncKeyState(vkCode)&0x8000) ? 0 : 1)
// this builds a 16 bit color value in 5.5.5 format (1-bit alpha mode)
#define _RGB16BIT555(r,g,b) ((b & 31) + ((g & 31) << 5) + ((r & 31) << 10))
// this builds a 16 bit color value in 5.6.5 format (green dominate mode)
#define _RGB16BIT565(r,g,b) ((b & 31) + ((g & 63) << 5) + ((r & 31) << 11))
// this builds a 32 bit color value in A.8.8.8 format (8-bit alpha mode)
#define _RGB32BIT(a,r,g,b) ((b) + ((g) << 8) + ((r) << 16) + ((a) << 24))
// pi defines
#define PI         ((float)3.141592654f)
#define PI2        ((float)6.283185307f)
#define PI_DIV_2   ((float)1.570796327f)
#define PI_DIV_4   ((float)0.785398163f) 
#define PI_INV     ((float)0.318309886f) 
//mouse input defines
#define MOUSE_LEFT_BUTTON 0
#define MOUSE_RIGHT_BUTTON 1
#define MOUSE_MIDDLE_BUTTON 2

#ifndef BDLL_API
#define BDLL_API _declspec(dllimport)
#endif

⌨️ 快捷键说明

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