Jump to content
  • Advertisement

Emexus

Member
  • Content Count

    115
  • Joined

  • Last visited

Community Reputation

142 Neutral

About Emexus

  • Rank
    Member
  1. ok realise now that im not linking to the right library all sorted now :)
  2. thanks for that, i forgot all about unicode although ive always done TEXT() i never new about putting a L before it. i now recieve a "LNK2019: unresolved external symbol _D3DXLoadMeshFromXW@32 referenced in function "long __cdecl InitDirect3D(struct HWND__ *,int,int,bool)" (?InitDirect3D@@YAJPAUHWND__@@HH_N@Z)" error?
  3. from all the example code ive been reading through thay have the .x file name declared like so: HRESULT hr = D3DXLoadMeshFromX("sphere.x", D3DXMESH_SYSTEMMEM, pD3DDevice9, NULL, &materialBuffer, NULL, &numMaterials, &mesh); but i keep getting a "cannot convert parameter 1 from 'const char [9]' to 'LPCWSTR'" error on my compiler. am i missing something simple here? visual studio 2005.net & DirectX9 cheers Jay
  4. excellent thankyou i cant belived i overlooked thoes lol. so that problem is fixed but i have a new error. now when it runs it comes up with unhandled exception at 0x00411608 in dx_render.exe and is identifying this line: pD3DDevice9->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 255), 1.0f, 0);
  5. Just tried ShowWindow and it makes no difference the window is stil created and displayed and then suddenly destroyed?
  6. heres all the code from the app #include <windows.h> #include <d3D9.h> #include <d3dx9.h> IDirect3D9* pD3D9 = NULL; IDirect3DDevice9* pD3DDevice9 = NULL; HRESULT InitDirect3D(HWND hWnd, int width, int height, bool fullscreen) { pD3D9 = Direct3DCreate9(D3D_SDK_VERSION); if(pD3D9 == NULL) return E_FAIL; // display mode D3DDISPLAYMODE d3ddm; pD3D9->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm); // presentation settings D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.BackBufferWidth = width; d3dpp.BackBufferHeight = height; d3dpp.BackBufferCount = 1; d3dpp.BackBufferFormat = d3ddm.Format; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.Windowed = !fullscreen; d3dpp.EnableAutoDepthStencil = true; d3dpp.AutoDepthStencilFormat = D3DFMT_D16; d3dpp.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; if(FAILED(pD3D9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &pD3DDevice9))) { return E_FAIL; } return S_OK; } void Render(void) { pD3DDevice9->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 255), 1.0f, 0); pD3DDevice9->BeginScene(); // Draw code pD3DDevice9->EndScene(); pD3DDevice9->Present(NULL, NULL, NULL, NULL); } void DestroyD3D(void) { if(pD3DDevice9) { pD3DDevice9->Release(); pD3DDevice9 = NULL; } if(pD3D9) { pD3D9->Release(); pD3D9 = NULL; } } LRESULT CALLBACK WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { switch(Msg) { case WM_CLOSE: DestroyD3D(); UnregisterClass(g_szClassName, hInstance); DestroyWindow(hWnd); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, Msg, wParam, lParam); } return 0; } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR CmdLine, int CmdShow) { WNDCLASSEX windowClass; MSG Msg; HWND hWnd = NULL; static TCHAR g_szClassName[] = TEXT("DXWindowClass"); // class struct windowClass.cbSize = sizeof(WNDCLASSEX); windowClass.style = CS_HREDRAW | CS_VREDRAW; windowClass.lpfnWndProc = WndProc; windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; windowClass.hInstance = hInstance; windowClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); windowClass.hCursor = LoadCursor(NULL, IDC_ARROW); windowClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); windowClass.lpszMenuName = NULL; windowClass.lpszClassName = g_szClassName; windowClass.hIconSm = LoadIcon(NULL, IDI_WINLOGO); if(!RegisterClassEx(&windowClass)) return 0; hWnd = CreateWindowEx(NULL, g_szClassName, TEXT("dx_render"), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 0, 0, 800, 600, NULL, NULL, hInstance, NULL); if(!hWnd) return 0; if(FAILED(InitDirect3D(hWnd, 800, 600, false))) { DestroyD3D(); return 0; } while(1) { PeekMessage(&Msg, hWnd, NULL, NULL, PM_REMOVE); if(Msg.message = WM_QUIT) break; else { Render(); TranslateMessage(&Msg); DispatchMessage(&Msg); } return ((int)Msg.wParam); } return 0; }
  7. Just been following the d3d9 tutorial from here: http://www.gamedev.net/reference/articles/article1943.asp and compiled it, it all runs and the window is created but after about a second the window is destroyed and the only output in the debug window is: Direct3D9: (ERROR) : [0] : Address 00A3D4CB Direct3D9: (ERROR) : [1] : Address 00A3D59B Direct3D9: (ERROR) : [2] : Address 00A3D440 Direct3D9: (ERROR) : [3] : Address 00A31D44 Direct3D9: (ERROR) : [4] : Address 4FDFAF2E Direct3D9: (ERROR) : [5] : Address 00411455 Direct3D9: (ERROR) : [6] : Address 00411969 Direct3D9: (ERROR) : [7] : Address 00412136 Direct3D9: (ERROR) : [8] : Address 00411E9D Direct3D9: (ERROR) : [9] : Address 7C816FD7 Direct3D9: (ERROR) : [10] : Address 00000000 Direct3D9: (ERROR) : [11] : Address 00000000 Direct3D9: (ERROR) : [12] : Address 00000000 Direct3D9: (ERROR) : [13] : Address 00000000 Direct3D9: (ERROR) : [14] : Address 00000000 Direct3D9: (ERROR) : [15] : Address 00000000 any ideas on what this could be?
  8. wasnt sure where to post this really but thought i may get a good responce here, does anyone know if you can get a pci card that is the same a veroboard or strip board for prototyping pci hardware? cheers Jay
  9. Hi, sorry if this is the wrong section to post a question like this, but i wasnt sure where to post and it is related to some application programming im doing. basically i need a md3 exporter for poser, ive tried finding one on the internet but havent come up with anything, any help would be much appreciated :) cheers
  10. Emexus

    Post your screenshots!

    heres what ive been working on:
  11. Emexus

    Sprites, sprites and more sprites!

    Was looking for sprites tonight and came across this site: http://charas-project.net/ click maybe its been posted before? if not maybe it will help someone. cheers. :)
  12. Emexus

    Driver Development Kit

    Hey im just curios as to where on msn you can obtain the ddk for $20 shipping? as im also in need of it and can only find this one Windows DDK Suite 3 Cost : $199.95 USD. click cheers.
  13. Emexus

    creating a tree control

    cheers for the help ive got it working using this code: hTree = CreateWindowEx(0L, WC_TREEVIEW, "", WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS | TVS_TRACKSELECT | TVS_SINGLEEXPAND | TVS_INFOTIP | TVS_FULLROWSELECT | WS_BORDER | WS_TABSTOP, 0, 0, 120, 600, hWnd, (HMENU)IDC_TREE, GetModuleHandle(NULL), NULL);
  14. Hi, i seem to be having some trouble creating a tree control in my application is this the correct way to declare it? hTree = CreateWindowEx(WS_EX_CLIENTEDGE, "SysTreeView32", "", TVS_NOSCROLL | WS_BORDER | WS_TABSTOP, 0, 0, 120, 600, hWnd, (HMENU)IDC_TREE, GetModuleHandle(NULL), NULL); cheers
  15. Hi, ive been doing a lot of work with c# and ive noticed i can set the dialog size in the properties section in visual studio 7, now i need to do this in a win32 app but it dosent give me an option to set a specific size for the dialog, is there a option to set this? cheers for any help :)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!