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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? demo4_4.cpp

?? 一本外國人寫的關(guān)于3D游戲編程的書的源碼
?? CPP
字號(hào):
// DEMO4_4.CPP  - Ellipse Animation Demo

// INCLUDES ///////////////////////////////////////////////
#define WIN32_LEAN_AND_MEAN  // just say no to MFC

#include <windows.h>   // include all the windows headers
#include <windowsx.h>  // include useful macros
#include <mmsystem.h>  // very important and include WINMM.LIB too!
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

// DEFINES ////////////////////////////////////////////////

// defines for windows 
#define WINDOW_CLASS_NAME "WINCLASS1"

#define WINDOW_WIDTH  400
#define WINDOW_HEIGHT 300

// MACROS /////////////////////////////////////////////////

#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEYUP(vk_code)   ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)

// GLOBALS ////////////////////////////////////////////////
HWND      main_window_handle = NULL; // globally track main window

HINSTANCE hinstance_app      = NULL; // globally track hinstance
char buffer[80];                     // general printing buffer

// FUNCTIONS //////////////////////////////////////////////
LRESULT CALLBACK WindowProc(HWND hwnd, 
						    UINT msg, 
                            WPARAM wparam, 
                            LPARAM lparam)
{
// this is the main message handler of the system
PAINTSTRUCT		ps;		// used in WM_PAINT
HDC				hdc;	// handle to a device context
char buffer[80];        // used to print strings

// what is the message 
switch(msg)
	{	
	case WM_CREATE: 
        {
		// do initialization stuff here
        // return success
		return(0);
		} break;
   
	case WM_PAINT: 
		{
		// simply validate the window 
   	    hdc = BeginPaint(hwnd,&ps);	 
        
        // end painting
        EndPaint(hwnd,&ps);

        // return success
		return(0);
   		} break;

	case WM_DESTROY: 
		{

		// kill the application, this sends a WM_QUIT message 
		PostQuitMessage(0);

        // return success
		return(0);
		} break;

	default:break;

    } // end switch

// process any messages that we didn't take care of 
return (DefWindowProc(hwnd, msg, wparam, lparam));

} // end WinProc

// WINMAIN ////////////////////////////////////////////////
int WINAPI WinMain(	HINSTANCE hinstance,
					HINSTANCE hprevinstance,
					LPSTR lpcmdline,
					int ncmdshow)
{

WNDCLASSEX winclass; // this will hold the class we create
HWND	   hwnd;	 // generic window handle
MSG		   msg;		 // generic message
HDC        hdc;      // graphics device context

// first fill in the window class stucture
winclass.cbSize         = sizeof(WNDCLASSEX);
winclass.style			= CS_DBLCLKS | CS_OWNDC | 
                          CS_HREDRAW | CS_VREDRAW;
winclass.lpfnWndProc	= WindowProc;
winclass.cbClsExtra		= 0;
winclass.cbWndExtra		= 0;
winclass.hInstance		= hinstance;
winclass.hIcon			= LoadIcon(NULL, IDI_APPLICATION);
winclass.hCursor		= LoadCursor(NULL, IDC_ARROW); 
winclass.hbrBackground	= (HBRUSH)GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName	= NULL;
winclass.lpszClassName	= WINDOW_CLASS_NAME;
winclass.hIconSm        = LoadIcon(NULL, IDI_APPLICATION);

// save hinstance in global
hinstance_app = hinstance;

// register the window class
if (!RegisterClassEx(&winclass))
	return(0);

// create the window
if (!(hwnd = CreateWindowEx(NULL,                // extended style
                            WINDOW_CLASS_NAME,   // class
						    "Ellipse Animation Demo", // title
						    WS_OVERLAPPEDWINDOW | WS_VISIBLE,
					 	    0,0,	  // initial x,y
						    WINDOW_WIDTH, // initial width
                            WINDOW_HEIGHT,// initial height
						    NULL,	  // handle to parent 
						    NULL,	  // handle to menu
						    hinstance,// instance of this application
						    NULL)))	// extra creation parms
return(0);

// save main window handle
main_window_handle = hwnd;

// get the graphics device context once this time and keep it
// this is possible due to the CS_OWNDC flag
hdc = GetDC(hwnd);

// seed random number generator
srand(GetTickCount());

// create the pens and brushes
HPEN   white_pen = CreatePen(PS_SOLID, 1, RGB(255,255,255));
HPEN   black_pen = CreatePen(PS_SOLID, 1, RGB(0,0,0));
HBRUSH green_brush = CreateSolidBrush(RGB(0,255,0));
HBRUSH black_brush = CreateSolidBrush(RGB(0,0,0));

// starting position of ball
int ball_x = WINDOW_WIDTH/2;
int ball_y = WINDOW_HEIGHT/2;

// initial velocity of ball
int xv = -4+rand()%8;
int yv = -4+rand()%8;

// enter main event loop, but this time we use PeekMessage()
// instead of GetMessage() to retrieve messages
while(TRUE)
	{
    // test if there is a message in queue, if so get it
	if (PeekMessage(&msg,NULL,0,0,PM_REMOVE))
	   { 
	   // test if this is a quit
       if (msg.message == WM_QUIT)
           break;
	
	   // translate any accelerator keys
	   TranslateMessage(&msg);

	   // send the message to the window proc
	   DispatchMessage(&msg);
	   } // end if


    // ERASE the last position of the ball
    
    // first select the black pen and brush into context
    SelectObject(hdc, black_pen);
    SelectObject(hdc, black_brush);

    // draw the ball
    Ellipse(hdc, ball_x, ball_y, ball_x + 32, ball_y + 32);
    
    // MOVE the ball
    ball_x+=xv;
    ball_y+=yv;

    // test for collisions, first x-axis
    if (ball_x < 0 || ball_x > WINDOW_WIDTH - 32)
       { 
       // invert x-velocity of ball
       xv=-xv;

       // push ball back
       ball_x+=xv;

       } // end if
    else
    // test for y-axis collisions
    if (ball_y < 0 || ball_y > WINDOW_HEIGHT - 32)
       { 
       // invert y-velocity of ball
       yv=-yv;

       // push ball back
       ball_y+=yv;

       } // end if

    // now select the green and white colors for brush and pen
    SelectObject(hdc, white_pen);
    SelectObject(hdc, green_brush);

    // DRAW the ball
    Ellipse(hdc, ball_x, ball_y, ball_x + 32, ball_y + 32);

    // main game processing goes here
    if (KEYDOWN(VK_ESCAPE))
       SendMessage(hwnd, WM_CLOSE, 0,0);

    // slow system down a little
    Sleep(10); 
       
	} // end while

// delete all the objects
DeleteObject(white_pen);
DeleteObject(black_pen);
DeleteObject(green_brush);
DeleteObject(black_brush);

// release the device context
ReleaseDC(hwnd,hdc);

// return to Windows like this
return(msg.wParam);

} // end WinMain

///////////////////////////////////////////////////////////

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产aⅴ一区二区| 成人在线视频一区二区| 91久久精品网| 亚洲国产你懂的| 欧美日韩一区不卡| 日韩高清电影一区| 精品伦理精品一区| 蜜桃av噜噜一区| 久久精品人人爽人人爽| 91网站在线播放| 天天综合日日夜夜精品| 久久综合色之久久综合| 成a人片国产精品| 亚洲福利视频导航| 久久一区二区三区四区| 91小视频在线免费看| 五月激情六月综合| 国产日韩欧美麻豆| 欧美性猛交xxxx乱大交退制版| 三级欧美在线一区| 国产欧美精品一区| 欧美日韩三级一区二区| 国产精品99久久不卡二区| 亚洲三级视频在线观看| 91精品国产麻豆| 99国产精品久久久久久久久久 | 国产日韩欧美在线一区| 91视频观看免费| 黑人巨大精品欧美黑白配亚洲| 亚洲欧洲美洲综合色网| 欧美一级国产精品| 91在线观看成人| 国产最新精品精品你懂的| 亚洲精品国产第一综合99久久| 日韩亚洲欧美成人一区| 91视频.com| 国产成人日日夜夜| 奇米色一区二区三区四区| 最新不卡av在线| 久久久久久久久蜜桃| 欧美日韩视频在线第一区| 波多野结衣在线一区| 蜜桃久久久久久| 亚洲成人免费观看| 17c精品麻豆一区二区免费| 精品嫩草影院久久| 欧美日韩1234| 色成人在线视频| 成人av集中营| 国产激情一区二区三区四区| 亚洲成av人**亚洲成av**| 亚洲少妇最新在线视频| 国产欧美日韩另类一区| 久久久一区二区三区| 日韩欧美国产一区在线观看| 欧美日韩极品在线观看一区| 色综合久久久久网| 99久久久久久| 成人激情开心网| 国产风韵犹存在线视精品| 免费看欧美女人艹b| 午夜久久福利影院| 亚洲国产一区二区三区| 一区二区高清视频在线观看| 中文字幕一区在线| 国产精品久久久久毛片软件| 国产精品免费丝袜| 日本一区二区不卡视频| 欧美激情一区二区三区蜜桃视频| 精品成人一区二区三区| 精品国一区二区三区| 日韩精品一区二区三区视频播放| 欧美一区二区三区的| 欧美一二三区在线观看| 91精品欧美福利在线观看| 欧美一区三区二区| 欧美一二三在线| 精品日韩av一区二区| 久久综合给合久久狠狠狠97色69| 日韩女优av电影| 久久久亚洲综合| 欧美国产一区在线| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆 | 日韩和的一区二区| 日韩av电影天堂| 久久99精品国产麻豆不卡| 精品亚洲国内自在自线福利| 九九久久精品视频| 激情图片小说一区| 岛国一区二区在线观看| 色综合网色综合| 欧美性生活大片视频| 欧美日韩一本到| 欧美一区二区国产| 久久精品夜夜夜夜久久| 国产精品―色哟哟| 亚洲成国产人片在线观看| 日本一不卡视频| 国产麻豆精品久久一二三| 成人av网站在线| 欧美视频一区二区三区四区| 4hu四虎永久在线影院成人| 久久综合色之久久综合| 亚洲视频小说图片| 日韩成人精品在线| 成人午夜在线视频| 欧美日韩国产小视频| 26uuu色噜噜精品一区二区| 国产精品第13页| 亚洲成av人**亚洲成av**| 国内精品国产成人国产三级粉色| 成人99免费视频| 777久久久精品| 国产精品天天摸av网| 亚洲国产成人tv| 国产成人免费视频网站| 欧美日韩一区二区三区四区 | 成人午夜看片网址| 欧美三级蜜桃2在线观看| 久久先锋资源网| 亚洲一区二区三区不卡国产欧美| 黑人精品欧美一区二区蜜桃 | 天堂一区二区在线| 处破女av一区二区| 欧美一区二区三区四区五区| 国产精品久久精品日日| 久久精品免费观看| 91蜜桃婷婷狠狠久久综合9色| 欧美一区二区视频在线观看2020 | 亚洲综合丁香婷婷六月香| 久久99精品久久久| 欧美亚洲动漫精品| 中文字幕av免费专区久久| 日本在线观看不卡视频| 91免费观看国产| 欧美高清在线一区二区| 美腿丝袜亚洲色图| 欧美日韩激情在线| 日韩毛片一二三区| 成人一二三区视频| 精品久久久久久亚洲综合网| 亚洲福中文字幕伊人影院| 99国产精品一区| 国产女同互慰高潮91漫画| 免费人成在线不卡| 欧美日本在线观看| 亚洲制服欧美中文字幕中文字幕| www.欧美日韩国产在线| 国产拍揄自揄精品视频麻豆| 久久精品999| 日韩免费看的电影| 日本成人中文字幕| 欧美日本乱大交xxxxx| 亚洲久草在线视频| aaa亚洲精品| 国产精品久久久久久久久快鸭| 国产精品亚洲а∨天堂免在线| 精品久久久久香蕉网| 久久精品久久99精品久久| 欧美日本一区二区三区四区| 亚洲午夜久久久久久久久电影网| 色综合久久久久网| 亚洲精品免费电影| 在线视频综合导航| 亚洲一区二区三区在线| 欧美视频一区二区三区在线观看| 一区二区三区高清| 欧美日韩成人综合天天影院 | 老司机午夜精品| 日韩免费高清视频| 国产一区二区三区国产| 久久久综合精品| 国产电影一区在线| 日本一区二区久久| 99国产欧美另类久久久精品| 樱桃国产成人精品视频| 欧美体内she精视频| 日韩综合小视频| 精品国产电影一区二区| 国产成人8x视频一区二区| 中文字幕在线一区二区三区| 91亚洲精品久久久蜜桃网站| 亚洲精品国产一区二区精华液| 欧美三级韩国三级日本一级| 看电视剧不卡顿的网站| 国产色综合一区| 91麻豆123| 日日摸夜夜添夜夜添精品视频| 精品国产伦一区二区三区观看方式| 国产真实乱子伦精品视频| 国产精品女主播在线观看| 色成人在线视频| 久久精品久久精品| 综合欧美亚洲日本| 亚洲国产高清在线| 欧美性大战久久久久久久| 日本午夜精品视频在线观看| 国产午夜精品美女毛片视频| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 亚洲欧洲精品一区二区三区不卡 |