Jump to content
  • Advertisement

User1234

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

114 Neutral

About User1234

  • Rank
    Newbie
  1. User1234

    Sprite Class not working

    actually i´m not working on a game... I`m just trying to learn game programming with programming moving sprites and other techniques. I Will try to program a game when i`ve got enough experiance. So i don`t have to ask such questions anymore^^ thanks for yor answer!
  2. User1234

    Sprite Class not working

    ok i fixed it now, i just used the wrong vertices... but i have another question. How is the collision detection handled in 2D games? and does somebody know a good resource to read about 2D collision detection?
  3. hi, it´s me again   i have tried to write a class that handles my sprites but i can´t make it work and i ´m not sure why...   i will give you my code:   the class header:       #include <D3D11.h> #include <D3DX11.h> #include <xnamath.h> #include <d3dcompiler.h> #include "Globals.h" #ifndef _GameSprite_H #define _GameSprite_H struct MySpriteVertex { XMFLOAT3 pos; XMFLOAT2 tex0; }; class GameSprite { public: GameSprite(char* texturePath, char* shaderPath, float startX, float startY, float sizeX, float sizeY); ~GameSprite(); void Initialize(); void SetUpVertices(); void DetermineValues(); bool LoadTexture(); bool CreateBuffers(); bool ActivateAlphaBlending(); void SetView(XMMATRIX &View); void CalculateWorld(); void SetProj(XMMATRIX &Proj); void SetPosition(float X, float Y); void SetRotation(float rotation); void SetScale(float X, float Y); void Update(); void DrawSprite(); MySpriteVertex spriteVertices[6]; float startX; float startY; float sizeX; float sizeY; float scaleX; float scaleY; float rotation; float spriteWidth; float spriteHeight; char* texturePath; char* shaderPath; ID3D11Buffer* spriteVertexBuffer; ID3D11ShaderResourceView* spriteMap; ID3D11SamplerState* spriteSampler; ID3D11InputLayout* spriteInputLayout; ID3DBlob* spriteErrorBuffer; ID3DBlob* spriteVSBuffer; ID3DBlob* spritePSBuffer; ID3D11VertexShader* spriteVertexShader; ID3D11PixelShader* spritePixelShader; ID3D11Buffer* mwvpCB; XMMATRIX* spriteView; XMMATRIX* spriteProj; XMMATRIX* spriteWorld; ID3D11BlendState *originalBS; float originalBlendColor[4]; UINT originalSampleMask; ID3D11BlendState *newBS; bool ResetOriginalBlendState(); }; #endif       the .cpp file:     #include "GameSprite.h" GameSprite::GameSprite(char* texturePath, char* shaderPath, float startX, float startY, float sizeX, float sizeY) { this->texturePath = texturePath; this->shaderPath = shaderPath; this->startX = startX; this->startY = startY; this->sizeX = sizeX; this->sizeY = sizeY; this->rotation = 0; this->scaleX = 1.0f; this->scaleY = 1.0f; this->spriteWorld = &XMMatrixIdentity(); this->spriteView = &XMMatrixIdentity(); this->spriteProj = &XMMatrixIdentity(); Initialize(); } GameSprite::~GameSprite() { } void GameSprite::Initialize() { LoadTexture(); DetermineValues(); SetUpVertices(); CreateBuffers(); } void GameSprite::SetUpVertices() { /* vertices[0].pos = XMFLOAT3(spriteWidth/2, spriteHeight/2, 1.0f); vertices[0].tex0 = XMFLOAT2( 1.0f, 1.0f); vertices[1].pos = XMFLOAT3(spriteWidth/2, -spriteHeight/2, 1.0f); vertices[1].tex0 = XMFLOAT2( 1.0f, 0.0f); vertices[2].pos = XMFLOAT3(-spriteWidth/2, -spriteHeight/2, 1.0f); vertices[2].tex0 = XMFLOAT2( 0.0f, 0.0f); vertices[3].pos = XMFLOAT3(-spriteWidth/2, -spriteHeight/2, 1.0f); vertices[3].tex0 = XMFLOAT2( 0.0f, 0.0f); vertices[4].pos = XMFLOAT3(-spriteWidth/2, spriteHeight/2, 1.0f); vertices[4].tex0 = XMFLOAT2( 0.0f, 1.0f); vertices[5].pos = XMFLOAT3(spriteWidth/2, spriteHeight/2, 1.0f); vertices[5].tex0 = XMFLOAT2(1.0f, 1.0f); */ vertices[0].pos = XMFLOAT3(1.0f, 1.0f, 1.0f); vertices[0].tex0 = XMFLOAT2( 1.0f, 1.0f); vertices[1].pos = XMFLOAT3(1.0f, -1.0f, 1.0f); vertices[1].tex0 = XMFLOAT2( 1.0f, 0.0f); vertices[2].pos = XMFLOAT3(-1.0f, -1.0f, 1.0f); vertices[2].tex0 = XMFLOAT2( 0.0f, 0.0f); vertices[3].pos = XMFLOAT3(-1.0f, -1.0f, 1.0f); vertices[3].tex0 = XMFLOAT2( 0.0f, 0.0f); vertices[4].pos = XMFLOAT3(-1.0f, 1.0f, 1.0f); vertices[4].tex0 = XMFLOAT2( 0.0f, 1.0f); vertices[5].pos = XMFLOAT3(1.0f, 1.0f, 1.0f); vertices[5].tex0 = XMFLOAT2(1.0f, 1.0f); } void GameSprite::DetermineValues() { float spriteWidth = sizeX; float spriteHeight = sizeY; SetPosition(startX, startY); SetRotation(0.0f); } bool GameSprite::LoadTexture() { HRESULT result = D3DX11CreateShaderResourceViewFromFileA(Device, texturePath, 0, 0, &spriteMap, 0); if(FAILED(result)) { MessageBoxA(NULL, "Failed to load the texture image!", "Error", MB_OK); return false; } D3D11_SAMPLER_DESC colorMapDesc; ZeroMemory( &colorMapDesc, sizeof(colorMapDesc)); colorMapDesc.AddressU = D3D11_TEXTURE_ADDRESS_WRAP; colorMapDesc.AddressV = D3D11_TEXTURE_ADDRESS_WRAP; colorMapDesc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; colorMapDesc.ComparisonFunc = D3D11_COMPARISON_NEVER; colorMapDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR; colorMapDesc.MaxLOD = D3D11_FLOAT32_MAX; result = Device->CreateSamplerState(&colorMapDesc, &spriteSampler); if(FAILED(result)) { MessageBoxA(NULL, "Failed to create color map sampler state!", "Error", MB_OK); return false; } return false; } bool GameSprite::CreateBuffers() { D3D11_BUFFER_DESC vertexDesc; ZeroMemory(&vertexDesc, sizeof(vertexDesc)); vertexDesc.Usage = D3D11_USAGE_DEFAULT; vertexDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexDesc.ByteWidth = sizeof(MySpriteVertex) * ARRAYSIZE(spriteVertices); D3D11_SUBRESOURCE_DATA resourceData; ZeroMemory( &resourceData, sizeof(resourceData)); resourceData.pSysMem = spriteVertices; HRESULT hresult = Device->CreateBuffer(&vertexDesc, &resourceData, &spriteVertexBuffer); if(FAILED(hresult)) { MessageBoxA(NULL, "Failed to create vertex buffer!", "Error", MB_OK); return true; } D3D11_BUFFER_DESC constDesc; ZeroMemory( &constDesc, sizeof(constDesc)); constDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; constDesc.ByteWidth = sizeof(XMMATRIX); constDesc.Usage = D3D11_USAGE_DEFAULT; hresult = Device->CreateBuffer(&constDesc, 0, &mwvpCB); if( FAILED(hresult)) { MessageBoxA(NULL, "Failed to create Constant Buffer", "Error", MB_OK); return false; } spriteErrorBuffer = 0; hresult = D3DX11CompileFromFileA(shaderPath, 0, 0, "VS_Main", "vs_4_0", D3DCOMPILE_ENABLE_STRICTNESS, 0, 0, &spriteVSBuffer, &spriteErrorBuffer, 0); if(FAILED(hresult)) { MessageBoxA(NULL, "Error Loading Vertex Shader", "Error", MB_OK); } hresult = Device->CreateVertexShader(spriteVSBuffer->GetBufferPointer(), spriteVSBuffer->GetBufferSize(), 0, &spriteVertexShader); if(FAILED(hresult)) { MessageBoxA(NULL, "Error Creating Vertex Shader", "Error", MB_OK); } D3D11_INPUT_ELEMENT_DESC vertexLayout[] = { {"POSITION", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0}, {"TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 12, D3D11_INPUT_PER_VERTEX_DATA, 0} }; hresult = Device->CreateInputLayout(vertexLayout, ARRAYSIZE(vertexLayout), spriteVSBuffer->GetBufferPointer(), spriteVSBuffer->GetBufferSize(), &spriteInputLayout); if(FAILED(hresult)) { MessageBoxA(NULL, "Error Creating Input Layout", "Error", MB_OK); } hresult = D3DX11CompileFromFileA(shaderPath, 0, 0, "PS_Main", "ps_4_0", D3DCOMPILE_ENABLE_STRICTNESS, 0, 0, &spritePSBuffer, &spriteErrorBuffer, 0); if(FAILED(hresult)) { MessageBoxA(NULL, "Error Loading Pixel Shader", "Error", MB_OK); } hresult = Device->CreatePixelShader(spritePSBuffer->GetBufferPointer(), spritePSBuffer->GetBufferSize(), 0, &spritePixelShader); if(FAILED(hresult)) { MessageBoxA(NULL, "Error Creating Pixel Shader", "Error", MB_OK); } return true; } void GameSprite::SetView(XMMATRIX &View) { this->spriteView = &View; } void GameSprite::SetProj(XMMATRIX &Proj) { this->spriteProj = &Proj; } void GameSprite::CalculateWorld() { XMMATRIX translation = XMMatrixTranslation(startX, startY, 0.0f); XMMATRIX rotationZ = XMMatrixRotationZ(rotation); XMMATRIX scaleMatrix = XMMatrixScaling(scaleX, scaleY, 1.0f); *spriteWorld = translation * rotationZ * scaleMatrix; } bool GameSprite::ActivateAlphaBlending() { originalBlendColor[0] = 0; originalBlendColor[1] = 0; originalBlendColor[2] = 0; originalBlendColor[3] = 0; originalSampleMask = 0; originalBS = NULL; d3dContext->OMGetBlendState(&originalBS, originalBlendColor, &originalSampleMask); D3D11_BLEND_DESC blendStateDesc; ZeroMemory(&blendStateDesc, sizeof(D3D11_BLEND_DESC)); blendStateDesc.AlphaToCoverageEnable = FALSE; blendStateDesc.IndependentBlendEnable = FALSE; blendStateDesc.RenderTarget[0].BlendEnable = TRUE; blendStateDesc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; blendStateDesc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; blendStateDesc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; blendStateDesc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ZERO; blendStateDesc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; blendStateDesc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; blendStateDesc.RenderTarget[0].RenderTargetWriteMask = 0x0F; if(FAILED(Device->CreateBlendState(&blendStateDesc, &newBS))) { MessageBoxA(NULL, "Error Could not Adjust Blend State", "Error", MB_OK); return false; } d3dContext->OMSetBlendState(newBS, NULL, 0xFFFFFF); return true; } bool GameSprite::ResetOriginalBlendState() { d3dContext->OMSetBlendState(originalBS, originalBlendColor, originalSampleMask); return true; } void GameSprite::SetPosition(float X, float Y) { this->startX = X; this->startY = Y; } void GameSprite::SetRotation(float rotation) { this->rotation = rotation; } void GameSprite::SetScale(float X, float Y) { this->scaleX = X; this->scaleY = Y; } void GameSprite::Update() { CalculateWorld(); } void GameSprite::DrawSprite() { ActivateAlphaBlending(); unsigned int stride = sizeof(MySpriteVertex); unsigned int offset = 0; d3dContext->IASetInputLayout(spriteInputLayout); d3dContext->IASetVertexBuffers(0, 1, &spriteVertexBuffer, &stride, &offset); d3dContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); XMMATRIX mwvp = XMMatrixMultiply(*spriteView, *spriteProj); mwvp = XMMatrixMultiply(mwvp, *spriteWorld); mwvp = XMMatrixTranspose(mwvp); d3dContext->UpdateSubresource(mwvpCB, 0, 0, &mwvp, 0, 0); d3dContext->VSSetConstantBuffers(0, 1, &mwvpCB); d3dContext->PSSetShaderResources( 0, 1, &spriteMap); d3dContext->PSSetSamplers(0, 1, &spriteSampler); d3dContext->VSSetShader(spriteVertexShader, 0, 0); d3dContext->PSSetShader(spritePixelShader, 0, 0); d3dContext->Draw(ARRAYSIZE(spriteVertices), 0); ResetOriginalBlendState(); }     and here is the shader i use:       Texture2D     colorMap : register(t0); SamplerState     colorSampler : register(s0); cbuffer     cbChangesEveryFrame : register( b0 ) {     matrix mwvp; }; struct     VS_Input {     float4 pos : POSITION;     float2 tex0 : TEXCOORD0; }; struct     PS_Input {     float4 pos : SV_POSITION;     float2 tex0 : TEXCOORD0; }; PS_Input VS_Main(VS_Input vertex) { vertex.pos.w = 1.0f; PS_Input vsOut = (PS_Input)0; vsOut.pos = mul(vertex.pos, mwvp); vsOut.tex0 = vertex.tex0;     return vsOut; } float4     PS_Main(PS_Input frag) : SV_TARGET {     float4 color = colorMap.Sample(colorSampler, frag.tex0);     return color; }         this is how i set the projection and the view, in my main routines initialisation:       View = XMMatrixIdentity(); Projection = XMMatrixOrthographicOffCenterLH(0.0f, width, 0.0f, height, 0.1f, 100.0f); sprite1 = new GameSprite("Resources\\spriteTest.bmp", "Resources\\SpriteShader.fx", 0.0f, 0.0f, 40, 40); sprite1->SetView(View); sprite1->SetProj(Projection); sprite1->CalculateWorld();       the world matrix is re-calculated with every update call.   Am i doing something wrong with the Matrices?   i can´t figure out why it doesn´t work....   and sorry if its a silly error, it´s a bit hard to learn this by yourself edit: sry for the formation... i don´t know where that comes from edit2: ok i had the bb codes turned off... i fixed it now
  4. User1234

    Drawing Text with Dx11

    Hi again!   I have tried now to create a class that handles the text rendering but that seems not work properly. It runs and i get all the data i need from the files, but nothing is displayed.   Heres my code: My Structures for handling the index Input From text File: struct SignInfo { short Index; char Sign; float T_Coord_Left; float T_Coord_Right; float T_Coord_Top; float T_Coord_Bottom; }; struct TextInfo { int index; char* message; float startX; float startY; }; // for each ASCII Sign: SignInfo info[255]; // array to add text each Draw call: TextInfo TextInfoArray[10]; // Handles the adding of text to render: void TextProcessor::AddText(char* message, float startX, float startY) { TextInfoArray[TextCounter].index = TextCounter; TextInfoArray[TextCounter].message = message; TextInfoArray[TextCounter].startX = startX; TextInfoArray[TextCounter].startY = startY; TextCounter++; } now the function that handles the rendering of the text: void TextProcessor::DrawAllText() { int maxLetters = 32; unsigned int vertexCount = 0; float posZ = 1.0f; D3D11_MAPPED_SUBRESOURCE mapResource; HRESULT hresult = d3dContext->Map(vertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mapResource); VertexPosFont *spritePtr = (VertexPosFont*)mapResource.pData; int spritePtrCounter = 0; for(int i = 0; i < TextCounter; i++) { int length = strlen(TextInfoArray[i].message); if(length > maxLetters) length = maxLetters; vertexCount += length * 6; float posX = 0.0f; for(int j = 0; j < length; j++) { int letter = static_cast<char>(TextInfoArray[i].message[j]); if(letter > 126 || letter < 32) { letter = 32; } float charWidth = 0; float charHeight = 0; charWidth = ( info[letter].T_Coord_Right * fontWidth - info[letter].T_Coord_Left * fontWidth ); charHeight = ( info[letter].T_Coord_Bottom * fontHeight - info[letter].T_Coord_Top * fontHeight ); /* const size_t buflen = 100; TCHAR buff[buflen]; _sntprintf(buff, buflen - 1, _T("charWidth: %f charHeight: %f PosX: %f"), charWidth, charHeight, posX); MessageBox(NULL, buff, L"", MB_OK); */ float thisStartX = posX; float thisEndX = posX + charWidth; float thisEndY = TextInfoArray[i].startY + charHeight; spritePtr[spritePtrCounter].pos = XMFLOAT3( thisEndX, thisEndY, posZ ); spritePtr[spritePtrCounter+1].pos = XMFLOAT3( thisEndX, TextInfoArray[i].startY, posZ ); spritePtr[spritePtrCounter+2].pos = XMFLOAT3( thisStartX, TextInfoArray[i].startY, posZ ); spritePtr[spritePtrCounter+3].pos = XMFLOAT3( thisStartX, TextInfoArray[i].startY, posZ ); spritePtr[spritePtrCounter+4].pos = XMFLOAT3( thisStartX, thisEndY, posZ ); spritePtr[spritePtrCounter+5].pos = XMFLOAT3( thisEndX, thisEndY, posZ ); /* spritePtr[spritePtrCounter].pos = XMFLOAT3(thisEndX + Camera->target.x, thisEndY + Camera->target.y, posZ + Camera->target.z); spritePtr[spritePtrCounter+1].pos = XMFLOAT3(thisEndX + Camera->target.x, TextInfoArray[i].startY + Camera->target.y, posZ + posZ + Camera->target.z); spritePtr[spritePtrCounter+2].pos = XMFLOAT3(thisStartX + Camera->target.x, TextInfoArray[i].startY + Camera->target.y, posZ + posZ + Camera->target.z); spritePtr[spritePtrCounter+3].pos = XMFLOAT3(thisStartX + Camera->target.x, TextInfoArray[i].startY + Camera->target.y, posZ + Camera->target.z); spritePtr[spritePtrCounter+4].pos = XMFLOAT3(thisStartX + Camera->target.x, thisEndY + Camera->target.y, posZ + Camera->target.z); spritePtr[spritePtrCounter+5].pos = XMFLOAT3(thisEndX + Camera->target.x, thisEndY + Camera->target.y, posZ + Camera->target.z); */ float tuStart = info[(int)TextInfoArray[i].message[j]].T_Coord_Left; float tuEnd = info[(int)TextInfoArray[i].message[j]].T_Coord_Right; float tvStart = info[(int)TextInfoArray[i].message[j]].T_Coord_Top; float tvEnd = info[(int)TextInfoArray[i].message[j]].T_Coord_Bottom; /* const size_t buflen = 100; TCHAR buff[buflen]; _sntprintf(buff, buflen - 1, _T("tuStart: %f tuEnd: %f"), tuStart, tuEnd); MessageBox(NULL, buff, L"", MB_OK); */ spritePtr[spritePtrCounter].tex0 = XMFLOAT2( tuEnd, tvStart ); spritePtr[spritePtrCounter+1].tex0 = XMFLOAT2( tuEnd, tvEnd ); spritePtr[spritePtrCounter+2].tex0 = XMFLOAT2( tuStart, tvEnd ); spritePtr[spritePtrCounter+3].tex0 = XMFLOAT2( tuStart, tvEnd ); spritePtr[spritePtrCounter+4].tex0 = XMFLOAT2( tuStart, tvStart ); spritePtr[spritePtrCounter+5].tex0 = XMFLOAT2( tuEnd, tvStart ); spritePtr += 6; spritePtrCounter += 6; posX += charWidth; } ActivateAlphaBlending(); unsigned int stride = sizeof(VertexPosFont); unsigned int offset = 0; //View = &XMMatrixIdentity(); //World = &XMMatrixIdentity(); d3dContext->UpdateSubresource(cbView, 0, 0, &View, 0, 0); d3dContext->UpdateSubresource(cbProj, 0, 0, &Proj, 0, 0); d3dContext->UpdateSubresource(cbWorld, 0, 0, &World, 0, 0); d3dContext->VSSetConstantBuffers(0, 1, &cbView); d3dContext->VSSetConstantBuffers(1, 1, &cbProj); d3dContext->VSSetConstantBuffers(2, 1, &cbWorld); d3dContext->IASetInputLayout(inputLayout); d3dContext->IASetVertexBuffers(0, 1, &vertexBuffer, &stride, &offset); d3dContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST); d3dContext->PSSetShaderResources( 0, 1, &colorMap); d3dContext->PSSetSamplers(0, 1, &colorMapSampler); d3dContext->VSSetShader(vertexShader, 0, 0); d3dContext->PSSetShader(pixelShader, 0, 0); /* const size_t buflen = 100; TCHAR buff[buflen]; _sntprintf(buff, buflen - 1, _T("Text Vertices: %d"), vertexCount); MessageBox(NULL, buff, L"Error", MB_OK); */ d3dContext->Unmap(vertexBuffer, 0); d3dContext->Draw(vertexCount, 0); ResetTextInfoArray(); TextCounter = 0; d3dContext->OMSetBlendState(originalBS, originalBlendColor, originalSampleMask); } } void TextProcessor::ResetTextInfoArray() { memset(TextInfoArray, 0, sizeof(TextInfoArray)); } Here is the Index File for the bitmap font: i have created it with an helper programm and the pixel coordinates the reading of the data works properly, i have teste it with message Boxes [ASCII][Sign][Left_Pixel][Right_Pixel][Top_Pixel][Bottom_Pixel] Width: 512 Height: 136 32 Space 0.302734 0.333984 0.772059 0.970588 33 ! 0.00390625 0.0117188 0.0147059 0.154412 34 " 0.0273438 0.0429688 0.0147059 0.110294 35 # 0.0566406 0.0839844 0.0147059 0.154412 36 $ 0.0957031 0.121094 0 0.191176 37 % 0.132813 0.169922 0.0147059 0.154412 38 & 0.179688 0.212891 0.0147059 0.154412 39 ' 0.226563 0.234375 0.0147059 0.0661765 40 ( 0.248047 0.259766 0.0147059 0.191176 41 ) 0.271484 0.285156 0.0147059 0.191176 42 * 0.298828 0.318359 0.0147059 0.0882353 43 + 0.332031 0.357422 0.0441176 0.154412 44 , 0.367188 0.378906 0.125 0.183824 45 - 0.390625 0.404297 0.0882353 0.110294 46 . 0.417969 0.425781 0.125 0.154412 47 / 0.435547 0.457031 0.0147059 0.183824 48 0 0.466797 0.492188 0.0147059 0.154412 49 1 0.503906 0.525391 0.0147059 0.154412 50 2 0.537109 0.5625 0.0147059 0.154412 51 3 0.574219 0.597656 0.0147059 0.154412 52 4 0.611328 0.636719 0.0147059 0.154412 53 5 0.648438 0.671875 0.0147059 0.154412 54 6 0.685547 0.708984 0.0147059 0.154412 55 7 0.720703 0.744141 0.0147059 0.154412 56 8 0.757813 0.783203 0.0147059 0.154412 57 9 0.792969 0.816406 0.0147059 0.154412 58 : 0.830078 0.837891 0.0588235 0.154412 59 ; 0.849609 0.859375 0.0588235 0.191176 60 < 0.873047 0.896484 0.0441176 0.147059 61 = 0.910156 0.931641 0.0661765 0.125 62 > 0.943359 0.966797 0.0441176 0.147059 63 ? 0 0.0234375 0.264706 0.411765 64 @ 0.0351563 0.0761719 0.272059 0.411765 65 A 0.0878906 0.119141 0.272059 0.411765 66 B 0.130859 0.154297 0.272059 0.411765 67 C 0.166016 0.191406 0.272059 0.411765 68 D 0.205078 0.232422 0.272059 0.411765 69 E 0.246094 0.267578 0.272059 0.411765 70 F 0.28125 0.300781 0.272059 0.411765 71 G 0.3125 0.341797 0.272059 0.411765 72 H 0.357422 0.384766 0.272059 0.411765 73 I 0.400391 0.408203 0.272059 0.411765 74 J 0.417969 0.433594 0.272059 0.411765 75 K 0.447266 0.470703 0.272059 0.411765 76 L 0.484375 0.503906 0.272059 0.411765 77 M 0.515625 0.554688 0.272059 0.411765 78 N 0.568359 0.595703 0.272059 0.411765 79 O 0.609375 0.640625 0.272059 0.411765 80 P 0.654297 0.677734 0.272059 0.411765 81 Q 0.6875 0.722656 0.272059 0.433824 82 R 0.734375 0.759766 0.272059 0.411765 83 S 0.767578 0.791016 0.272059 0.411765 84 T 0.798828 0.828125 0.272059 0.411765 85 U 0.839844 0.867188 0.272059 0.411765 86 V 0.878906 0.910156 0.272059 0.411765 87 W 0.919922 0.964844 0.272059 0.411765 88 X 0 0.0253906 0.529412 0.669118 89 Y 0.0351563 0.0625 0.529412 0.669118 90 Z 0.0722656 0.0957031 0.529412 0.669118 91 [ 0.109375 0.121094 0.522059 0.698529 92 \ 0.130859 0.154297 0.514706 0.698529 93 ] 0.162109 0.175781 0.522059 0.698529 94 ^ 0.189453 0.212891 0.529412 0.610294 95 _ 0.222656 0.25 0.683824 0.705882 96 ` 0.261719 0.271484 0.522059 0.558824 97 a 0.285156 0.306641 0.566176 0.669118 98 b 0.324219 0.345703 0.522059 0.669118 99 c 0.357422 0.376953 0.566176 0.669118 100 d 0.388672 0.412109 0.522059 0.669118 101 e 0.425781 0.449219 0.566176 0.669118 102 f 0.460938 0.478516 0.522059 0.669118 103 g 0.488281 0.511719 0.566176 0.705882 104 h 0.525391 0.546875 0.522059 0.669118 105 i 0.5625 0.570313 0.529412 0.669118 106 j 0.578125 0.591797 0.529412 0.705882 107 k 0.605469 0.626953 0.522059 0.669118 108 l 0.638672 0.646484 0.522059 0.669118 109 m 0.660156 0.697266 0.566176 0.669118 110 n 0.712891 0.734375 0.566176 0.669118 111 o 0.748047 0.773438 0.566176 0.669118 112 p 0.787109 0.810547 0.566176 0.705882 113 q 0.822266 0.845703 0.566176 0.705882 114 r 0.861328 0.876953 0.566176 0.669118 115 s 0.888672 0.908203 0.566176 0.669118 116 t 0.919922 0.9375 0.536765 0.669118 117 u 0.951172 0.974609 0.566176 0.669118 118 v 0 0.0234375 0.823529 0.926471 119 w 0.03125 0.0703125 0.823529 0.926471 120 x 0.078125 0.101563 0.823529 0.926471 121 y 0.111328 0.136719 0.823529 0.963235 122 z 0.146484 0.166016 0.823529 0.926471 123 { 0.173828 0.191406 0.779412 0.955882 124 | 0.208984 0.216797 0.779412 0.963235 125 } 0.234375 0.251953 0.779412 0.955882 126 ~ 0.261719 0.287109 0.808824 0.852941 Has Anybody an Idea what could be wrong? if you need more information of my programm just ask for it...
  5. User1234

    Drawing Text with Dx11

    Thank you for your advice, i will try that!
  6. Hi,   My question is, what is the best way to display text in an 3d Game Environment with DirectX 11.   I Already know that this its possible with Graphical Fonts which are rendered to Quads and have done so. But isn t there a better way to do this? And if not -> does anyone know a tutorial or book where it is explained clearly?   edit: Wouldn t it be easyer to render the scene view to Texture and then Render the text to the Texture before presenting it?
  • 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!