directx-9

Loading Textures in Directx

雨燕双飞 提交于 2020-01-14 06:11:01
问题 Im Trying to load textures in directx to draw a textured quad. but the D3DXCreateTextureFromFile never returns D3D_OK .... here is my code to load the texture.... FeralTexture(string Name,FeralVector2 Position,IDirect3DDevice9 *device) { FileName = Name; m_pDevice = device; x= Position.x; y= Position.y; if(D3DXCreateTextureFromFile(m_pDevice,FileName.c_str(),&m_pTextureFile) != D3D_OK) { TextureCreated = false; m_pTextureFile = NULL; D3DXCreateTextureFromFile(m_pDevice,FileName.c_str(),&m

Loading Textures in Directx

给你一囗甜甜゛ 提交于 2020-01-14 06:10:33
问题 Im Trying to load textures in directx to draw a textured quad. but the D3DXCreateTextureFromFile never returns D3D_OK .... here is my code to load the texture.... FeralTexture(string Name,FeralVector2 Position,IDirect3DDevice9 *device) { FileName = Name; m_pDevice = device; x= Position.x; y= Position.y; if(D3DXCreateTextureFromFile(m_pDevice,FileName.c_str(),&m_pTextureFile) != D3D_OK) { TextureCreated = false; m_pTextureFile = NULL; D3DXCreateTextureFromFile(m_pDevice,FileName.c_str(),&m

Lights not working properly in Helix Sharp DX

情到浓时终转凉″ 提交于 2020-01-05 11:36:08
问题 I am trying to build an obj file viewer using Helix Toolkit (https://github.com/helix-toolkit/helix-toolkit) with SharpDX. So far I am able to load an object file and render it's contents to Helix Viewport3DX. Model looks good with some obj files but for others there are some lightning problem and back surfaces are always black. I am not sure what am I doing wrong. Is this light problem due to the fact that SharpDX does not support back materials?? Please help. Problem using Helix Sharp DX:

(DirectX) Generating a rotation matrix to match a vector

纵然是瞬间 提交于 2020-01-04 14:03:28
问题 How can I take a vector and generate a matrix that will rotate a mesh to face along that vector? Specifics: I want the model for my player to rotate to face the direction that the camera is looking. Right now, it always points in the direction it started in, and turning just makes the camera look at the player's side. I have experimented with D3DXMatrixYawPitchRoll, with partial success. However, I noticed some drift in time from perfect alignment, and it had some strange wobbly issues when I

Drawing to the desktop via injection

二次信任 提交于 2019-12-30 05:29:12
问题 I'd like to draw to the desktop wallpaper area with directX 9 in particular. Under the icons and text above the wallpaper. Similar to Okozo or one of VLC's modes, or Dreamscene. So there's a lot of similar questions to this but no working examples or tutorials.This A simmilar question but different approach seems pretty useful. A few years ago I was searching and found this site and code. It's perfect aside from one big issue the icon text gets blocky even with alpha blending. I tried a few

Direct3D9 - access depth/stencil buffer in pixel shader (and probably copy it to a different texture)

倾然丶 夕夏残阳落幕 提交于 2019-12-25 09:28:20
问题 EDIT: D24S8 textures cannot be copied. Period. Sometimes, however, it is possible to change the depth buffer format to INTZ, a special FOURCC format, which has the same layout, but can be set as input for texture samplers. Finally my approach was to use a proxy dll to intercept all texture creation calls to be able to change the format wherever D24S8 was given. Afterwards I could then bind this texture to a texture sampler of the pixel shader, set a R32F render target and write the sampled

DirectX9 CreateDevice failed with D3DERR_NOTAVAILABLE

僤鯓⒐⒋嵵緔 提交于 2019-12-25 06:59:44
问题 There is initializing code for dx9 device D3DDISPLAYMODE display; m_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &display); ZeroMemory(&m_d3dpp, sizeof(m_d3dpp)); m_d3dpp.Windowed = false; m_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; m_d3dpp.BackBufferFormat = display.Format; m_d3dpp.EnableAutoDepthStencil = false; m_d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; /*BackBufferHeight and BackBufferWidth also set from elsewhere*/ DWORD flags = D3DCREATE_FPU_PRESERVE|D3DCREATE_MULTITHREADED; m

directx - texture render result is incorrect

佐手、 提交于 2019-12-23 02:20:36
问题 case 1 : I create the texture by D3DXCreateTexture(device, width, height, 0, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture) and update the texture with white color. D3DLOCKED_RECT lr; HRESULT hr = texture->LockRect(0, &lr, NULL, 0); ConvertRGB2RGBA(width, height, pixels, stride, (unsigned char*)(lr.pBits), lr.Pitch); texture->UnlockRect(0); the render result shows as: What I want is pure white on the surface. The z value of all the vertexes equals to 0.0f. case 2 : If I create

directx - texture render result is incorrect

随声附和 提交于 2019-12-23 02:20:12
问题 case 1 : I create the texture by D3DXCreateTexture(device, width, height, 0, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture) and update the texture with white color. D3DLOCKED_RECT lr; HRESULT hr = texture->LockRect(0, &lr, NULL, 0); ConvertRGB2RGBA(width, height, pixels, stride, (unsigned char*)(lr.pBits), lr.Pitch); texture->UnlockRect(0); the render result shows as: What I want is pure white on the surface. The z value of all the vertexes equals to 0.0f. case 2 : If I create

Linear movement stutter

只谈情不闲聊 提交于 2019-12-22 04:57:30
问题 I have created simple, frame independent, variable time step, linear movement in Direct3D9 using ID3DXSprite . Most users cant notice it, but on some (including mine) computers it happens often and sometimes it stutters a lot. Stuttering occurs with VSync enabled and disabled. I figured out that same happens in OpenGL renderer. Its not floating point problem. Seems like problem only exist in AERO Transparent Glass windowed mode (fine or at least much less noticeable in fullscreen, borderless