Platform_Win32_3D_D3D9.h
Go to the documentation of this file.00001 00010 #ifndef __Platform_Win32_3D_D3D9_H__ 00011 #define __Platform_Win32_3D_D3D9_H__ 00012 00013 // Includes 00014 #include "Platform_Win32_3D_Technology.h" 00015 00016 // Forward declares 00017 struct IDirect3D9; 00018 struct IDirect3DDevice9; 00019 struct IDirect3DTexture9; 00020 //struct ID3DXEffect; 00021 00022 00023 // Platform_Win32_3D_D3D9 00024 class Platform_Win32_3D_D3D9:public Platform_Win32_3D_Technology 00025 { 00026 00027 public: 00028 Platform_Win32_3D_D3D9(struct HWND__* windowHandle, bool fullscreen, int screenWidth, int screenHeight); 00029 virtual ~Platform_Win32_3D_D3D9(); 00030 00031 virtual bool Setup(); 00032 00033 virtual void BeginScene( 00034 unsigned int color, 00035 float z, 00036 unsigned int stencil 00037 ); 00038 00039 virtual void EndScene(); 00040 00041 virtual Platform_3D_VertexBuffer* CreateVertexBuffer( 00042 int vertexFormat, 00043 int vertexCount, 00044 bool dynamic 00045 ); 00046 00047 virtual Platform_3D_IndexBuffer* CreateIndexBuffer( 00048 int indexCount, 00049 bool dynamic 00050 ); 00051 00052 virtual Platform_3D_Texture* CreateTexture( 00053 void* data, 00054 int size 00055 ); 00056 00057 virtual Platform_3D_Texture* CreateTexture( 00058 int width, 00059 int height, 00060 void* data 00061 ); 00062 00063 virtual void Render( 00064 int startVertex, 00065 int vertexCount, 00066 int startIndex, 00067 int indexCount 00068 ); 00069 00070 virtual void Render( 00071 int startVertex, 00072 int vertexCount 00073 ); 00074 00075 virtual void RenderStrip( 00076 int startVertex, 00077 int vertexCount, 00078 int startIndex, 00079 int indexCount 00080 ); 00081 00082 virtual void RenderStrip( 00083 int startVertex, 00084 int vertexCount 00085 ); 00086 00087 virtual void RenderFan( 00088 int startVertex, 00089 int vertexCount, 00090 int startIndex, 00091 int indexCount 00092 ); 00093 00094 virtual void RenderFan( 00095 int startVertex, 00096 int vertexCount 00097 ); 00098 00099 virtual void SetWorldMatrix( 00100 const float worldMatrix[16] 00101 ); 00102 00103 virtual void SetViewMatrix( 00104 const float viewMatrix[16] 00105 ); 00106 00107 virtual void SetProjectionMatrix( 00108 const float projectionMatrix[16] 00109 ); 00110 00111 virtual int GetLightCount(); 00112 00113 virtual void EnableDirectionalLight( 00114 int lightIndex, 00115 float colorR, 00116 float colorG, 00117 float colorB, 00118 float directionX, 00119 float directionY, 00120 float directionZ 00121 ); 00122 00123 virtual void DisableLight( 00124 int lightIndex 00125 ); 00126 00127 virtual void SetAmbientLight( 00128 unsigned int color 00129 ); 00130 00131 virtual void EnableLighting( 00132 bool enabled 00133 ); 00134 00135 virtual void EnableZRead( 00136 bool enabled 00137 ); 00138 00139 virtual void EnableZWrite( 00140 bool enabled 00141 ); 00142 00143 private: 00144 // bool IsCompressedTextureFormatOk( D3DFORMAT TextureFormat, D3DFORMAT AdapterFormat ) ; 00145 00146 private: 00147 struct HWND__* windowHandle_; 00148 bool fullscreen_; 00149 int screenWidth_; 00150 int screenHeight_; 00151 void* d3dDLL_; 00152 IDirect3D9* direct3D_; 00153 IDirect3DDevice9* device_; 00154 int lightCount_; 00155 }; 00156 00157 00158 #endif /* __Platform_Win32_3D_D3D9_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
