• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

134 Neutral

About IlyaZ

  • Rank
  1. Hi, I've got a question. Let's say I want to draw an image on the screen. I create a Vertex Buffer etc. Load a texture onto it and display it. Why would I want to use a sprite for this? //IlyaZ
  2. id3dxsprite enlarges picture

    Why not just use the D3DX_DEFAULT_NONPOW2 param?
  3. I think I managed to convert cNoobs code to Dx9, but nothing happened apart from that the screen turned blue (probably due to the clean screen line). I had very similar code to the one of 3ddreams but didn't use the rhw param. I made the changes but nothing turned up. I'll look a bit more if I forgot something. Edit: Had no luck. I just reviewed my old calculation and saw that it was wrong. The textures work for diff resoultions now. Thanks anyway :) (I'll probably consider one of your ideas later, but right now I need quick results) [Edited by - IlyaZ on May 3, 2006 2:25:44 PM]
  4. Hiho, I've got a picture for a menu with res 1280x1024. I manage to fit the screen with it by adjusting the cam distance. Each pixel = 1 in game length unit. So the texture is 1280 wide and 1024 high. When I position the camera at -2470 (Z) it covers the whole screen. How do I calculate the 2470 (I want to do the same with other resolutions)? What is the angle in D3DXMatrixPerspectiveFovLH() doing? Thanks, IlyaZ
  5. Thanks, that helped a lot :)
  6. I'm trying to put my Console stuff into a separate class in a separate file. But I've got a problem as the console uses main app functions like print for fonts etc. So in order to use the Console I need to include it in the winmain app. But I _also_ need to include the main app class in the Console.h files in order to use the built in functions. And that can't be done what I know. So I got two choices I think. Either I skip the whole idea, or I split the console in both places. The last alternative doesn't sound very good. So I wonder if there's some way to split up code (if I want to keep the console as functions) in separate files anyway? It gets too messy with loads of code in one single file.
  7. What would be considered as a device state? Apart from when it's lost or ready? What about light? It has to be recreated? Is there a list of everything that should be recreated or how do you know? Do I recreate the IDirect3D9 interface? Like by calling Direct3DCreate9(D3D_SDK_VERSION)?
  8. Ok, that breakpoint thing was just a DX debug feature (I'm new to that stuff). So no prob with that. Anyway, according to the FPS counter the model is there. But I can't see it. I see fonts etc. But the model is invisible once I alt-tab back in. I'm quite confident that the cModel class releases everything, but I want to be 100% sure. How would I see if everything really is released?
  9. Name of GFX card?

    Well there are some games where you pick the device and resolution. In the windows monitor properties screen I see Dell1234. But I guess that's ok for the user just (he should just know which one he picks). So .Description seems to be fine.
  10. Name of GFX card?

    I tried that too. But on my laptop I just get something like Dell1234. Might be so because it's integrated. But still I got a Geforce2 Go. Hmm I'll try Description on some other computer. Thanks.
  11. Device Enumeration

    just add this line for the formats. "Hz" <<" with "<<rMode.fmt<< endl;
  12. I thought D3DADAPTER_IDENTIFIER9.DeviceName printed the name of the gfx card. Like Nvidia Geforce 2 Go. But apparently it doesn't. How do you fellas identify cards?
  13. It looks like everything in the cModel class is released properly (at least the DX debug doesn't say anything). But when I toggle full screen and alt-tab in and out the screen turns white for a sec then I see that my model has disappeared plus there's a FPS drop and when I exit the app DX Debug tells me this: "Unhandled exception at 0x7c901230 in App.exe: User breakpoint." I have no idea what it is. I'm using the CModel class from the gamedev tutorial. (Looks like I can use SAFE_DELETE there) http://www.gamedev.net/reference/articles/article2079.asp Maybe I should reposition the camera again? I'll check a few lost device tutorials. If someone knows a good tut or source I would be glad to study it. Also, is it possible to force the device to be lost when not in full screen mode? I heard about changing color depth. But is there another way?
  14. Hey, I'm trying to fix loaded models back on screen after the device has been lost. But the model doesn't appear again. To load the model both in the init and in the restore objects function I do this: m_pSceneModel = new cModel(m_Graphics.GetDeviceCOM()); m_pSceneModel->LoadXFile("tiny.x"); In the shutdown and in the invalidate objects functions I do this: SAFE_DELETE(m_pSceneModel); I mean I deleted the models completely and re-loaded them. But still the model doesn't want to appear. I also read about using the COM ->Release(); (SAFE_RELEASE). But what exactly am I supposed to release? cModel: class cModel { private: LPDIRECT3DDEVICE9 m_pd3dDevice; //The d3d device to use //Model LPMESHCONTAINER m_pFirstMesh; // The first mesh in the hierarchy LPD3DXFRAME m_pFrameRoot; // Frame hierarchy of the model LPD3DXMATRIX m_pBoneMatrices; // Used when calculating the bone position D3DXVECTOR3 m_vecCenter; // Center of bounding sphere of object float m_fRadius; // Radius of bounding sphere of object UINT m_uMaxBones; // The Max number of bones for the model //Animation DWORD m_dwCurrentAnimation; // The current animation DWORD m_dwAnimationSetCount; // Number of animation sets LPD3DXANIMATIONCONTROLLER m_pAnimController;// Controller for the animations I guess it's the LPMESHCONTAINER that has to be released. How can I do this in an easy way? typedef struct _D3DXMESHCONTAINER_DERIVED: public D3DXMESHCONTAINER { //Mesh variables LPDIRECT3DTEXTURE9* ppTextures; // Textures of the mesh D3DMATERIAL9* pMaterials9; // Use the DirectX 9 Material type //Skinned mesh variables LPD3DXMESH pOrigMesh; // The original mesh D3DXMATRIX* pBoneMatrices; // The bones for the mesh D3DXMATRIX* pBoneOffsets; // The bone matrix Offsets D3DXMATRIX* pFrameMatrices; // The Frame Matrix }MESHCONTAINER, *LPMESHCONTAINER; I tried this but the screen only turns white: if(m_pFirstMesh) { CAllocateHierarchy Alloc; Alloc.DestroyMeshContainer(m_pFirstMesh); m_pFirstMesh = NULL; } Btw. what's the forum code for those "code boxes"?
  15. Gawrsh, what a stupid error. g_bDeviceLost = false; is supposed to be one step lower just. Case closed :)
  • Advertisement