shalrath

Members
  • Content count

    106
  • Joined

  • Last visited

Community Reputation

128 Neutral

About shalrath

  • Rank
    Member
  1. I'm winding myself up to allowing users to input various languages into the project I'm working on at the moment. I've decided to use the Windows IME system for input, however, after reading the MSDN articles on the use of the IME, I'm no closer to a solution than those who believe the meaning of life is not 42. Are there any good tutorials on the implementation of the IME system around? I've been googling for around 2 hours now... and come up with nothing yet.
  2. Hi, I know that this is probably the most discussed item on the forums... However, I've searched google and the forums, and read countless tutorials in an attempt to see what might be wrong with the code below, to no avail. My brain is about to shut down, could someone take a look at this and just see if I've missed anything obvious. All that happens when I render it (indexed rendering using DirectX Graphics) is a bit of a mess of polys on the screen and a really bad slow down. //Loops through and build vertex data for (iZ = 0; iZ < m_hLoad.iDepth; iZ++) { for (iX = 0; iX < m_hLoad.iWidth; iX++) { uiPoint = iX + (iZ*m_hLoad.iWidth); m_pHMap[uiPoint].fX = (float)iX * scale; m_pHMap[uiPoint].fY = (float)m_ucData[uiPoint] * scale; m_pHMap[uiPoint].fZ = (float)iZ * scale; m_pHMap[uiPoint].fDiff[0] = 255; m_pHMap[uiPoint].fDiff[1] = 255; m_pHMap[uiPoint].fDiff[2] = 255; } } bool loop = false; //Loop through the map and build the index list for (iZ = 0; iZ < (m_hLoad.iDepth - 1); iZ++) { for (iX = 0; iX < (m_hLoad.iWidth - 1); iX++) { m_usIndices[uiIndex] = iX + ((iZ+1)*m_hLoad.iWidth); uiIndex++; m_usIndices[uiIndex] = iX + (iZ * m_hLoad.iWidth); uiIndex++; m_usIndices[uiIndex] = iX + 1 + (iZ * m_hLoad.iWidth); uiIndex++; m_usIndices[uiIndex] = iX + 1 + ((iZ + 1) * m_hLoad.iWidth); uiIndex++; m_usIndices[uiIndex] = iX + ((iZ + 1) * m_hLoad.iWidth); uiIndex++; m_usIndices[uiIndex] = iX + 1 + (iZ * m_hLoad.iWidth); uiIndex++; } }
  3. Skybox

    never mind... I found it in the SDK. Thanks heaps guys!
  4. Skybox

    Thanks, that worked great. One more query, what is the default D3DTEXTUREADDRESS for D3D?
  5. Skybox

    I've just implemented a skybox into my terrain engine, it looks great, except that where the sides of the skybox cube join, there are visible seems where the edges join, is there an easy way to fix this? Thanks.
  6. Hardware lighting, And .X files

    I've checked the debug for the material, and also set the D3DRS_AMBIENT to grey... I'm lost, hopefully someone can give us a solution. Thankyou so much for your time so far. ShalRath
  7. Hardware lighting, And .X files

    The actual settings for the light are as follows: ZeroMemory(&m_lights[i], sizeof(D3DLIGHT9)); m_lights[i].Type = D3DLIGHT_POINT; m_lights[i].Diffuse.a = 1.0f; m_lights[i].Diffuse.r = 0.25f; m_lights[i].Diffuse.g = 0.1f; m_lights[i].Diffuse.b = 0.1f; m_lights[i].Specular.a = 1.0f; m_lights[i].Specular.r = 0.25f; m_lights[i].Specular.g = 0.1f; m_lights[i].Specular.b = 0.1f; m_lights[i].Ambient.a = 1.0f; m_lights[i].Ambient.r = 0.5f; m_lights[i].Ambient.g = 0.5f; m_lights[i].Ambient.b = 0.5f; m_lights[i].Direction.x = 0; m_lights[i].Direction.y = 0; m_lights[i].Direction.z = 0; m_lights[i].Range = 17.5f; m_lights[i].Attenuation0 = 1.0f;
  8. Hardware lighting, And .X files

    still seems to have the same problem...
  9. Hardware lighting, And .X files

    Here we have two screens... although not particularly enlightening... The non textured sphere (the one that gets lit) The textured sphere (the one that doesn't get lit for some reason, the dark patches are just the texture)
  10. Hardware lighting, And .X files

    The frames are rendered as such: for (DWORD i = 0; i < m_dwNumMtrls; i++) { m_pDMD3D->ReturnDevice()->SetMaterial(&m_pMeshMtrls[i]); m_tex[i].SetTexture(); m_pMesh->DrawSubset(i); } And the lights in my scene set like so: m_pD3DDev9->SetLight(i, &m_lights[i]); m_pD3DDev9->LightEnable(i, true); m_pD3DDev9->SetRenderState(D3DRS_LIGHTING, true); The materials are simply loaded from the .x file, with the code from the SDK Thanks.
  11. Is there any special state you need to have turned on to allow a textured .x model to be lit with hardware lights? When I don't use the texture, my model is lit by the hardware lights, but if I enable the texture (in the material), no lighting is done on the model... I've read through the documentation, there seems to be nothing at all with relation to this issue.
  12. Unicode text files

    Even after saving my text file as UTF-16 (big or little endian) I only get junk back from the fgetws call... Microsoft use a resource to load a unicode text file in their Direct3D text example... but this seems like overkill, I should be able to do it with simple file i/o right?
  13. Unicode text files

    What about reading UTF-16 straight from the disk? Is this possible using my simple method above?
  14. Unicode text files

    There must be a simpler way... This is great, but I'm not that great a coder, it must be able to be done with standard C++ functions... Can anyone help... I'm currently doing this: FILE *textf = NULL; textf = _wfopen(L"mytext.txt", L"r"); wchar_t *mystring = new wchar_t[6]; fgetws(mystring, 5, textf); However, what I am given back will not display correctly... Can anyone see anything wrong here, or is it likely to be in my text display code?
  15. Unicode text files

    UTF-8, sorry :(