Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Cone.h
Package: directx8中文教程.zip [view]
Upload User: whgydz
Upload Date: 2007-01-12
Package Size: 2259k
Code Size: 2k
Category:
Other Books
Development Platform:
HTML/CSS
- // Cone.h: interface for the CCone class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_CONE_H__8D338063_9E7F_4455_8A3B_394075E29035__INCLUDED_)
- #define AFX_CONE_H__8D338063_9E7F_4455_8A3B_394075E29035__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include <d3dx8.h>
- #include "Base.h"
- //Define a FVF for our cone
- #define CONE_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1)
- class CCone : public CBase
- {
- private:
- //Define a custom vertex for our cone
- struct CONE_CUSTOMVERTEX
- {
- FLOAT x, y, z; //Position of vertex in 3D space
- FLOAT nx, ny, nz; //Lighting Normal
- FLOAT tu, tv; //Texture coordinates
- };
- public:
- bool SetMaterial(D3DCOLORVALUE rgbaDiffuse, D3DCOLORVALUE rgbaAmbient, D3DCOLORVALUE rgbaSpecular, D3DCOLORVALUE rgbaEmissive, float rPower);
- bool SetSideTexture(const char* szTextureFilePath);
- bool SetEndTexture(const char* szTextureFilePath);
- DWORD Render();
- CCone(LPDIRECT3DDEVICE8 pD3DDevice, float rHeight = 1.0, float rRadius = 1.0, int nSegments = 20);
- virtual ~CCone();
- private:
- bool UpdateVertices();
- bool CreateIndexBuffer();
- bool CreateVertexBuffer();
- LPDIRECT3DDEVICE8 m_pD3DDevice;
- LPDIRECT3DVERTEXBUFFER8 m_pVertexBuffer;
- LPDIRECT3DINDEXBUFFER8 m_pIndexBuffer;
- LPDIRECT3DTEXTURE8 m_pSideTexture;
- LPDIRECT3DTEXTURE8 m_pEndTexture;
- D3DMATERIAL8 m_matMaterial;
- float m_rHeight;
- float m_rRadius;
- int m_nSegments;
- DWORD m_dwNumOfIndices;
- DWORD m_dwNumOfVertices;
- DWORD m_dwNumOfSidePolygons;
- DWORD m_dwNumOfEndPolygons;
- };
- #endif // !defined(AFX_CONE_H__8D338063_9E7F_4455_8A3B_394075E29035__INCLUDED_)