[DirectX] I cant figure out this error...

This is a discussion on [DirectX] I cant figure out this error... within the Game Programming forums, part of the General Programming Boards category; I tried using the DXTrace function, but all it says even if i make an error occur is unknown error. ...

  1. #16
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    I tried using the DXTrace function, but all it says even if i make an error occur is unknown error. It doesn't show the file or line number like the docs say it should.
    I am linking against DxErr9.lib ( i tried dxErr.lib also ).
    This is how i am using it. Am I doing this wrong?
    Code:
    HRESULT RetVal = sData->d3D->CreateDevice(D3DADAPTER_DEFAULT,
                          D3DDEVTYPE_HAL,
                          sData->hWnd,
                          D3DCREATE_HARDWARE_VERTEXPROCESSING,
                          &d3dpp,
                          &sData->d3DDev);
    	if ( RetVal != D3D_OK )
    	{
    		DXTrace(__FILE__,__LINE__,RetVal,NULL,TRUE);
    		Shutdown();
    		exit(1);
    	}

  2. #17
    Malum in se abachler's Avatar
    Join Date
    Apr 2007
    Posts
    3,189
    Are you using getdevcaps to make sure your device can handle the settings you are putting into d3dpp? Try printing otu teh actual hexadecimal code that is returned in RetVal.
    Until you can build a working general purpose reprogrammable computer out of basic components from radio shack, you are not fit to call yourself a programmer in my presence. This is cwhizard, signing off.

  3. #18
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    That code will not work on this computer. I purposely made it so. I am trying to figure out why
    Code:
    DXTrace(__FILE__,__LINE__,RetVal,NULL,TRUE);
    is not working.

    I have attached a image of the screen when the message box is showing. It has absolutely no information in it.

    I can do
    Code:
    DXTrace(__FILE__,__LINE__,RetVal,NULL,FALSE);
    and the debug message shows the information in the debugger window, but I want to have message box errors.

    Bubba:

    the doc states that you can set D3DFMT_UNKNOWN in windowed mode, but do not have to.
    Quote Originally Posted by Documentation
    BackBufferFormat
    The back buffer format. For more information about formats, see D3DFORMAT. This value must be one of the render-target formats as validated by IDirect3D9::CheckDeviceType. You can use IDirect3DDevice9::GetDisplayMode to obtain the current format.
    In fact, D3DFMT_UNKNOWN can be specified for the BackBufferFormat while in windowed mode. This tells the runtime to use the current display-mode format and eliminates the need to call IDirect3DDevice9::GetDisplayMode.

    For windowed applications, the back buffer format no longer needs to match the display-mode format because color conversion can now be done by the hardware (if the hardware supports color conversion). The set of possible back buffer formats is constrained, but the runtime will allow any valid back buffer format to be presented to any desktop format. (There is the additional requirement that the device be operable in the desktop mode; devices typically do not operate in 8 bits per pixel modes.)

    Full-screen applications cannot do color conversion.
    Attached Images Attached Images  
    Last edited by Raigne; 09-05-2008 at 02:47 AM.

  4. #19
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Posts
    23,031
    You can use alt+print screen to take a snapshot only of the dialog, you know...
    You can also try DXGetErrorString9 or whatever it's called. It gets the error description from an error code.
    Then just print it.
    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.

  5. #20
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    I understand that, but kind of odd that the DX function does not work.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 09:39 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 11:52 PM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21