常用d3d操作

2023-11-11 00:18
文章标签 操作 常用 d3d

本文主要是介绍常用d3d操作,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 使用ALPHA混合使用ALPHA测试 使用点精灵使用雾设置距阵(坐标转换)使用索引缓冲使用深度缓冲使用光照 --------------------------------------------------有关纹理的操作:---------------------------------------------- 纹理提交模式: D3DTSS_ADDRESSU,D3DTSS_ADDRESSV D3DTADDRESS_WRAP,CLAM,MIRROR,BORDER 纹理过滤方式: D3DTSS_MAG,FILTER,D3DTSS_MINFILTER,D3DTSS_MIPFILTER D3DTEXF_LINEAR,D3DTEXF_POINT 纹理混合方法: -颜色混合方法: D3DTSS_COLORARG1,D3DTSS_COLORARG2,COLOROP D3DTA_CURRENT,D3DTA_DIFFUSE,D3DTA_TEXTURE;D3DTOP_SELECTARG1,D3DTOP_SELECTARG2,D3DTOP_MODULATE,D3DTOP_SUBTRACT,D3DTOP_ADD -透明混合: D3DTSS_ALPHAARG1,D3DTSS_ALPHAARG2,D3DTSS_ALPHAOP 纹理透明方法:纹理透明属于设置RenderState的ALPHA测试,通过比较ALPHA值,决定是否透明 D3DRS_ALPHATESTENABLE,D3DRS_ALPHAREF,D3DRS_ALPHAFUNC TRUE,FALSE,0X00000000-0X000000ff,D3DCMP_GREATEREQUAL,D3DCMP_LESS ALPHA混合方法:ALPHA混合属于设置RenderState的ALPHA混合参数,通过参数的计算决定最终显示的点颜色 D3DRS_ALPHABLENDENABLE,D3DRS_SRCBLEND,D3DRS_DESTBLEND TRUE,FALSE,D3DBLEND_SRCALPHA,D3DBLEND_DESTALPHA,D3DBLEND_INVDESTALPHA,D3DBLEND_INVSRCALPHA 纹理动画:通过改变纹理的顶点坐标值来实现动画 ---------------------------------------------------------------------------------------------------------------- able,mode density ------------------------------------------雨、雾、雪------------------------------------------------------------ 雾: d3ddev->SetRender(D3DRS_FOGENABLE,TRUE); deddev->SetRender(D3DRS_FOGCOLOR,D3DCOLOR(255,255,255)); d3ddev->SetRender(D3DRS_FOGTABLEMODE,D3DFOG_LINEAR); d3ddev->SetRender(D3DRS_FOGSTART,FtoDW(0.1f)); d3ddev->SetRender(D3DRS_FOGEND,FtoDw(1.0f)); d3ddev->SetRender(D3DRS_FOGTABLEMODE,D3DFOG_EXP); d3ddev->SetRender(D3DRS_FOGDENSITY,FtoDW(1.0f)); d3ddev->SetRender(D3DRS_FOGVERTEXMODE,D3DFOG_LINEAR); 雨: d3ddev->SetRender(D3DRS_POINTSPRITEENABLE,TRUE); //d3ddev->SetRender(D3DRS_RANGERPOINTENABLE,TURE); d3ddev->SetRender(D3DRS_POINTSIZE,FtoDW(0.1f)); d3ddev->SetRender(D3DRS_POINTSCALENABLE,TRUE); d3ddev->SetRender(D3DRS_POINTSCAL_A,FtoDW(1.0f)); d3ddev->SetRender(D3DRS_POINT_MIN,FtoDW(1.0f)); d3ddev->SetRender(D3DRS_POINT_MAX,FtoDW(1.0f)); d3ddev->SetVertexShader(); d3ddev->SetStreamSource(); d3ddev->DrawPrimitive(D3DPT_POINTLIST,0,X); 雪:使用顶点精灵...... d3ddev->SetTexture(0,m_texture); d3ddev->SetRender(D3DRS_ALPHABLENENABLE,TURE); d3ddev->SetRender(D3DRS_SRCALPHA,D3DBLEN_SRCALPHA); d3ddev->SetRender(D3DRS_DESTALPHA,D3DBLEN_INVSRCALPHA); d3ddev->SetRender(D3DRS_ALPHATEXTENABLE,TURE); d3ddev->SetRender(D3DRS_ALPHAREC,0x0f); d3ddev->SetRender(D3DRS_ALPHAFUNC,D3DCMP_GREATEREQUAL); d3ddev->SetVertexShader(); d3ddev->SetStreamSource(); d3ddev->DrawPrimitive(); ----------------------------------------------------------------------------------------------------------------- ---------------------------------使用模型------------------------------------------------------------------------ D3DXMESH mesh; D3DMATERIAL8* material; LPDIRECT3DTEXTURE8* texture; D3DXBUFFER appbuffer; D3DXBUFFER materialbuffer; PWOD nummaterial; if(FAILED(D3DXLoadMeshFromFilex("mesh.x",D3DXMESH_SYSTEMMEN,d3ddev,NULL,&nummaterial,&appbuffer,&materialbuffer,&mesh))){ return E_FAIL; } D3DXMATERIAL* materials=(D3DMATERIAL*)materialbuffer->GerBufferPoint(); material=new D3DMATERIAL8[nummaterial]; texture=new LPDIRECT3DTEXTURE8[nummaterial]; for(int i=0;iSetMaterial(&material[i]); d3ddev->SetTexture(0,texture[i]); mesh->DrawSubset(i); } ----------------------------------------------------------------------------------------------------------------- --------------------------------------------------使用材质与灯光------------------------------------------------- D3DMATERIAL8 material; D3DLIGHT8 light; light.Type=D3DLIGHT_POINT;//SPOT,DIRECTION light.Diffuse.r=1.0f;//g,b,a light.Ambient.r=1.0f;//g,b,a light.Specular.r=1.0f;//g,b,a light.Position=D3DXVECTOR3(1.0f.20.0f,20.0f);//Direction light.Range=2.0f;//Theta,Phi material.Diffuse.r=1.0f;//g,b material.Ambient.r=1.0f;//g,b material.Specular.r=1.0f;//g,b material.Power=10; material.Emssive=1.0f; d3ddev->SetMaterial(&material); d3ddev->SetLight(0,&light); d3ddev->LightEnable(0,TRUE); d3ddev->SetRenderState(D3DRS_LIGHT,TRUE); ------------------------------------------------------------------------------------------------------------------ ----------------------------------------------------------------------------------------------------- ------------------------------------------------------- LPDIRECT3D8 m_d3d; LPDIRECT3DDEVICE8 m_d3ddev; LPDIRECT3DVERTEXBUFFER8 m_verbuf; struct COUSTOMVERTEX{ float x,y,z; DWORD color; }; #define D3DFVF_COUSTOMVERTEX(D3DFVF_XYZ|D3DFVF_DIFFUSE) HRESULT Initial(HWND HWnd){ D3DDISPLAYMODE dismode; m_d3d=Direct3DCreate8(D3D_SDK_VERSION); if(m_d3d==NULL) return E_FAIL; m_d3d->GetAdapterDisplayMode(D3DADAPTER_DEFAULT,&dismode) D3DPRESENT_PARAMETERS m_parameters; ZeroMemory(&m_parameters,sizeof(m_parameters)); m_parameters.Windowed=TRUE; m_parameters.SwapEffect=D3DSWAPEFFECT_COPY_VSYNC;//DISCARD,FILP, m_parameters.BackBufferFormat=dismode.Format; if(FAILED(m_d3d.CreateDeviec(D3DADAPTER_DEFAULT,D3DDEVTYPE_HAL,HWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING,&m_parameters,&m_d3ddev)))///MIXED,HARDWARE { return E_FAIL; } return S_OK; } m_d3d->CreateVertexBuffer(18*sizeof(CUSTOMVERTEX),0,D3DFVF_CUSTOMVERTEX,D3DPOOL_DEFAULT,&m_verbuf); VOID* void; m_verbuf->Lock(0,sizeof(数组名),(BYTE**)&m_void,0); memcpy(m_verbuf,数组名,sizeof(数组名)); m_verbuf->Unlock(); m_d3ddev->BeginScene(); m_d3ddev->SetStreamSource(m_verbuf); m_d3ddev->SetVertextShader(D3DFVF_COUSTOMVERTEX); m_d3ddev->DrawPrimitive(D3DPT_TRIANGLELIST,0,2); m_d3ddev->EndScene(); m_d3ddev->Present(NULL,NULL,NULL,NULL); m_d3ddev->SetRenderState(D3DRS_CULLMODE,D3DCULL_CCW); m_deddev->SetRenderState(D3DRS_LIGHTING,FALSE); D3DXMATRIX m_matworld,m_matworldx,m_matworldy,m_matworldz; D3DXMatrixRotationX(&m_matworldx,34.0f); D3DXMatrixRotationY(&m_matworldy,34.0f); D3DXMatrixRotationZ(&m_matworldz,34.0f); D3DXMatrixMultiply(&m_matworld,&m_matworldx,&m_matworldy); D3DXMatrixMultiply(&m_matworld,&m_matworld,&m_matworldz); m_d3ddev->SetTransform(D3DTS_WORLD,&m_matworld); D3DXMatrixLookAtLH(&m_view,D3DXVECTOR3(0,0f,0,0f,20.0f),D3DXVECTOR(),D3DXVECTOR()); D3DXMatrixPerspectiveFovLH(&m_matproj,D3DPI/4,1.0f,1.0f,500.0f);// m_d3ddev->Clear(0,NULL,D3DCLEAR_TARGET,D3DCOLOR_XRGB(0,0,0),1.0f,0); D3DPT_TRIANGLESTRIP Direct3DCreate8(); GetAdapterDisplayMode(); ZeroMemory(); CreateDevice(); SetRenderState(); D3DCOLOR_XRGB(); CreateVertexBuffer(); Lock(); memcpy(); D3DXMatrixRotationX(); D3DXMatrixMultiply(); SetTransform(); D3DXMatrixLookAtLH(); D3DXVECTOR3 D3DXMatrixPerspectiveFovLH(); Clear(); SetStreamSource(); SetVertexShader(); DrawPrimitive(); Present(); AutoDepthStencilFormat ,EnableAutoDepthStencil,// SetRenderState(D3DRS_ZENABLE, D3DZB_TRUE); FullScreen_RefreshRateInHz,FullScreen_PresentationInterval// GetAdapterModeCount(),EnumAdapterModes() D3DXMatrixRotationAxis() D3DXMatrixScaling() D3DXCreateTextureFromFile() SetTexture() SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);// SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE);// D3DLIGHT8 Diffuse,Ambient,Specular,Position,Attenuation,Range, SetLight() LightEnable()// m_pD3DDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(32, 32, 32)); D3DMATERIAL8,D3DCOLORVALUE,Diffuse,Ambient,Specular,Emissive,Power SetMaterial()// D3DXVec3Subtract(),D3DXVec3Cross(),D3DXVec3Normalize()// m_pD3DDevice->SetIndices(m_pIndexBuffer, 0); m_pD3DDevice->DrawIndexedPrimitive(D3DPT_TRIANGLELIST, 0, m_dwNumOfVertices, 0, m_dwNumOfPolygons);//参数意义? LPDIRECT3DINDEXBUFFER8 CreateIndexBuffer() D3DFMT_INDEX16,D3DPOOL_MANAGED,DWORD,WORD//WORDHE和DWORDY有什么区别 如何使用索引缓冲:创建-锁定-拷贝-解锁-设置设备的缓冲-渲染索引原始 LPDIRECT3DINDEXBUFFER IndexBuffer; DWORD NumIndex; WORD Vertex[]={0,1,2,1,0 ......}; D3ddev->CreateIndexBuffer(NumIndex*sizeof(WORD),0,D3DFMT_INDEX16,D3DPOOL_MANAGED,&IndexBuffer); IndexBuffer->Lock(0,NumIndex*sizeof(WORD),(BYTE**)&pvertex,0); memcpy(pvertex,Vextex,3*sizeof(DWORD)); IndexBuffer->UnLock(); D3ddev->SetIndices(&IndexBuffer,0); 索引缓冲没有和顶点缓冲关联,渲染索引缓冲中的顶点时,为什么索引缓冲可以直接从某个顶点缓冲中找到顶点 D3ddev->DrawIndexPrimitive(D3DPT_TRANGLELIST,0,,0,); 如何加载模型:创建Mesh-得到缓冲指针-New数组-提取指针中的数据(提取MatD3D-设置Ambient-创建Textrue)-计算Normals-一各个设置Material和Texture-渲染子集-释放Material数组-一各个释放Texture-释放Texture数组-释放Mesh D3DXCloneMesh(),D3DXComputeNormals();// m_pD3DDevice->SetRenderState(D3DRS_NORMALIZENORMALS, TRUE); 2D渲染:// 字体常量:FW_NORMAL,FW_BOLD,DT_CALCRECT,DT_LEFT CreateFont(nHeight, 0, 0, 0, nWeight, dwItalic, dwUnderlined, 0,ANSI_CHARSET, 0, 0, 0, 0, pFontFace); LPD3DXFont RECT D3DCreateFont() Begin(),DrawTextA(),End() D3DXMatrixOrthoLH(&matOrtho, (float)m_nScreenWidth, (float)m_nScreenHeight,0.0f, 1.0f);// D3DXMatrixIdentity() 设置距阵,禁止深度缓冲,禁止灯光构造2D对象:创建顶点缓冲-锁定并且写入顶点坐标,纹理坐标,颜色值-创建纹理-设置渲染的数据来源,设置顶点格式,设置纹理,设置纹理舞台状态 m_pD3DDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE)-// m_pD3DDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); m_pD3DDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); m_pD3DDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);(激活alpha blen,设置SRC blen,DEST blen)-渲染 D3DXCreateTextureFromFileEx(),D3DX_DEFAULT ----------- lpDD->SetCooperativeLevel( hwnd, DDSCL_EXCLUSIVE | DDSCL_FULLSCREEN );// 雾: d3ddev->SetRender(D3DRS_FOGENABLE,TRUE); deddev->SetRender(D3DRS_FOGCOLOR,D3DCOLOR(255,255,255)); d3ddev->SetRender(D3DRS_FOGTABLEMODE,D3DFOG_LINEAR); d3ddev->SetRender(D3DRS_FOGSTART,FtoDW(0.1f)); d3ddev->SetRender(D3DRS_FOGEND,FtoDw(1.0f)); d3ddev->SetRender(D3DRS_FOGTABLEMODE,D3DFOG_EXP); d3ddev->SetRender(D3DRS_FOGDENSITY,FtoDW(1.0f)); d3ddev->SetRender(D3DRS_FOGVETEXMODE,D3DFOG_LINEAR); 雨: d3ddev->SetRender(D3DRS_POINTSPRITEENABLE,TRUE); //d3ddev->SetRender(D3DRS_RANGERPOINTENABLE,TURE); d3ddev->SetRender(D3DRS_POINTSIZE,FtoDW(0.1f)); d3ddev->SetRender(D3DRS_POINTSCALENABLE,TRUE); d3ddev->SetRender(D3DRS_POINTSCAL_A,FtoDW(1.0f)); d3ddev->SetRender(D3DRS_POINT_MIN,FtoDW(1.0f)); d3ddev->SetRender(D3DRS_POINT_MAX,FtoDW(1.0f)); d3ddev->SetVertexShader(); d3ddev->SetStreamSource(); d3ddev->DrawPrimitive(D3DPT_POINTLIST,0,X); 雪:使用顶点精灵...... d3ddev->SetTexture(0,m_texture); d3ddev->SetRender(D3DRS_ALPHABLENENABLE,TURE); d3ddev->SetRender(D3DRS_SRCALPHA,D3DBLEN_SRCALPHA); d3ddev->SetRender(D3DRS_DESTALPHA,D3DBLEN_INVSRCALPHA); d3ddev->SetRender(D3DRS_ALPHATEXTENABLE,TURE); d3ddev->SetRender(D3DRS_ALPHAREC,0x0f); d3ddev->SetRender(D3DRS_ALPHAFUNC,D3DCMP_CREATEREQUAL); d3ddev->SetVertexShader(); d3ddev->SetStreamSource(); d3ddev->DrawPrimitive(); ----------------------------------------------------------------- -------------------------------------------------------------------- ------------------------------------------------------------------------ LPD3DXLIGHT D3dlight;//D3DLIGHT //D3dlight.Type=D3DLIGHT_POINT; D3dlight.Diffuse.r=23;//23.0f ...... D3dlight.Specular.r=23;//23.0f ...... D3dlight.Ambient.r=23;//23.0f ...... D3dlight.Attenuation0=1.0f;// ...... D3dlight.Range=200;//200.0f D3dlight.Position.x=0.0f; ...... D3d->SetLight(0,&D3dlight);//****** D3d->LightEnable(0,TRUE);//******* D3d->SetRenderState(D3DRS_LIGHTING,TRUE); D3d->SetRenderState(D3DRS_AMBINT,D3DCOLOR_XRGB(32,32,32));//XRGB D3DXMATERICAL D3dMaterial; D3dMaterical.Diffuse=D3DCOLORVALUE(0,0,0); D3dMaterical.Ambient=D3DCOLORVALUE(0,0,0); D3dMaterical.Specular=D3DCOLORVALUE(0,0,0); D3dMaterical.Power=0; D3dMaterical.Emissive=D3DCOLORVALUE(0,0,0); D3d->SetMaterial(&D3dMaterial); VecArray//顶点数组 D3DXVECTOR3 Vec1,VecTemp1; D3DXVECTOR3 Vec2,VecTemp2; D3DXVERTOR3 VecNormal; for(int i=0;i<顶点总数;i+=3){ Vec1=D3DXVECTOR3(VecArray[i].x,VecArray[i].y,VecArray[i].z); Vec2=D3DXVERTOR3(VecArray[i+1].x,VecArray [i+1].y,VecArray[i+1].z); Vec2=D3DXVERTOR3(VecArray[i+2].x,VecArray[i+2].y,VecArray[i+2].z); D3DXVec3Subtract(&VecTemp1,Vec2,Vec1); D3DXVec3Subtract(&VecTemp2,Vec3,Vec1); D3DXVec3Cross(&VecNormal,&VecTemp1,&VecTemp2); D3DXVec3Normalize(&VecNormal,&VecNormal); VecArray[i].nx=VecNormal.x; VecArray[i].ny=VecNormal.y; VecArray[i].nz=VecNormal.z; VecArray[i+1].nx=VecNormal.x; VecArray[i+1].ny=VecNormal.y; VecArray[i+1].nz=VecNormal.z; VecArray[i+2].nx=VecNormal.x; VecArray[i+2].ny=VecNormal.y; VecArray[i+2].nz=VecNormal.z; } --------- d3ddev-SetTextureStageState(纹理层号,状态类型,状态值); 0,D3DTSS_ADDRESSU,D3DTADDRESS_WRAP 0,D3DTSS_ADDRESSV,D3DTADDRESS_CLAMP 0,D3DTSS_ADDRESSU,D3DTADDRESS_MIRROR D3DTSS_ADDRESSU,D3DTSS_ADDRESSV WRAP,CLAMP,MIRROR ---- 0,D3DTSS_MAGFILTER,D3DTEXF_LINEAR 0,D3DTSS_MINFILTER,D3DTEXF_LINEAR 0,D3DTSS_MIPFILTER,D3DTEXF_LINEAR 0,D3DTSS_MIPFILTER,D3DTEXF_POINT ---- 0,D3DTSS_COLORARG1,D3DTA_CURRENT 0,D3DTSS_COLORARG2,D3DTA_DIFFUSE 0,D3DTSS_COLORARG1,D3DTA_TEXTURE 0,D3DTSS_COLOROP,D3DTOP_ADD 0,D3DTSS_COLOROP,D3DTOP_LESS 0,D3DTSS_COLOROP,D3DTOP_MODULATE 0,D3DTSS_COLOROP,D3DTOP_SELECTARG1 0,D3DTSS_COLOROP,D3DTOP_SELECTARG2 ---- 0,D3DTSS_ALPHAARG1,0x00 0,D3DTSS_ALPHAARG2,0x0f 0,D3DTSS_ALPHAOP,D3DTOP_MODULATE ---- d3ddev->SetRenderState(D3DRS_ALPHATESTENABLE,TRUE); d3ddev->SetRenderState(D3DRS_ALPHAREF,0xff); d3ddev->SetRenderState(D3DRS_ALPHAFUNC,D3DCMP_GREATEREQUAL); ---- d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE); d3ddev->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA); d3ddev->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVDESTALPHA); --------- -------------------------DX全面练习-------------------- LPDIRECT3D8 d3d; LPDIRECT3DDEVICE d3ddev; D3DDISPLAYMODE dismode; LPPRESENT_PARAMETERS present; d3d=CreateDirect3D(D3D_SDK_VESION); d3d->GetAdapaterDisplayMode(D3DADAPATER_DEFAULT,&dismode); present.Windowed=True; present.SwapEffect=dismode.Format; present.BackBufferFormat=dismode.Format; d3ddev->DrawPrimitive(D3DPT_POINTLIST,0,1);//D3DPT_POINTSTRIP,D3DPT_TRANGLELIST,D3DPT_TRANGLESTRIP,D3DPT_LINELIST,D3DPT_LINESTRIP,D3DPT_TRANGLEFAN//S d3ddev->Clear(0,D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER,1.0f,0); d3ddev->BeginScene(); d3ddev->EndScene(); d3ddev->Present(NULL,NULL,NULL,NULL); D3DXMetrixPespective(&d3dxmetrix,D3DX_PI/4,1.0f,1.0f,100.0f,0); d3ddev->SetRenderState(D3DRS_PROJECTION,&d3dxmetrix); D3DXMetrixLookAtFovLH(&d3dxmetrix,x,y,z); d3ddev->SetRenderState(D3DRS_VIEW,&d3dmetrix); D3DXMetrixTranslation(&d3dxmetrix,x,y,z); D3DXMetrixRotationX(&d3dxmetrix,45.0f); D3DXMetrixRotationY(&d3dxmetrix,45.0f); D3DXMetrixRotationZ(&d3dxmetrix,45.0f); D3dXMetrixRotationAsny(&d3dxmetrix,45.0f);// d3ddev->SetRenderState(D3DRS_WORD,&d3dmetrix); present.FullScreen_RefreshRateInHz=D3DPT_RATE_DEFAULT; present.FullScreen_ReresentationInterval=D3DPT_INTERVAL_ONE; present.Windwoed=FALSE; present.BackBufferWidth=800; present.BackBufferHeight=600; LPDirct3DTexture8 texture; type struct COSTUMVERTEX{ float x,y,z; DWORD color; float ux,vx; }; d3ddev->SetTextureStageState(D3DTSS_ADDRESSU,D3DTADDRESS_WRAP);//MIRROR,CLAMP d3ddev->SetTextureStageState(D3DTSS_MAGFILTER,D3DTEXF_LINEAR); d3ddev->SetRenderState(D3DRS_COLORARG1,D3DTA_DIFFUSE);//CURRENT,TEXTURE d3ddev->SetRenderState(D3DRS_COLORARG2.D3DTA_DIFFUSE);// d3ddev->SetRenderState(D3DRS_COLOROP,D3DOP_MODULATE);//ADD,LESS,SUBSTRACT// d3ddev->SetRenderState(D3DRS_ALPHAARG1,D3DTA_DIFFUSE);//CURRENT,TEXTURE// d3ddev->SetRenderState(D3DRS_ALPHAARG2,D3DTA_DIFFUSE);// d3ddev->SetRenderState(D3DRS_ALPHAOP,D3DOP_MODULATE);//ADD,LESS,SUBSTRACT// d3ddev->SetRenderState(D3DRS_ALPHATESTENABLE,TRUE); d3ddev->SetRenderState(D3DRS_ALPHAREC,0x0f); d3ddev->SetRenderState(D3DRS_ALPHAOP,D3DCMP_GREATEREQUAIL); d3ddev->SetRenderState(D3DRS_ALPHATESTENABLE,TRUE); d3ddev->SetRenderState(D3DRS_ALPHABLENDENABLE,TRUE); d3ddev->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SCRALPHA); d3ddev->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVDESTALPHA); d3ddev->SetTextureStageState(D3DTSS_MIPFILTER,D3DTEXF_POINT);

这篇关于常用d3d操作的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/386246

相关文章

Mysql表的简单操作(基本技能)

《Mysql表的简单操作(基本技能)》在数据库中,表的操作主要包括表的创建、查看、修改、删除等,了解如何操作这些表是数据库管理和开发的基本技能,本文给大家介绍Mysql表的简单操作,感兴趣的朋友一起看... 目录3.1 创建表 3.2 查看表结构3.3 修改表3.4 实践案例:修改表在数据库中,表的操作主要

C# WinForms存储过程操作数据库的实例讲解

《C#WinForms存储过程操作数据库的实例讲解》:本文主要介绍C#WinForms存储过程操作数据库的实例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、存储过程基础二、C# 调用流程1. 数据库连接配置2. 执行存储过程(增删改)3. 查询数据三、事务处

Java使用Curator进行ZooKeeper操作的详细教程

《Java使用Curator进行ZooKeeper操作的详细教程》ApacheCurator是一个基于ZooKeeper的Java客户端库,它极大地简化了使用ZooKeeper的开发工作,在分布式系统... 目录1、简述2、核心功能2.1 CuratorFramework2.2 Recipes3、示例实践3

Java利用JSONPath操作JSON数据的技术指南

《Java利用JSONPath操作JSON数据的技术指南》JSONPath是一种强大的工具,用于查询和操作JSON数据,类似于SQL的语法,它为处理复杂的JSON数据结构提供了简单且高效... 目录1、简述2、什么是 jsONPath?3、Java 示例3.1 基本查询3.2 过滤查询3.3 递归搜索3.4

Python使用DrissionPage中ChromiumPage进行自动化网页操作

《Python使用DrissionPage中ChromiumPage进行自动化网页操作》DrissionPage作为一款轻量级且功能强大的浏览器自动化库,为开发者提供了丰富的功能支持,本文将使用Dri... 目录前言一、ChromiumPage基础操作1.初始化Drission 和 ChromiumPage

Linux上设置Ollama服务配置(常用环境变量)

《Linux上设置Ollama服务配置(常用环境变量)》本文主要介绍了Linux上设置Ollama服务配置(常用环境变量),Ollama提供了多种环境变量供配置,如调试模式、模型目录等,下面就来介绍一... 目录在 linux 上设置环境变量配置 OllamPOgxSRJfa手动安装安装特定版本查看日志在

利用Go语言开发文件操作工具轻松处理所有文件

《利用Go语言开发文件操作工具轻松处理所有文件》在后端开发中,文件操作是一个非常常见但又容易出错的场景,本文小编要向大家介绍一个强大的Go语言文件操作工具库,它能帮你轻松处理各种文件操作场景... 目录为什么需要这个工具?核心功能详解1. 文件/目录存javascript在性检查2. 批量创建目录3. 文件

Java常用注解扩展对比举例详解

《Java常用注解扩展对比举例详解》:本文主要介绍Java常用注解扩展对比的相关资料,提供了丰富的代码示例,并总结了最佳实践建议,帮助开发者更好地理解和应用这些注解,需要的朋友可以参考下... 目录一、@Controller 与 @RestController 对比二、使用 @Data 与 不使用 @Dat

Mysql中深分页的五种常用方法整理

《Mysql中深分页的五种常用方法整理》在数据量非常大的情况下,深分页查询则变得很常见,这篇文章为大家整理了5个常用的方法,文中的示例代码讲解详细,大家可以根据自己的需求进行选择... 目录方案一:延迟关联 (Deferred Join)方案二:有序唯一键分页 (Cursor-based Paginatio

Redis中管道操作pipeline的实现

《Redis中管道操作pipeline的实现》RedisPipeline是一种优化客户端与服务器通信的技术,通过批量发送和接收命令减少网络往返次数,提高命令执行效率,本文就来介绍一下Redis中管道操... 目录什么是pipeline场景一:我要向Redis新增大批量的数据分批处理事务( MULTI/EXE