problem about directx-9-Collection of common programming errors


  • Joel
    visual-studio-2010 dll linker directx directx-9
    I’m currently going though a game programming book and am trying to compile some directx9 codeI have the latests DirectX11 SDK and the code has these lines of code#pragma comment(lib,”d3d9.lib”) #pragma comment(lib,”d3dx9.lib”)But I get LINK : fatal error LNK1104: cannot open file ‘d3dc9.lib’I don’t know how to set it up to find this file although in fact I don’t get why it asks for it since it isn’t inside the Lib file for the DirectX 11 SDK and isn’t what i’ve asked for.

  • user2425275
    hook directx-9 dll-injection
    I would like to hook directx present call of a directx9 game. The problem is that game is already running. And I would like to hook present call runtime without hooking the createdevice. I have seen some code where constant offset of a present function is added to baseaddress of d3d9.dll after injecting our dll into the game. How to find out the offset for the present call? Directx hook using offset

  • Ozirus
    directx direct3d directx-9 direct3d9 gamma
    UPDATE:Thank you all very much for your answers. As Jesse Hall suggested, it looks like it is a driver (or hardware) problem. I tried the same app on other configurations and it worked as expected.I tested the app on other computers which share the same GPU (ATI 4800 HD) but different versions of the driver and they all showed the same erroneous behavior (what seems to be a double gamma correction on write). On these computers, if have to set D3DRS_SRGBWRITEENABLE to false to fix the display. An

  • user
    c++ winapi directx fullscreen directx-9
    For now, I need change the display mode to full screen borderless windows before executing the program to get the desired result. I want to change the display mode from windowed to full screen borderless window by just pressing Alt + Enter when the program is running . How can I modify the code to make it able to change the display mode at runtime? SystemClass.cppvoid SystemClass::InitializeWindows() {WNDCLASSEX wc;DEVMODE dmScreenSettings;int screenWidth, screenHeight;int posX, posY;// Get an e

  • quack quixote
    windows-xp installation sp3 directx-9
    Specs to put things in context: AMD Athlon XP 2400+ @ 1987 MHz / 2 x 512MB PC3200 DDR RAM / WD 160GB IDE HDD / 3DFuzion 128MB GeForce 6200 AGP 4x / FIC AM37 / Windows XP SP3Just recently, I was unable to start Windows Media Player. I clicked it and the busy cursor came up, but then nothing happened. Also, I tried doing a search for a file, and same thing. It would show busy cursor then suddenly stop doing anything. I couldn’t find it in the Processes of the Task Manager. (Perhaps I don’t know wh

  • zdd
    debugging directx directx-9
    When I open the DirectX control panel and open the Direct3D 9 tab and set “Use Debug Version of Direct3D 9” and hit “OK” or “Apply,” there are no errors. If I open the control panel again, it is back to “Use Retail Version of Direct3D 9.” When I try to debug my application, I don’t get any output from Direct3D.When I last did this a few months ago, everything worked correctly and I got debug output.Running the control panel as Administrator doesn’t seem to make a difference and the registry ke

  • 8088
    windows-7 directx-11 directx-9
    I’ve just installed a new game on my Windows 7 RTM machine. The game is asking me to install DirectX 9.0(c). I said ‘NO’ because my machine has DirectX 11 (confirmed with dxdiag). When I run the game, an error occurs informing me that d3dx9_39.dll is missing.Is Windows 7 DirectX backwards-compatible?

  • zdd
    c++ window directx fullscreen directx-9
    How do I perform a runtime fullscreen/ and window mode swap sUnregisterClass Free all the directX device Re- initlize all the wc class format Re- initlize all the direct stuffHowever, there is two problem to it. I managed to create a new window but the old window is closed or deleted. The client of the new Window is black. Which mean that the direct didnt link to new client.2nd)

  • Drop
    c++ windows directx directx-9
    I had a look at the Font class in DirectX Documentation and looked at this/these question/answers but they didn’t satisdy my need.I tried searching for “C++ DirectX 9 Font library” yet this didn’t yield any useful results.Are there any DX9 Font libraries available that, for example, can load TTF fonts (eg Arial) and then draw them on the screen?The current class I am using does satisfy most of my needs but is buggy as hell 🙁 (in terms of, when I alt tab a third party application in which I draw

  • Marnix
    c++ direct3d directx-9
    I have a std::vector<MyVertex> where MyVertex is a struct. I have to push this data to the vertex buffer in Direct3D 9 and the examples I’ve seen use a memcpy. Unfortunately, memcpy crashes my application so I’m definitely doing something wrong.std::vector<MyVertex> m_VertsBuff0;void* vbPtr; vertexbuffer->Lock (0, 0, &vbPtr, D3DLOCK_DISCARD); memcpy (vbPtr, &m_VertsBuff0[0], sizeof(m_VertsBuff0)); // also tried sizeof(MyVertex)*m_VertsBuff0.size() // std::copy(m_VertsBuff0

  • JustinB
    c++ windows directx-9
    I have a DirectX9 application that sporadically runs into a hang in WM_WINDOWPOSCHANGED. The hang occurs only rarely when alt+tabbing into and out of fullscreen exclusive mode.The application is hung because the main window message processing thread is stuck at WaitForSingleObject() in the DefWindowProc handler. Other threads we have created are operating normally.Call Stack on Stuck Main Thread:ntdll.dll!_NtWaitForSingleObject@12() + 0x15 bytes ntdll.dll!_NtWaitForSingleObject@12() + 0x1

  • clamp
    c# directx-11 directx-9 sharpdx
    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 errorat SharpDX.Result.CheckError() at SharpDX.Direct3D11.Device.CreateDevice(Adapter adapter, DriverType driverType, DeviceCreationFlags flags, FeatureLevel[] featureLevels) at SharpDX.Direct3D11.Device..ctor(Adapter adapter, DeviceCreationFlags f

  • James Podesta
    video windows-xp directx-9
    I am trying to get a fullscreen VMR9 video playback going in DirectX9. The video plays fine (both video and audio are perfect). On one specific target machine, a windows XP with an NVidia 8800GT, I get a crash after the video is closed when the game tries to do any SetRenderState() on the d3ddev.I’ve narrowed right down to the CoCreateInstance of the VideoMixingRenderer9 object. Just doing that and releasing it is enough to ensure all future calls to SetRenderState() will crash.So, the code bel

  • clamp
    c# directx-11 directx-9 sharpdx
    I am looping a h264 video in a SharpDX app and occasionally I am getting a crash which I am unable to find the cause.SharpDX.SharpDXException: HRESULT: [0xC00D36BA], Module: [Unknown], ApiCode: [Unknown/Unknown], Message: Unknown at SharpDX.Result.CheckError() at SharpDX.MediaFoundation.MediaFactory.GetService(ComObject unkObjectRef, Guid guidService, Guid riid, IntPtr& vObjectOut)it is called in this function:public static Surface GetSurfaceFromMediaBuffer(MediaBuffer videoBuffer){IntPtr su

  • Saage
    c++ visual-studio-2010 debugging directx-9
    Question: Can I set up VS2010 so it automatically writes debug output to a file?Motivation: I have a DirectX 9 application that I’m trying to debug. I’ve noticed that when my application is fullscreen, it may crash under certain conditions. Normally I would just check my logs or DirectX debug output. However, the way my program crashes prevents that. It freezes and does not respond to any my attempts to end it (including “End Process” from task manager). Moreover, it also freezes my VS2010, and

  • jszumski
    c++ directx-9
    Since adding a sprite class into a game I am working on, if the user resizes the window it crashes. I had a similar issue when rendering to the back buffer, this was resolved by using the OnLostDevice() and OnResetDevice() methods but that doesn’t seem to be working and at this point I’m not sure what to do I feel like I’m missing something hideously obvious.Sprite.h:#pragma once #include <d3d9.h> #include <d3dx9tex.h> #include <string>class Sprite { public: Sprite(void); virtu

  • jonathan.correia
    c++ visual-studio-2012 directx access-violation directx-9
    I’m not sure quite how to debug this, and I’d really appreciate some help.When I exit the program using the X, I get the following error:Unhandled exception at 0x00007FF854D4E797 (d3d9.dll) in directxtut.exe: 0xC0000005: Access violation reading location 0x0000000040400058.The call stack shows the problem is occurring at line 195, d3d-Release();Thanks in advance!// include the basic windows header files and the Direct3D header file #include <windows.h> #include <windowsx.h> #include

  • Rojuinex
    c++ directx direct3d directx-9 direct2d
    I’m trying to incorporate some Direct2D drawing into an Ogre project. Right now Ogre only really supports DirectX9, which causes some complications with using Direct2D. My solution is this. Draw my overlay to a png using Direct2D, then use DirectX to draw the image to a sprite. I try doing this method and as soon as the draw method is complete, the sprite is corrupted. First the Direct2D drawing code:void SceneManager::_initalize( void ){// Initalize the bitmiaphr = CoCreateInstance( CLSID_W

  • Mantro Loman
    memory graphics directx capture directx-9
    i want to capture my Directx screen from backbuffer to memory address by using “memcpy” function. so i wrote this codes:int ScreenWidth =1024; int ScreenHeight =768; int BITSPERPIXEL =32; // XRGBBYTE* pBits ; IDirect3DSurface9* pSurface;pBits=new BYTE[ScreenWidth*ScreenHeight * 4 ]; //1024 x 768 x 4 for XRGBpd3dDevice->CreateOffscreenPlainSurface(ScreenWidth , ScreenHeight ,D3DFMT_X8R8G8B8, D3DPOOL_SYSTEMMEM, &pSurface, NULL);pd3dDevice->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE::D3DBACKBUF

  • Dilhan Geeth
    directx directx-9
    I have a problem when resetting device after the state was lost. I can reset the Direct3D device but when i call OnLostDevice function on ID3DXFont i get an error.First-chance exception at 0x00e6ec05 in Turbo3D.exe: 0xC0000005: Access violation reading location 0xcccccccc. Unhandled exception at 0x76ee15de in Turbo3D.exe: 0xC0000005: Access violation reading location 0xcccccccc.When i keep a break point at Font->OnLostDevice();I can see that the Font is referring to a memory address 0xccccccc

  • zzz
    c++ directx direct3d directx-9 direct3d9
    In an application, a resource is any virtual components used by the application, such as texture and sound. Can we clean up a resource with destructor? If can, provide an demonstration example. Thanks. I try to use destructor to do clean up but the value is still there. Why the object hasn’t deleted after calling destructor? #include <iostream> using namespace std;class Demo { public: Demo(); // Constructor prototype ~Demo(); // Destructor prototypeint a; };Demo::Demo()

  • Vault13
    c++ directx textures directx-9
    I’m sure there is a simple answer to this one somewhere. I currently have a program which correctly renders a .png image as a texture over a rectangle of vertices. This all works fine and displays correctly. My question is how do I go about rendering a second texture onscreen using a separate image? The easiest/optimal way (I know they are probably different!) The second image I want to add will serve as the background image. I have tried duplicating the CUSTOMVERTEX structure, vertex buffer, se

  • K-ballo
    c++ windows directx-9 language-extension
    I’ve got extensions off on my project but have to turn them on for any cpp file that includes directx or windows headers. If I turn extensions off on those cpp files it won’t compile. Is there a way to get this to work?With language extensions on it compiles fine.I’m using VS2012 express, c++, directx9, and Win7 64.Example errors1>c:\program files (x86)\windows kits\8.0\include\um\winnt.h(10907): error C2467: illegal declaration of anonymous ‘struct’1>c:\program files (x86)\windows kits\

  • Vault13
    c++ directx-9
    I get the below two linking errors when I try to compile in VS 2010. I have ensured that my include & library settings are correct in the project properties > VC ++ Directories & also checked to make sure that Project > Linker > Input has d3d9.lib & d3dx9.lib in it which it does. I’ve also tried adding #pragma comment for the two above libraries in D3DGraphics.h but to no avail :(The compile errors….1>D3DGraphics.obj : error LNK2019: unresolved external symbol _Direct3DCreate9@4

  • Gladstone Asder
    c++ compiler-errors codeblocks directx-9
    Possible Duplicate:undefined reference to `WinMain@16 I am running CodeBlocks, the latest version. I tried to compile a code I found in a tutorial site and I get an error for some reason. I set my project to DirectX9 and I installed the June 2010 DirectX SDK. I also get the warning “unknown pragmas”, something tells me the code won’t run properly even if it compiles.// include the basic windows header files and the Direct3D header file #include <windows.h> #include <windowsx.h> #inc

Web site is in building