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

📄 graphicstuff.c

📁 一个炸弹人游戏的源代码(win32 application)
💻 C
字号:
//Creates a new bitmap to draw to
void InitGraph ()
{
  //Set up bitmap info header for 272x272x24 buffer
  BitmapInfo.bmiHeader.biSize = sizeof (BITMAPINFOHEADER);
  BitmapInfo.bmiHeader.biPlanes = 1;
  BitmapInfo.bmiHeader.biBitCount = 24;
  BitmapInfo.bmiHeader.biCompression = BI_RGB;
  BitmapInfo.bmiHeader.biSizeImage = 0;
  BitmapInfo.bmiHeader.biClrUsed = 0;
  BitmapInfo.bmiHeader.biClrImportant = 0;
  BitmapInfo.bmiHeader.biWidth = 272;
  BitmapInfo.bmiHeader.biHeight = 272;
  //Create Device Independent Bitmap
  MainDC = CreateCompatibleDC (NULL);
  BackDC = CreateCompatibleDC (NULL);
  MainBitmap = CreateDIBSection (MainDC, &BitmapInfo, DIB_RGB_COLORS, &MainBitmapData, NULL, 0);
  BackBitmap = CreateDIBSection (BackDC, &BitmapInfo, DIB_RGB_COLORS, &BackBitmapData, NULL, 0);
  SelectObject (MainDC, MainBitmap);
  SelectObject (BackDC, BackBitmap);
  //Create device context for screen
  ScreenDC = GetDC (WindowHandle);
}

//Return old bitmap
void CloseGraph ()
{
  DeleteDC (MainDC);
  DeleteDC (BackDC);
}

⌨️ 快捷键说明

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