pcbrainbuster

Member
  • Content count

    202
  • Joined

  • Last visited

Community Reputation

100 Neutral

About pcbrainbuster

  • Rank
    Member
  1. First Time using DirectX 10

    Woot!!! Success :D. All my problems are resolved. The screen now shows the colour I expected it to and now I can render using the hardware device! As far as forgetting the Present function... what can I say? DirectX 10 makes anything that was obvious in DirectX 9 obsolete so... not my fault :P. Thanks to everyone that helped!
  2. First Time using DirectX 10

    Oh that was supposed to be BackBufferT->Release()... thanks for pointing that out but it didn't seem to change anything :S... Am I doing something that's considering wrong? because nothing is showing up...
  3. First Time using DirectX 10

    My render function is being called (RenderD3D())...
  4. First Time using DirectX 10

    Well I guess I've concluded that my graphics card isn't good enough to provide hardware acceleration. But I still have another problem now... for some reason that following code jst displays a white screen even though it should have some colour now. #include <windows.h> #include <d3d10.h> #include <d3dx10.h> #pragma comment (lib, "d3d10.lib") #pragma comment (lib, "d3dx10.lib") #define Screen_Width 640 #define Screen_Height 480 HINSTANCE hInstance = NULL; HWND hWnd = NULL; ID3D10Device* D3D = NULL; IDXGISwapChain* SwapChain = NULL; ID3D10RenderTargetView* RenderTargetView = NULL; LRESULT CALLBACK MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); VOID InitD3D(); VOID RenderD3D(); VOID CleanDX(); INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) { MSG Msg; WNDCLASSEX WndClass; ZeroMemory(&WndClass, sizeof(WNDCLASSEX)); WndClass.cbSize = sizeof(WNDCLASSEX); WndClass.hbrBackground = GetSysColorBrush(COLOR_WINDOW); WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); WndClass.hInstance = hInstance; WndClass.lpfnWndProc = MainWndProc; WndClass.lpszClassName = "MainWND-Class"; WndClass.style = CS_HREDRAW | CS_VREDRAW; RegisterClassEx(&WndClass); hWnd = CreateWindowEx(NULL, WndClass.lpszClassName, "Test", WS_VISIBLE | WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, Screen_Width, Screen_Height, NULL, NULL, hInstance, NULL); UpdateWindow(hWnd); InitD3D(); while(GetMessage(&Msg, NULL, NULL, NULL) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); RenderD3D(); } CleanDX(); return 0; } LRESULT CALLBACK MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_DESTROY: PostQuitMessage(WM_QUIT); break; default: DefWindowProc(hWnd, Msg, wParam, lParam); } return TRUE; } VOID InitD3D() { DXGI_SWAP_CHAIN_DESC SC_Desc; ID3D10Texture2D* BackBufferT; D3D10_VIEWPORT VP; ZeroMemory(&SC_Desc, sizeof(SC_Desc)); SC_Desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; SC_Desc.BufferDesc.Height = Screen_Height; SC_Desc.BufferDesc.RefreshRate.Denominator = 1; SC_Desc.BufferDesc.RefreshRate.Numerator = 60; SC_Desc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; SC_Desc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; SC_Desc.BufferDesc.Width = Screen_Width; SC_Desc.BufferCount = 1; SC_Desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; SC_Desc.Flags = 0; SC_Desc.OutputWindow = hWnd; SC_Desc.SampleDesc.Count = 1; SC_Desc.SampleDesc.Quality = 0; SC_Desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; SC_Desc.Windowed = TRUE; D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, NULL, D3D10_SDK_VERSION, &SC_Desc, &SwapChain, &D3D); SwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*)&BackBufferT); D3D->CreateRenderTargetView(BackBufferT, NULL, &RenderTargetView); SwapChain->Release(); D3D->OMSetRenderTargets(1, &RenderTargetView, NULL); VP.TopLeftX = 0; VP.TopLeftY = 0; VP.Width = Screen_Width; VP.Height = Screen_Height; VP.MinDepth = 0; VP.MaxDepth = 1; D3D->RSSetViewports(1, &VP); } VOID RenderD3D() { D3D->ClearRenderTargetView(RenderTargetView, D3DXCOLOR(0, 0.5f, 0, 0)); } VOID CleanDX() { } Sigh... any ideas?
  5. First Time using DirectX 10

    It only failed under hardware mode if that's of any constellation...
  6. First Time using DirectX 10

    Alright then my card should support DirectX 10?... Man this is frustrating.... What the hell could be the cause.
  7. First Time using DirectX 10

    I got the same error for both functions for some reason :S... Alright I just went through the SDK's DirectX 10 sample programs and found that only the "EmptyProject10" file loads without asking me if I want to use a reference device... but it moved around really slowly when I dragged it which leads me to believe that it may have automatically decided to load a reference deice for me.
  8. First Time using DirectX 10

    Well I got an DXGI_ERROR_UNSUPPORTED... here's the code I used: HRESULT HR = D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, NULL, D3D10_SDK_VERSION, &SC_Desc, &SwapChain, &D3D); MessageBox(NULL, DXGetErrorString(HR), NULL, NULL); Any ideas on what that error code means?
  9. First Time using DirectX 10

    Well... I alredy know about the HRESULT HR = (function here) thing... but how do I actually check after that? I mean what do I do with the retrieved value?
  10. First Time using DirectX 10

    Yeah, I'm using Vista. How do I check the return code? I only know about the "FAILED" and "SUCCEEDED" macros...
  11. First Time using DirectX 10

    My graphics card is "Mobile Intel(R) 965 Express Chipset Family"... not to high-tech is it.
  12. First Time using DirectX 10

    Thanks for the posts. I checked to see if D3D10CreateDeviceAndSwapChain was the cause and it does seem to be. I used this line of code: if(FAILED(D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, NULL, D3D10_SDK_VERSION, &SC_Desc, &SwapChain, &D3D)) == TRUE) MessageBox(NULL, NULL, NULL, NULL); ... the message box did actually come up which tells me that something there went wrong, but what? How can I tell? Thanks.
  13. First Time using DirectX 10

    Well when the program starts I get an error message that just states that my program has stopped working. That's all.
  14. Hiya guys been a while, EDIT - Please scroll down... the nature of the problem has infact changed. Thank you. I just recently began to learn DirectX 10 after a long while without programming... and well it feels great. The problem is that I am... "stuck". Here's my current code: #include <windows.h> #include <d3d10.h> #include <d3dx10.h> #pragma comment (lib, "d3d10.lib") #pragma comment (lib, "d3dx10.lib") #define Screen_Width 640 #define Screen_Height 480 HINSTANCE hInstance = NULL; HWND hWnd = NULL; ID3D10Device* D3D = NULL; IDXGISwapChain* SwapChain = NULL; LRESULT CALLBACK MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); VOID InitD3D(); VOID RenderD3D(); VOID CleanDX(); INT WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow) { MSG Msg; WNDCLASSEX WndClass; ZeroMemory(&WndClass, sizeof(WNDCLASSEX)); WndClass.cbSize = sizeof(WNDCLASSEX); WndClass.hbrBackground = GetSysColorBrush(COLOR_WINDOW); WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); WndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); WndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); WndClass.hInstance = hInstance; WndClass.lpfnWndProc = MainWndProc; WndClass.lpszClassName = "MainWND-Class"; WndClass.style = CS_HREDRAW | CS_VREDRAW; RegisterClassEx(&WndClass); hWnd = CreateWindowEx(NULL, WndClass.lpszClassName, "Test", WS_VISIBLE | WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, Screen_Width, Screen_Height, NULL, NULL, hInstance, NULL); UpdateWindow(hWnd); InitD3D(); while(GetMessage(&Msg, NULL, NULL, NULL) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); RenderD3D(); } CleanDX(); return 0; } LRESULT CALLBACK MainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_DESTROY: PostQuitMessage(WM_QUIT); break; default: DefWindowProc(hWnd, Msg, wParam, lParam); } return TRUE; } VOID InitD3D() { DXGI_SWAP_CHAIN_DESC SC_Desc; ID3D10RenderTargetView* RenderTargetView; ID3D10Texture2D* BackBufferT; ZeroMemory(&SC_Desc, sizeof(SC_Desc)); SC_Desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; SC_Desc.BufferDesc.Height = Screen_Height; SC_Desc.BufferDesc.RefreshRate.Denominator = 1; SC_Desc.BufferDesc.RefreshRate.Numerator = 60; SC_Desc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; SC_Desc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; SC_Desc.BufferDesc.Width = Screen_Width; SC_Desc.BufferCount = 1; SC_Desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; SC_Desc.Flags = 0; SC_Desc.OutputWindow = hWnd; SC_Desc.SampleDesc.Count = 1; SC_Desc.SampleDesc.Quality = 0; SC_Desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; SC_Desc.Windowed = TRUE; D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, NULL, D3D10_SDK_VERSION, &SC_Desc, &SwapChain, &D3D); SwapChain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*)&BackBufferT); D3D->CreateRenderTargetView(BackBufferT, NULL, &RenderTargetView); BackBufferT->Release(); } VOID RenderD3D() { } VOID CleanDX() { } As you can see its not complete. The problem is that when I compile the program I get an error, but when I set the device type to D3D10_DRIVER_TYPE_REFERENCE my program compiles without a problem. What I don't understand is why that little change fixes everything... I mean you need to use the reference device type only if the hardware has some sort of bug or if your graphics card simply doesn't support DirectX 10. I'm sure that my graphics card does indeed support DirectX 10 because when I open up the DirectX Diagnostic Tool ("dxdiag" in "run") it reports "DirectX 10" and the DirectX version. Do any of you guys know what's causing this problem? Thank you. [Edited by - pcbrainbuster on July 22, 2009 6:03:34 PM]
  15. All purpose 3D format converter

    Hello guys, I once used to have a program that could convert ALL sorts of different 3D program extensions(eg x, 3ds max, may...), but mycomputer messed up and I forgot the name. Could someone please tell me if they know what program I am talking about. I also recall the first letter being p... I think. Thanks alot.