Jump to content
  • Advertisement

rkaganda

Member
  • Content Count

    9
  • Joined

  • Last visited

Community Reputation

122 Neutral

About rkaganda

  • Rank
    Newbie
  1. I just started using VS2005, first things I did was add winxp sdk sp2 dir to the include list, now everytime i compile i get about 30 warnings on how specstrings.h(win xp sdk) is redefining macros that are in sal.h(vs includes). The warnings are as follows: ...\microsoft platform sdk for windows xp sp2\include\specstrings.h(334) : warning C4005: '__reserved' : macro redefinition ...\microsoft visual studio 8\vc\include\sal.h(702) : see previous definition of '__reserved' The are about 30 total. Im wondering how to get rid of these warnings. Im not including these directly so is there some way to tell VS to just disregard them. Its just a pain wading through 30 warings when I compile. Thx for the help.
  2. I'm trying compile some DirectX 9 tutorial code using Dev C. In one the the headers I include dshow.h, which includes strmif.h From what I understand this declaration in DX9SDK\Include\strmif.h on line 28964 typedef struct tagVMRGUID { GUID *pGUID; GUID GUID; } VMRGUID; Conflicts with this declaration in Dev-Cpp\include\winnt.h on line 1346 typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID, *REFGUID, *LPGUID; This is the full compiler log: In file included from C:/directX/DX9SDK/Include/dshow.h:46, from stdafx.h:29, from CApplication.cpp:14: C:/directX/DX9SDK/Include/strmif.h:28967: error: declaration of `GUID tagVMRGUID::GUID' C:/Dev-Cpp/include/winnt.h:1351: error: changes meaning of `GUID' from `typedef struct _GUID GUID' Im not sure how to solve this problem, any input would be helpful. Thanks.
  3. I'm trying compile some DirectX 9 tutorial code using Dev C. In one the the headers I include dshow.h, which includes strmif.h From what I understand this declaration in DX9SDK\Include\strmif.h on line 28964 typedef struct tagVMRGUID { GUID *pGUID; GUID GUID; } VMRGUID; Conflicts with this declaration in Dev-Cpp\include\winnt.h on line 1346 typedef struct _GUID { unsigned long Data1; unsigned short Data2; unsigned short Data3; unsigned char Data4[8]; } GUID, *REFGUID, *LPGUID; This is the full compiler log: In file included from C:/directX/DX9SDK/Include/dshow.h:46, from stdafx.h:29, from CApplication.cpp:14: C:/directX/DX9SDK/Include/strmif.h:28967: error: declaration of `GUID tagVMRGUID::GUID' C:/Dev-Cpp/include/winnt.h:1351: error: changes meaning of `GUID' from `typedef struct _GUID GUID' Im not sure how to solve this problem, any input would be helpful. Thanks.
  4. I figured out the problem. Or at least found a solution. If I turn off the TV output on my Radeon 7500(pci) I have no problems whatsoever. - If I have it turned whenever CreateDevice is called I get the "Invalid Call". Even running DirectX Viewer results in the same.
  5. Settings for d3dpp are: d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; d3dpp.BackBufferFormat = d3ddm.Format; Here is the complete source that im working with right now. #include <windows.h> #include <d3d9.h> //error header #include <dxerr9.h> LPDIRECT3D9 g_pD3D = NULL; LPDIRECT3DDEVICE9 g_pD3DDevice = NULL; HRESULT InitialiseD3D(HWND hWnd) { //First of all, create the main D3D object. If it is created successfully we //should get a pointer to an IDirect3D8 interface. g_pD3D = Direct3DCreate9(D3D_SDK_VERSION); if(g_pD3D == NULL) { MessageBox(NULL, "E_FAIL Direct3DCreate9(D3D_SDK_VERSION) = NULL", "Error!",MB_ICONEXCLAMATION | MB_OK); return E_FAIL; } //Get the current display mode D3DDISPLAYMODE d3ddm; if(FAILED(g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm))) { MessageBox(NULL, "FAILED(g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm))", "Error!",MB_ICONEXCLAMATION | MB_OK); return E_FAIL; } //Create a structure to hold the settings for our device D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); //Fill the structure. //We want our program to be windowed, and set the back buffer to a format //that matches our current display mode d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; d3dpp.BackBufferFormat = d3ddm.Format; //Create a Direct3D device. HRESULT hr=g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd,D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pD3DDevice); if(hr) { //get error string MessageBox(NULL, "Failed to create D3D device!", "Error!",MB_ICONEXCLAMATION | MB_OK); MessageBox(NULL, DXGetErrorString9(hr), "Error!",MB_ICONEXCLAMATION | MB_OK); MessageBox(NULL, DXGetErrorDescription9(hr), "Error!",MB_ICONEXCLAMATION | MB_OK); return E_FAIL; } if(&g_pD3DDevice==NULL) { MessageBox(NULL, "g_pD3DDevice == NULL", "Error!", MB_ICONEXCLAMATION | MB_OK); } if(&d3dpp==NULL) { MessageBox(NULL, "d3dpp == NULL", "Error!", MB_ICONEXCLAMATION | MB_OK); } if(hWnd==NULL) { MessageBox(NULL, "hWnd == NULL", "Error!", MB_ICONEXCLAMATION | MB_OK); } return S_OK; } void Render() { if(g_pD3DDevice == NULL) { return; } //Clear the backbuffer to a green color g_pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 255, 0), 1.0f, 0); //Begin the scene g_pD3DDevice->BeginScene(); //Rendering of our game objects will go here //End the scene g_pD3DDevice->EndScene(); //Filp the back and front buffers so that whatever has been rendered on the back buffer //will now be visible on screen (front buffer). g_pD3DDevice->Present(NULL, NULL, NULL, NULL); } void CleanUp() { if(g_pD3DDevice != NULL) { g_pD3DDevice->Release(); g_pD3DDevice = NULL; } if(g_pD3D != NULL) { g_pD3D->Release(); g_pD3D = NULL; } } void GameLoop() { //Enter the game loop MSG msg; BOOL fMessage; PeekMessage(&msg, NULL, 0U, 0U, PM_NOREMOVE); while(msg.message != WM_QUIT) { fMessage = PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE); if(fMessage) { //Process message TranslateMessage(&msg); DispatchMessage(&msg); } else { //No message to process, so render the current scene Render(); } } } //The windows message handler LRESULT WINAPI WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DESTROY: PostQuitMessage(0); return 0; break; case WM_KEYUP: switch (wParam) { case VK_ESCAPE: //User has pressed the escape key, so quit DestroyWindow(hWnd); return 0; break; } break; } return DefWindowProc(hWnd, msg, wParam, lParam); } //Application entry point INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT) { //Register the window class WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_CLASSDC, WinProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, "DX Project 1", NULL}; if(!RegisterClassEx(&wc)) { MessageBox(NULL, "Window Registration Failed!", "Error!",MB_ICONEXCLAMATION | MB_OK); return 0; } //Create the application's window HWND hWnd = CreateWindow("DX Project 1", "www.andypike.com: Tutorial 1", WS_OVERLAPPEDWINDOW, 50, 50, 500, 500, GetDesktopWindow(), NULL, wc.hInstance, NULL); if(hWnd == NULL) { MessageBox(NULL, "Window Creation Failed!", "Error!", MB_ICONEXCLAMATION | MB_OK); return 0; } //Initialize Direct3D if(SUCCEEDED(InitialiseD3D(hWnd))) { //Show our window ShowWindow(hWnd, SW_SHOWDEFAULT); UpdateWindow(hWnd); //Start game running: Enter the game loop GameLoop(); } CleanUp(); UnregisterClass("DX Project 1", wc.hInstance); return 0; } [Edited by - rkaganda on November 12, 2005 9:34:23 AM]
  6. Whenever I call CreateDevice of IDirect3D9 it fails. When I call DXGetErrorString9 and DXGetErrorDescription9 I get "D3DERR_INVALIDCALL" and "Invalid call" HRESULT hr=g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_REF, hWnd,D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &g_pD3DDevice); if(hr) { //get error string MessageBox(NULL, "Failed to create D3D device!", "Error!",MB_ICONEXCLAMATION | MB_OK); MessageBox(NULL, DXGetErrorString9(hr), "Error!",MB_ICONEXCLAMATION | MB_OK); MessageBox(NULL, DXGetErrorDescription9(hr), "Error!",MB_ICONEXCLAMATION | MB_OK); return E_FAIL; } hWnd, &d3dpp, and &g_pD3DDevice arnt NULL I've tried setting the 2nd param, D3DDEVTYPE_REF to D3DDEVTYPE_HAL And the 3rd D3DCREATE_HARDWARE_VERTEXPROCESSING to D3DCREATE_MIXED_VERTEXPROCESSING and D3DCREATE_SOFTWARE_VERTEXPROCESSING but all with the same error resulting. I've encounted this problem on all the DX9 tutorial source I've found whenever CreateDevice is called.
  7. I found that im returning E_FAIL at line 38 if(FAILED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pD3DDevice))) { return E_FAIL; } DXGetErrorString9() gives me "D3DERR_INVALIDCALL" hWnd, &d3dpp, and &g_pD3DDevice arent not NULL. I've also tired changing D3DCREATE_SOFTWARE_VERTEXPROCESSING to D3DCREATE_HARDWARE_VERTEXPROCESSING and D3DDEVTYPE_HAL to D3DDEVTYPE_REF but the same error results. Wherebouts could I be going wrong? [Edited by - rkaganda on November 11, 2005 5:11:59 PM]
  8. i downloaded some sample code off a site and put it into dev c after taking care of a few link errors it compiled and linked fine but nothing happens ... i get a flash of the console then nothing the code is as follows #include <d3d8.h> LPDIRECT3D8 g_pD3D = NULL; LPDIRECT3DDEVICE8 g_pD3DDevice = NULL; HRESULT InitialiseD3D(HWND hWnd) { //First of all, create the main D3D object. If it is created successfully we //should get a pointer to an IDirect3D8 interface. g_pD3D = Direct3DCreate8(D3D_SDK_VERSION); if(g_pD3D == NULL) { return E_FAIL; } //Get the current display mode D3DDISPLAYMODE d3ddm; if(FAILED(g_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm))) { return E_FAIL; } //Create a structure to hold the settings for our device D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); //Fill the structure. //We want our program to be windowed, and set the back buffer to a format //that matches our current display mode d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_COPY_VSYNC; d3dpp.BackBufferFormat = d3ddm.Format; //Create a Direct3D device. if(FAILED(g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &g_pD3DDevice))) { return E_FAIL; } return S_OK; } void Render() { if(g_pD3DDevice == NULL) { return; } //Clear the backbuffer to a green color g_pD3DDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 255, 0), 1.0f, 0); //Begin the scene g_pD3DDevice->BeginScene(); //Rendering of our game objects will go here //End the scene g_pD3DDevice->EndScene(); //Filp the back and front buffers so that whatever has been rendered on the back buffer //will now be visible on screen (front buffer). g_pD3DDevice->Present(NULL, NULL, NULL, NULL); } void CleanUp() { if(g_pD3DDevice != NULL) { g_pD3DDevice->Release(); g_pD3DDevice = NULL; } if(g_pD3D != NULL) { g_pD3D->Release(); g_pD3D = NULL; } } void GameLoop() { //Enter the game loop MSG msg; BOOL fMessage; PeekMessage(&msg, NULL, 0U, 0U, PM_NOREMOVE); while(msg.message != WM_QUIT) { fMessage = PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE); if(fMessage) { //Process message TranslateMessage(&msg); DispatchMessage(&msg); } else { //No message to process, so render the current scene Render(); } } } //The windows message handler LRESULT WINAPI WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DESTROY: PostQuitMessage(0); return 0; break; case WM_KEYUP: switch (wParam) { case VK_ESCAPE: //User has pressed the escape key, so quit DestroyWindow(hWnd); return 0; break; } break; } return DefWindowProc(hWnd, msg, wParam, lParam); } //Application entry point INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR, INT) { //Register the window class WNDCLASSEX wc = {sizeof(WNDCLASSEX), CS_CLASSDC, WinProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, "DX Project 1", NULL}; RegisterClassEx(&wc); //Create the application's window HWND hWnd = CreateWindow("DX Project 1", "www.andypike.com: Tutorial 1", WS_OVERLAPPEDWINDOW, 50, 50, 500, 500, GetDesktopWindow(), NULL, wc.hInstance, NULL); //Initialize Direct3D if(SUCCEEDED(InitialiseD3D(hWnd))) { //Show our window ShowWindow(hWnd, SW_SHOWDEFAULT); UpdateWindow(hWnd); //Start game running: Enter the game loop GameLoop(); } CleanUp(); UnregisterClass("DX Project 1", wc.hInstance); return 0; } it compiles and run's fine but i dont even get a window edit: i checked and RegisterClassEx doesnt return 0 and hWnd isnt NULL so my problem isnt there? [Edited by - rkaganda on November 11, 2005 7:28:08 PM]
  9. 've been trying to compile and link a projec in dev c++ with 3 files it compiles fine but when it tries to link i get the error C:\Dev-Cpp\projects\winclassproject\main.o(.text+0xb2) In function `Z11MainWndProcP6HWND__jjl': [Linker error] undefined reference to `_ZN10MainWindow9MyWndProcEP6HWND__jjl@20' i declare the function in one (mainwindow.h) as funtion of class MainWindow with this bit class MainWindow { ....other code public: LRESULT CALLBACK MyWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); ....other code }; then define it in mainwindow.cpp with this LRESULT CALLBACK MyWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { .... } then reference it in main.cpp here LRESULT CALLBACK MainWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { return AppWindow.MyWndProc(hwnd,msg,wParam,lParam); } i also reference other member funtions of class MainWIndow with my instance AppWindow and they link fine? (i dont get linker errors when i reference them) i've tried to add to add mainwindow.o to the linker param when i buid but then i end up just getting many mutiple defintions errors the compile log is as follows: Compiler: Default compiler Building Makefile: "C:\Dev-Cpp\projects\winclassproject\Makefile.win" Executing make clean rm -f mainwindow.o main.o winclassproject.exe g++.exe -D__DEBUG__ -c mainwindow.cpp -o mainwindow.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -g3 g++.exe -D__DEBUG__ -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" -g3 g++.exe -D__DEBUG__ mainwindow.o main.o -o "winclassproject.exe" -L"C:/Dev-Cpp/lib" -L"gdi32.lib" -mwindows -g3 main.o(.text+0xb2): In function `Z11MainWndProcP6HWND__jjl': C:/Dev-Cpp/projects/winclassproject/main.cpp:28: undefined reference to `_ZN10MainWindow9MyWndProcEP6HWND__jjl@20' collect2: ld returned 1 exit status make.exe: *** [winclassproject.exe] Error 1 Execution terminated -- aahhhh thx for the help
  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!