Thread: E_OUTOFMEMORY hResult with DirectX 10

  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    27

    E_OUTOFMEMORY hResult with DirectX 10

    Until now I had never seen this return code. My DirectX 10 program had been running perfectly fine on a Vista laptop, and the code used a REFERENCE device type for the Direct3D component.

    Now, on my desktop, I have a DirectX 10 compatible video card, with Vista also installed now (sad to say, but necessary >_<).

    The weird thing is, if I leave my code exactly the way it is, the very first hResult function call <<D3D10CreateDeviceAndSwapChain>> will always return E_OUTOFMEMORY. I highly doubt it is a VRAM problem (I have 1024 MB) and my system RAM is 3 GB, plenty of which is still available. Just by chance I switched the device type from REFERENCE to HARDWARE, and it works like a charm now. I tried to look up information about this but I am confused......it does not seem like memory should be a problem in that particular scenario. Is the hResult function call SUPPOSED to return that error code if I have a compatible hardware device? I just want to understand this so I can potentially avoid and/or understand future issues.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Why are you using reference in the first place?

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    27
    I was using reference originally because my laptop, where the program originated, is incompatible with the hardware device.

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    That is a very rare thing. Every card, integrated or not, nowadays supports hardware acceleration. If it does, update the drivers.
    Now, reference mode is not meant to be "play mode". It is more of a simulation mode.
    So you are far better off using hardware mode, as you are supposed to be using.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Spore in 4 days.
    By VirtualAce in forum A Brief History of Cprogramming.com
    Replies: 64
    Last Post: 09-29-2008, 09:54 AM
  2. Problem I Can't solve...
    By ferniture in forum C Programming
    Replies: 3
    Last Post: 07-15-2008, 02:51 AM
  3. DirectX 8 with Borland
    By Tommaso in forum Game Programming
    Replies: 11
    Last Post: 08-12-2003, 09:30 AM
  4. Heaps...
    By Nutshell in forum C Programming
    Replies: 14
    Last Post: 04-23-2002, 08:54 AM
  5. Formatting Output
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 03-26-2002, 01:33 AM