Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

113 Neutral

About Caeous

  • Rank
  1. Caeous

    Vertex Declaration failure

    My vertex data is in the 0 to 800/600 range as I was using XYZRHW previously. What should I be setting my z at?
  2. Caeous

    Vertex Declaration failure

    Hey guys, I'm not sure if I'm allowed to divert the subject a little bit as I'm trying to move from POSITIONT to POSITION. Obviously I'm trying to setup a 2D view... but now when I use D3DXMatrixOrthoOffCenterRH, my screen is completely black. Any thoughts? I'm coming from OpenGL and I think that's RH.       ZeroMemory(&d3dpp, sizeof(d3dpp));    // clear out the struct for use      d3dpp.Windowed = TRUE;    // program windowed, not fullscreen       d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;    // discard old frames       d3dpp.hDeviceWindow = hWnd;    // set the window to be used by Direct3D       // create a device class using this information and information from the d3dpp stuct       d3d->CreateDevice(D3DADAPTER_DEFAULT,          D3DDEVTYPE_HAL,          hWnd,          D3DCREATE_SOFTWARE_VERTEXPROCESSING,          &d3dpp,          &this->d3d_device);       HRESULT hr;       D3DXMATRIX ortho2D;       D3DXMATRIX identity;       D3DXMatrixOrthoOffCenterRH(&ortho2D, 0.0f, UI::WindowSize::Instance().GetWindowWidth(), UI::WindowSize::Instance().GetWindowHeight(), 0.0f, -1.0f, 4.0f);       D3DXMatrixIdentity(&identity);       this->d3d_device->SetTransform(D3DTS_PROJECTION, &ortho2D);       this->d3d_device->SetTransform(D3DTS_WORLD, &identity);       this->d3d_device->SetTransform(D3DTS_VIEW, &identity); This is my declaration:       D3DVERTEXELEMENT9 posColour_vec[] =       {          { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION, 0 },          { 1, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 },          D3DDECL_END()       }; I'm setting my z to be 1.0f.   This is my Clear this->d3d_device->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 40, 100), 1.0f, 0);
  3. Caeous

    Vertex Declaration failure

    That's what I thought too. I'm in the process of going to XYZ and using D3DXMatrixOrthoOffCenterRH to get a 2D view instead of using RHW.    I've gotten it to work by putting both the color and the xyzrhw on the same stream. The moment that I split them up it fails.   Looking at the documentation tells me that when using POSITIONT:   Only stream zero can be used in such declarations.
  4. Hey everyone,   I'm trying to split my position and my color as two different arrays by using a declaration instead of FVF, however when I'm creating it, I'm getting a fail.   D3DVERTEXELEMENT9 posColour_vec[] = {     { 0, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITIONT, 0 },     { 1, 0, D3DDECLTYPE_D3DCOLOR, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 },     D3DDECL_END() }; Is it because I'm using POSITIONT? Do I need to change it to POSITION to be able to use another stream for my color?   Thanks!
  5. Hello,   In the past I've built a pretty simple OpenGL text rendering engine that uses the AngelCode BMFont library. I'm currently in the process of converting it to DirectX. As I'm doing my conversion, I'm looking for ways that I could improve my logic. I'm still very much a beginner, and was hoping to be pointed in the right direction to optimize my engine.   The application is a console emulator. It displays 101 characters by 36 characters, totalling to 3636 characters that can be displayed simultaneously. The amount of characters only changed when the user resizes the console app.   Right now, I'm just using a large vertex buffer, rendering it with DrawPrimitive on every paint. Sometimes, all of the vertices change, but it also happens that only a small subset of the vertices are updated as I might be only updating a few characters. For now, this does the job just fine, but I'm most likely going to be adding Direct2D support to this engine, so I'd like to minimize the work that I'm going to be doing with the bitmap font rendering part of the engine.   What should I do so that when I only need to update a couple characters, so I don't have to send the whole vertex back to the GPU?   Thoughts?   TL;DR - bitmap font rendering engine. currently using 1 vertex buffer. how to optimize for times where only a small part of the VB gets changed?
  • 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!