directx-9

Turned off VSync but still getting 60FPS in my DirectX 9 application

心已入冬 提交于 2019-12-08 05:43:53
问题 I have an DirectX9 application which only renders a triangle on the screen, but I am getting a frame rate of 60 FPS no matter if I've got VSync on or not. Why is this? Here is the code I've done to calculate the FPS, but I dont know if this is the problem to it. GameTimer.h #pragma once #include "Windows.h" class GameTimer { public: GameTimer(); ~GameTimer(){} void Update(); float GetFrameTime(); inline float GetFramePerSec(){return framesPerSec;} inline float GetMillSecPerFrame(){return

Some options on DirectX control panel was disabled on Windows 8

笑着哭i 提交于 2019-12-07 06:47:18
问题 I am using DirectX 9.0 on Windows 8, when I open the DirectX control panel, I found some options was disabled, I am running as a administrator, so this is not an privilege issue. why this happened? I can't turn on the debug version runtime since it is disabled. see picture below. the SDK I am using is June 2010 回答1: Answer from Microsoft XNA forum The Direct3D 9 Developer Runtime (aka D3D9D.DLL) in the legacy DirectX SDK (June 2010) is not compatible with Windows 8. In fact, the entire

directx - texture render result is incorrect

依然范特西╮ 提交于 2019-12-07 00:13:24
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 the texture by D3DXCreateTextureFromFile(device, "e:\\test.bmp", &texture); and do not update the

How to draw line and font without D3DX9 in DirectX 9?

爷,独闯天下 提交于 2019-12-06 15:23:03
问题 I saw that D3DX9 is not recommended by Microsoft and not shipped with Windows SDK. I would like to adopt. I'm missing my line drawing utility. How can I replace ID3DXLine and ID3DXFont in "new" DirectX9? 回答1: Generally, lines and fonts are sprites. ID3DXLine and ID3DXFont use ID3DXSprite interface under the hood. (Of course, there are other options too, but sprite approach is the most widely used) Drawing sprites So, firstly, you will need either 3rd party or your own sprite renderer.

directx tutorials c++

≯℡__Kan透↙ 提交于 2019-12-06 11:14:22
问题 im searching for full directx tutorials i found directxtutorial.com but it only gave me the basic. couldn't find others that were full tutorials. have you find any or know any? 回答1: I presume you mean Direct3D, in which case you can find some good stuff over at the MSDN. http://msdn.microsoft.com/en-us/library/ee416804%28v=VS.85%29.aspx 回答2: There are some good ones here: http://www.toymaker.info/Games/index.html 来源: https://stackoverflow.com/questions/3792817/directx-tutorials-c

Unable to capture data from Back Buffer (DirectX9)

风格不统一 提交于 2019-12-06 09:52:17
I am trying to find the fastest method to take the screenshot. So far I've figured out that either GDI, or DirectX can be used. Using GDI I am able to capture the screen in 35ms, while using DirectX Front buffer it takes 73ms average. I want even faster method than this. For this purpose capturing Back Buffer in DirectX seems to be a good method. I am using the following code to do the same: D3DDISPLAYMODE ddm; D3DPRESENT_PARAMETERS d3dpp; if((g_pD3D=Direct3DCreate9(D3D_SDK_VERSION))==NULL) { ErrorMessage("Unable to Create Direct3D "); return E_FAIL; } if(FAILED(g_pD3D->GetAdapterDisplayMode

Linear movement stutter

喜欢而已 提交于 2019-12-05 05:40:32
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 full screen window or with aero disabled), even worse when window lost focus. EDIT: Frame delta time

How to draw line and font without D3DX9 in DirectX 9?

天大地大妈咪最大 提交于 2019-12-04 19:28:32
I saw that D3DX9 is not recommended by Microsoft and not shipped with Windows SDK. I would like to adopt. I'm missing my line drawing utility. How can I replace ID3DXLine and ID3DXFont in "new" DirectX9? Generally, lines and fonts are sprites. ID3DXLine and ID3DXFont use ID3DXSprite interface under the hood. (Of course, there are other options too, but sprite approach is the most widely used) Drawing sprites So, firstly, you will need either 3rd party or your own sprite renderer. Typically, development of "bedroom" sprite engine, consists of stages: drawing bunch of simple colored quads (two

Launching SharpDX/DirectX app with DeviceCreationFlags.Debug

你说的曾经没有我的故事 提交于 2019-12-04 05:23:30
问题 I am trying to launch my directX/SharpDX app with DeviceCreationFlags.Debug but i am getting the following crash upon startup: SharpDX.SharpDXException: HRESULT: [0x80004005], Module: [General], ApiCode: [E_FAIL/Unspecified error], Message: Unspecified error at SharpDX.Result.CheckError() at SharpDX.Direct3D11.Device.CreateDevice(Adapter adapter, DriverType driverType, DeviceCreationFlags flags, FeatureLevel[] featureLevels) at SharpDX.Direct3D11.Device..ctor(Adapter adapter,

How can I call a function from another .dll which is injected to the same program?

爷,独闯天下 提交于 2019-12-04 02:20:00
问题 My question is really above, I will give more information on this below however: I have a program which first takes my "false" d3d9.dll, this DLL is then loaded into the game I am reverse engineering. After the some time and the .dll is loaded, along with all the other games dependencies I want to inject my DLL which will do all the dirty work of the reverse engineering. I think I can load this DLL into the program using LoadLibrary, however when I'm using the DLL I injected to run the main