Đang chuẩn bị liên kết để tải về tài liệu:
Beginning Game Programming (phần 4)

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

Tham khảo tài liệu 'beginning game programming (phần 4)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 130 Chapter 7 Drawing Animated Sprites Figure 7.5 The Anim_Sprite project now includes dxgraphics.h. int Init_Direct3D HWND hwnd int width int height int fullscreen initialize Direct3D d3d Direct3DCreate9 D3D_SDK_VERSION if d3d NULL MessageBox hwnd Error initializing Direct3D Error MB_OK return 0 set Direct3D presentation parameters D3DPRESENT_PARAMETERS d3dpp ZeroMemory d3dpp sizeof d3dpp d3dpp.Windowed fullscreen Drawing Animated Sprites 131 d3dpp.SwapEffect D3DSWAPEFFECT_COPY d3dpp.BackBufferFormat D3DFMT_X8R8G8B8 d3dpp.BackBufferCount 1 d3dpp.BackBufferWidth width d3dpp.BackBufferHeight height d3dpp.hDeviceWindow hwnd d3dpp.EnableAutoDepthStencil TRUE d3dpp.AutoDepthStencilFormat D3DFMT_D16 d3dpp.PresentationInterval D3DPRESENT_INTERVAL_IMMEDIATE create Direct3D device d3d- CreateDevice D3DADAPTER_DEFAULT D3DDEVTYPE_HAL hwnd D3DCREATE_SOFTWARE_VERTEXPROCESSING d3dpp d3ddev if d3ddev NULL MessageBox hwnd Error creating Direct3D device Error MB_OK return 0 clear the backbuffer to black d3ddev- Clear 0 NULL D3DCLEAR_TARGET D3DCOLOR_XRGB 0 0 0 1.0f 0 create pointer to the back buffer d3ddev- GetBackBuffer 0 0 D3DBACKBUFFER_TYPE_MONO backbuffer return 1 LPDIRECT3DSURFACE9 LoadSurface char filename D3DCOLOR transcolor LPDIRECT3DSURFACE9 image NULL D3DXIMAGE_INFO info HRESULT result get width and height from bitmap file result D3DXGetImageInfoFromFile filename info if result D3D_OK return NULL 132 Chapter 7 Drawing Animated Sprites create surface result d3ddev- CreateOffscreenPlainSurface info.Width info.Height D3DFMT_X8R8G8B8 D3DPOOL_DEFAULT image NULL width of the surface height of the surface surface format memory pool to use pointer to the surface reserved always NULL if result D3D_OK return NULL load surface from file into newly created surface result D3DXLoadSurfaceFromFile image NULL NULL filename NULL D3DX_DEFAULT transcolor NULL destination surface destination palette destination rectangle source filename source rectangle controls how image is filtered for .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.