亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? main.cpp

?? c++ builder unleased 5源代碼
?? CPP
字號:
/*
  This is a DirectDraw example program. DirectDraw programs require that you
  have the DirectDraw runtime on your system. The runtime files are available
  from Microsoft's web site, though many machines will have them on them
  already, as they ship with a wide variety of products, including games, the
  future operating systems Windows 98 and Windows NT 5.0. If you are using NT 4,
  you should upgrade to at least Service Pack 3, so that you can have access
  to DirectDraw 3.0, which is part of that Service Pack. Don't
  try to install the DirectDraw runtime on a Windows NT system, instead, get
  the latest Service Pack. The runtime install is meant only for Windows 95 or
  98. One way to tell if you have DirectDraw on your system is to look in the
  Windows/System directory or Winnt/System32 directory for the files DDRAW.DLL
  and DSOUND.DLL.

  The purpose of DirectDraw is to allow you to perform very fast graphics
  operations inside the Windows environment. In particular, DirectDraw can
  give you direct access to the video buffers on a video card. For best
  results, you should have at least 2 MB of memory on your video card.
  DirectDraw allows you to create a backbuffer, draw to it, and then
  flip it to the visible area in your video memory. Assuming that you are
  in exclusive mode, and have enough video memory to keep both your primary
  surface and back surface in video RAM, then the flip operation is
  not a copy procedure, but simply changes the address of the block of
  memory referenced by the visible area of your video card's memory. In short
  the operation is very fast, and is guarenteed to happen in sync with
  the refresh operations on your monitor. As a result, you can use DirectDraw
  to perform very smooth animations. For a complete explanation, go to the
  DirectDraw area on Microsoft's web site, or visit my web site at
  http://users.aol.com/charliecal.

  The code shown here is the simplest possible DirectDraw program. It is
  modeled closely after the DDX1 example that ships with the Microsoft's
  DirectDraw SDK. I've simply taken their program, and rewritten it to
  compile under a form based environment. In particular, the code uses a
  TTimer object rather than calling SetTimer, and it responds to events
  such as OnKeyDown rather than directly handling WM_KEYDOWN messages.
  The conversion to a form based paradigm makes the code easier to read,
  but doesn't change its underlying structure.

  If you do not want to use forms, the DDX1 program will compile unchanged
  under CBuilder. Simply start a standard CBuilder project, remove the main
  form, then replace the code in the Project Source with the code from
  DDX1.cpp, which file ships with Microsoft's SDK. Press compile, and the
  program will run fine.

  The code in this project has five methods:

  CONSTRUCTOR:
    Perform trivial initialization of variables.

  FORMDESTROY:
    Destroy the direct draw surfaces created in the Start method.

  START:
    Call DirectDrawCreate, which initializes DirectDraw, and returns a pointer
      to a DirectDraw object.
    Call SetCooperativeLevel to switch into exclusive mode.
    Call SetDisplayMode to switch to 640X480 8 bit resolution.
    Call CreateSurface to create a primary surface
    Call GetAttachedSurface to get a pointer to the back surface
    Paint the front and back surface to black, and paint text to each
      so you can recognize them when they are flipped to the screen.
    Enable the timer.

  FORMKEYDOWN:
    Respond to key presses designating the user's desire to switch into
      exclusive mode and begin the demo.
    Respond to the F12 or Esc keys by shutting down the application.

  FORMPAINT:
    Paint some simple instructions for the user in the middle of the screen.
    This method is not called while the program is in Exclusive mode.

  TIMER1TIMER:
    Flip between the primary and back surfaces. This is the key method in this
    demo as it shows how to swap two different surfaces, which is what you
    want to do in an animated graphics program. This method is somewhat
    misleading, though, because most of the time you will want to swap at
    the fastest rate possible, rather than waiting for the timer to call
    your program and ask you to swap. For instance, a smooth animation
    should have a frame rate of at least 25 frames per second, a rate which
    is not practical to achieve using a timer.

*/

// Includes 
#include <vcl.h>
#include <ddraw.h>
#pragma hdrstop
#include "Main.h"
#pragma resource "*.dfm"

//Const
#define TIMER_ID        1
#define TIMER_RATE      500

// Global Variables
TFormMainDirectDraw *FormMainDirectDraw;
//TForm1 *Form1;

///////////////////////////////////////
// Constructor
///////////////////////////////////////
__fastcall TFormMainDirectDraw::TFormMainDirectDraw(TComponent* Owner)
        : TForm(Owner)
{
  lpDD = NULL;
  phase = 0;
  bActive = false;
  FrontMsg = "Front buffer (F12 or Esc to quit)";
  BackMsg = "Back buffer (F12 or Esc to quit)";
}

///////////////////////////////////////
// WM_DESTROY messages
///////////////////////////////////////
void __fastcall TFormMainDirectDraw::FormDestroy(TObject *Sender)
{
  if( lpDD != NULL )
  {
    if( lpDDSPrimary != NULL )
    {
      lpDDSPrimary->Release();
      lpDDSPrimary = NULL;
    }
    lpDD->Release();
    lpDD = NULL;
  }
}
///////////////////////////////////////
// Initialize DirectDraw
///////////////////////////////////////
void __fastcall TFormMainDirectDraw::Start()
{
  HRESULT ddrval;
  DDSURFACEDESC ddsd;
  DDSCAPS ddscaps;
  HDC DC;
  char buf[256];
  ddrval = DirectDrawCreate( NULL, &lpDD, NULL );
  if( ddrval == DD_OK )
  {
    // Get exclusive mode
    ddrval = lpDD->SetCooperativeLevel( Handle, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN );
    if( ddrval == DD_OK )
    {
      ddrval = lpDD->SetDisplayMode(640, 480, 8);
      if(ddrval == DD_OK)
      {
        // Create the primary surface with 1 back buffer
        ddsd.dwSize = sizeof( ddsd );
        ddsd.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
        ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_FLIP | DDSCAPS_COMPLEX;
        ddsd.dwBackBufferCount = 1;
        ddrval = lpDD->CreateSurface( &ddsd, &lpDDSPrimary, NULL );
        if( ddrval == DD_OK )
        {
          // Get a pointer to the back buffer
          ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
          ddrval = lpDDSPrimary->GetAttachedSurface( &ddscaps, &lpDDSBack );
          if( ddrval == DD_OK )
          {
            // draw some text.
            if( lpDDSPrimary->GetDC( &DC ) == DD_OK )
            {
              SetBkColor( DC, RGB( 0, 0, 255 ) );
              SetTextColor( DC, RGB( 255, 255, 0 ) );
              TextOut( DC, 0, 0, FrontMsg.c_str(), FrontMsg.Length() );
              lpDDSPrimary->ReleaseDC( DC );
            }
            if( lpDDSBack->GetDC( &DC ) == DD_OK )
            {
              SetBkColor( DC, RGB( 0, 0, 255 ) );
              SetTextColor( DC, RGB( 255, 255, 0 ) );
              TextOut( DC, 0, 0, BackMsg.c_str(), BackMsg.Length() );
              lpDDSBack->ReleaseDC( DC );
            }
            // Create a timer to flip the pages
            TimerStart->Enabled = true;
            bActive = true;
            return;
          }
        }
      }
    }
  }
  wsprintf( buf, "Direct Draw Init Failed (%08lx)\n", ddrval );
  MessageBox( Handle, buf, "ERROR", MB_OK );
  Close();
}

///////////////////////////////////////
// WM_KEYDOWN messages
///////////////////////////////////////
void __fastcall TFormMainDirectDraw::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
{
   switch( Key )
   {
     case VK_F3:  Start(); break;
     case VK_ESCAPE:
     case VK_F12: Close(); break;
   }
}
///////////////////////////////////////
// WM_PAINT messages
///////////////////////////////////////
void __fastcall TFormMainDirectDraw::FormPaint(TObject *Sender)
{
  RECT rc;
  SIZE size;
  char szMsg[] = "Page Flipping Test: Press F3 to start, F12 or Esc to exit";
  if (!bActive)
  {
    HDC DC = GetDC( Handle );
    rc = GetClientRect();
    GetTextExtentPoint( DC, szMsg, lstrlen( szMsg ), &size );
    SetBkColor( DC, RGB( 0, 0, 0 ) );
    SetTextColor( DC, RGB( 255, 255, 0 ) );
    TextOut( DC, ( rc.right - size.cx ) / 2, ( rc.bottom - size.cy ) / 2, szMsg, sizeof( szMsg ) - 1 );
    ReleaseDC( Handle, DC );
  }
}
///////////////////////////////////////
// WM_TIMER messages
///////////////////////////////////////
void __fastcall TFormMainDirectDraw::TimerStartTimer(TObject *Sender)
{
  HDC DC;
  if( lpDDSBack->GetDC( &DC ) == DD_OK )
  {
    if( phase )
    {
      SetBkColor( DC, RGB( 0, 0, 255 ) );
      SetTextColor( DC, RGB( 255, 255, 0 ) );
      TextOut( DC, 0, 0, FrontMsg.c_str(), FrontMsg.Length() );
      phase = 0;
    }
    else
    {
      SetBkColor( DC, RGB( 0, 0, 255 ) );
      SetTextColor( DC, RGB( 0, 255, 255 ) );
      TextOut( DC, 0, 0, BackMsg.c_str(), BackMsg.Length() );
      phase = 1;
    }
    lpDDSBack->ReleaseDC( DC );
  }
  while( 1 )
  {
    HRESULT ddrval;
    ddrval = lpDDSPrimary->Flip( NULL, 0 );
    if( ddrval == DD_OK )  break;
    if( ddrval == DDERR_SURFACELOST )
    {
      ddrval = lpDDSPrimary->Restore();
      if( ddrval != DD_OK )  break;
    }
    if( ddrval != DDERR_WASSTILLDRAWING )  break;
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91在线免费播放| 中日韩av电影| 中文字幕欧美激情| 一区二区成人在线| 国产乱子伦视频一区二区三区| 成人动漫av在线| 精品国产一二三| 香蕉成人啪国产精品视频综合网| 国产精品 欧美精品| 在线不卡免费av| 亚洲视频一区二区免费在线观看| 黄色资源网久久资源365| 欧美日韩精品高清| 亚洲你懂的在线视频| 国产精品69久久久久水密桃| 91精品在线免费| 一区二区三区小说| 国产·精品毛片| 久久免费美女视频| 日韩av网站在线观看| 欧美午夜不卡视频| 亚洲综合一区二区三区| 99久久综合狠狠综合久久| 久久免费国产精品 | 欧美一级在线观看| 亚洲精品国产品国语在线app| 国产成人三级在线观看| 中文字幕一区二区三区不卡在线 | 亚洲精品ww久久久久久p站| 国产成人自拍网| 国产偷v国产偷v亚洲高清| 国内一区二区在线| 久久伊人中文字幕| 精品一区二区三区免费播放| 日韩精品一区二区三区在线观看| 日本不卡一区二区| 欧美一级免费观看| 久久99九九99精品| 亚洲精品一区二区三区精华液| 久久电影国产免费久久电影| 精品sm在线观看| 国产麻豆一精品一av一免费| 中文av字幕一区| 色综合一区二区| 亚洲大片在线观看| 日韩欧美亚洲国产另类| 国产精品主播直播| 国产精品久久久久aaaa| 色综合天天综合网国产成人综合天| 国产精品灌醉下药二区| 欧美专区在线观看一区| 天天影视色香欲综合网老头| 精品国产制服丝袜高跟| 成人一级视频在线观看| 亚洲国产精品久久久久婷婷884 | 亚洲一区在线看| 欧美精品精品一区| 国产麻豆视频一区| 亚洲美女免费视频| 欧美一区二区三区在线| 国产乱国产乱300精品| 国产精品久久久久久久久免费相片 | 亚洲另类在线视频| 666欧美在线视频| 国产精品中文字幕日韩精品 | 麻豆91精品91久久久的内涵| www欧美成人18+| 在线观看亚洲精品| 国产成人亚洲综合a∨猫咪| 亚洲人123区| 亚洲精品在线三区| 欧美色涩在线第一页| 黑人巨大精品欧美一区| 夜夜嗨av一区二区三区网页| 日韩精品一区二区三区在线| 色狠狠综合天天综合综合| 欧美aa在线视频| 韩日精品视频一区| 1区2区3区国产精品| 5566中文字幕一区二区电影| 成人激情开心网| 精品一区二区三区久久| 亚洲影院理伦片| 国产精品免费久久| 精品国精品自拍自在线| 欧美日本不卡视频| 波多野结衣中文字幕一区二区三区| 日本成人中文字幕在线视频 | 色香色香欲天天天影视综合网 | 亚洲v中文字幕| 中文字幕一区二区三区不卡 | 亚洲免费观看高清| 久久久久国产精品免费免费搜索| 欧美色爱综合网| av电影天堂一区二区在线| 国产精品一区二区在线观看不卡| 日韩影院在线观看| 亚洲国产日韩a在线播放性色| 国产欧美一区二区精品仙草咪 | 国产一区二区看久久| 奇米影视7777精品一区二区| 一区二区三区国产精华| 国产精品久久久久久户外露出| 久久亚区不卡日本| 欧美成人猛片aaaaaaa| 日韩一区二区精品在线观看| 欧美视频自拍偷拍| 欧美日韩午夜精品| 欧美日韩免费一区二区三区视频 | 不卡的av在线播放| 成人免费看片app下载| 国产精品99久久久久久宅男| 精品中文字幕一区二区小辣椒| 日韩av一级电影| 久久99精品国产.久久久久久| 日本三级亚洲精品| 理论片日本一区| 久久不见久久见免费视频1| 久久不见久久见免费视频1| 精品写真视频在线观看| 国产一区二区三区久久久| 国产精品1024| 成人动漫av在线| 欧美又粗又大又爽| 717成人午夜免费福利电影| 日韩精品在线一区| 国产欧美日韩精品在线| 国产精品卡一卡二| 亚洲与欧洲av电影| 三级一区在线视频先锋 | 日韩在线卡一卡二| 久久精品国产亚洲高清剧情介绍| 蜜芽一区二区三区| 国产剧情一区二区三区| 不卡一区二区三区四区| 色哟哟一区二区三区| 欧美一区二区三区啪啪| 久久综合久久鬼色| 中文字幕在线一区二区三区| 一区二区三区精品在线观看| 天堂成人国产精品一区| 激情综合五月天| 波多野结衣亚洲| 欧美精品v国产精品v日韩精品| 欧美电影免费观看高清完整版在 | 欧美成人欧美edvon| 久久久亚洲精华液精华液精华液| 欧美激情一区三区| 亚洲综合自拍偷拍| 黑人精品欧美一区二区蜜桃 | 一区二区三区在线观看网站| 日本不卡视频在线| 处破女av一区二区| 欧美日韩一区在线| 中文字幕欧美国产| 日韩成人一区二区| 99久久综合99久久综合网站| 这里只有精品视频在线观看| 国产精品久久久久永久免费观看| 午夜精品久久久久久久久久久| 国产米奇在线777精品观看| 91极品美女在线| 久久久久久久久久电影| 视频一区在线视频| 91影院在线免费观看| 欧美mv日韩mv亚洲| 亚洲永久免费av| caoporn国产精品| 日韩欧美国产一区二区三区| 亚洲色图19p| 国产a区久久久| 欧美一区二区啪啪| 一区二区三区日韩| 成人av动漫网站| 国产亚洲欧美中文| 久久成人免费电影| 欧美精品久久99久久在免费线 | 麻豆久久一区二区| 日本精品一区二区三区高清 | 91免费国产在线| 久久影院午夜论| 久久国内精品自在自线400部| 国产精品欧美经典| 韩国精品免费视频| 国产三级欧美三级日产三级99| 亚洲成人7777| 欧美极品美女视频| 国产一区美女在线| 亚洲精品菠萝久久久久久久| 日韩电影一区二区三区四区| 国产一区二区三区四| 国产在线一区二区| 成人免费视频视频| 久久久国产精品麻豆| 国内欧美视频一区二区| 日韩精品中文字幕在线不卡尤物 | 国产精品美女久久久久久久 | 视频一区视频二区中文| 欧美艳星brazzers| 亚洲一区中文日韩|