设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> 游戏开发 >> 一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子
精品推荐
游戏开发点击TOP10
·DirectX5.0最新游戏编程指南 DirectDraw教程篇 二、第一个DirectDraw实例
·用Excel编写小游戏
·五子棋的原代码
·游戏开发方面相关的电子书下载
·游戏文件系统的解决方案
·基于LOD的大规模真实感室外场景实时渲染技术的初步研究 part II&III
·用MFC构造DirectX应用框架
·游戏开发开门
·《Windows游戏编程大师技巧》(第二版)第11章
·DirectX8.1的DirectDraw7研究手记(三)
编程开发点击TOP10
·数字小键盘指法练习
·ASP.NET 程序中常用的三十三种代码
·用C语言编通讯录程序(初学者级别的)
·我写的Java学生成绩管理系统源代码
·CHK文件恢复工具
·Modem 常用AT指令集
·java笔试题
·异常java.sql.SQLException: Io exception:The Network Adapter could not establish connection
·单片机模拟I2C总线及24C02(I2C EEPROM)读写实例(源代码)
·C++经典电子书下载
精选专题

一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子

作者: 来源:网络文章 时间:2005-12-17 22:38:42

一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(3) D3DVERTEXELEMENT9 decl[] =
{
 //for Position
 { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_POSITION, 0 },

 // for color
 { 0, 12, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT,D3DDECLUSAGE_COLOR, 0 },

 D3DDECL_END()
};


#if VS_TYPE == 1

// shader declaration
const char* strVertexShader = 

"vs_3_0 // version instruction\n"

// input register declaration
"dcl_position v0 // define position data in register v0\n"
"dcl_color v1 // define color\n"

// output  register declaration
"dcl_position0   o7 // \n"
"dcl_color o3 // output color\n"

// ALU(Shader function/function declaration)
"m4x4 o7, v0, c0 // transform vertices by world/view/projection matrix\n"
"mov o3, v1 //\n"
";//\n"
"";

LPDIRECT3DVERTEXSHADER9 g_pVS = NULL;

#endif

#if VS_TYPE == 2

const char* strVertexShader = // vertex shader declaration

"float4x4 WorldViewProj : WORLDVIEWPROJ;\n"
"struct VS_OUTPUT\n"
"{\n"
"float4 Pos : POSITION;\n"
"float4 Diff : COLOR0;\n"
"};\n"
"\n"
"VS_OUTPUT VS_Matrices(float4 inPos : POSITION,float4 inDiff : COLOR0)\n"
"{\n"
"VS_OUTPUT Out = (VS_OUTPUT)0;\n"
"\n"
" Out.Pos = mul(inPos, WorldViewProj);\n"
" Out.Diff = inDiff;\n"
" return Out;\n"
"}\n"
"";

LPDIRECT3DVERTEXSHADER9 g_pVS = NULL;

#endif

//-----------------------------------------------------------------------------
// Name: InitD3D()
// Desc: Initializes Direct3D
//-----------------------------------------------------------------------------
HRESULT InitD3D( HWND hWnd )
{
    // Create the D3D object.
    if( NULL == ( g_pD3D = Direct3DCreate9( D3D_SDK_VERSION ) ) )
        return E_FAIL;

    // Set up the structure used to create the D3DDevice
    D3DPRESENT_PARAMETERS d3dpp;

1.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(1)
2.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(2)
3.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(3)
4.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(4)
5.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(5)
6.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(6)
7.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(7)
8.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(8)
9.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(9)
10.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(10)
11.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(11)
12.一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子(12)
共12页 9 7 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [128 :>

一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子 相关文章:
一个简单例子表示fixed functional VS/Assemble VS/HLSI VS的例子 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com