Jump to content
  • Advertisement

Cranberry

Member
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

147 Neutral

About Cranberry

  • Rank
    Newbie
  1. Cranberry

    Rescuebit! [Linux/Windows]

    Today I wanna show you my new game: Rescuebit! It's a 2-Dimensional and hopefully puzzling Jump and Run. The Goal is to get to the white marked exit of each level. But that's not always as easy as it sounds. You can only get there by using the so called 'Gravity Swappers'. As you probably guessed, they change the gravity. That enables you to see the Level from a different perspective and you might find a way to the exit.   Images   Development This game was developed by me on my own in only one month.It is written in C++ and uses SFML. All graphics are selfmade and all sounds were downloaded from freesounds.org.   Windows + Linux I decided to develop the game for Windows and Linux, because most people still use Windows and I like the concept of Linux. So the best way was to develop the game for both systems.   Android Originally there should be an Android port of the game, but because I don't have much experience and the lack of documentation for the SFML Android port I have not been able to get it working on Android.   Download Ubuntu/Debian: https://docs.google.com/uc?authuser=0&id=0BziAnG1ZWp51dnp6SmFReTZ4d2c&export=download Windows: https://docs.google.com/uc?authuser=0&id=0BziAnG1ZWp51N1dmLWRoWUtmY00&export=download   Well that's it   I hope you like the game! Give me some Feedback when you've played it (or not)!   best regards,  Cranberry   P.S.: If you've got Twitter, follow me @ChrisKrane.
  2. Cranberry

    Problem with displaying Cube in DX11

    Thank you so much! I was thinking of the old D3DXTransposeMatrix which modified the matrix via a reference.
  3. Cranberry

    Problem with displaying Cube in DX11

    Vertex Shader:  cbuffer cbPerObject { matrix worldMatrix; matrix viewMatrix; matrix projectionMatrix; }; struct VertexIn { float3 Pos : POSITION; float4 Color : COLOR; }; struct VertexOut { float4 PosH : SV_POSITION; float4 Color : COLOR; }; VertexOut VS(VertexIn vin) { VertexOut vout; vout.PosH = mul(float4(vin.Pos, 1.0f), worldMatrix); vout.PosH = mul(vout.PosH, viewMatrix); vout.PosH = mul(vout.PosH, projectionMatrix); vout.Color = vin.Color; return vout; } float4 PS(VertexOut pin) : SV_TARGET { return pin.Color; } Yeah I transpose all three of them.   Here's my Render function, maybe you can spot a mistake: void Game::Render() { m_pRenderSystem->PreRender(); //Set ColorShader m_pColorShader->SetInputLayoutAndTopology(m_pRenderSystem->GetDeviceContext()); //Set geometry buffers UINT stride = sizeof(Vertex); UINT offset = 0; m_pRenderSystem->GetDeviceContext()->IASetVertexBuffers(0, 1, &m_pCubeVertexBuffer, &stride, &offset); m_pRenderSystem->GetDeviceContext()->IASetIndexBuffer(m_pCubeIndexBuffer, DXGI_FORMAT_R32_UINT, 0); //Set constant buffer D3D11_BUFFER_DESC cbPerObjectDesc; cbPerObjectDesc.Usage = D3D11_USAGE_DYNAMIC; cbPerObjectDesc.ByteWidth = sizeof(cbPerObject); cbPerObjectDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; cbPerObjectDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; cbPerObjectDesc.MiscFlags = 0; cbPerObjectDesc.StructureByteStride = 0; m_pRenderSystem->GetDevice()->CreateBuffer(&cbPerObjectDesc, 0, &m_cbPerObject); D3D11_MAPPED_SUBRESOURCE mappedResource; cbPerObject* dataPtr; unsigned int bufferNumber; m_pRenderSystem->GetDeviceContext()->Map(m_cbPerObject, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); dataPtr = (cbPerObject*) mappedResource.pData; XMMatrixTranspose(m_WorldMatrix); XMMatrixTranspose(m_ViewMatrix); XMMatrixTranspose(m_ProjectionMatrix); dataPtr->worldMatrix = m_WorldMatrix; dataPtr->viewMatrix = m_ViewMatrix; dataPtr->projectionMatrix = m_ProjectionMatrix; m_pRenderSystem->GetDeviceContext()->Unmap(m_cbPerObject, 0); // Set the position of the constant buffer in the vertex shader. bufferNumber = 0; // Finanly set the constant buffer in the vertex shader with the updated values. m_pRenderSystem->GetDeviceContext()->VSSetConstantBuffers(bufferNumber, 1, &m_cbPerObject); m_pColorShader->SetAsShader(m_pRenderSystem->GetDeviceContext()); //Draw cube m_pRenderSystem->GetDeviceContext()->DrawIndexed(36, 0, 0); m_pRenderSystem->PostRender(); }
  4. Cranberry

    Problem with displaying Cube in DX11

    D3D11_VIEWPORT viewPort; viewPort.TopLeftX = 0.0f; viewPort.TopLeftY = 0.0f; viewPort.Width = static_cast<float>(pWindow->GetWidth()); viewPort.Height = static_cast<float>(pWindow->GetHeight()); viewPort.MinDepth = 0.0f; viewPort.MaxDepth = 1.0f; m_pDeviceContext->RSSetViewports(1, &viewPort); Looks fine to me.
  5. Hey Guys, I'm developing a game using DirectX 11, so I started of by creating the basic structure and tried to render a simple cube. The problem is that the cube is somehow stretched vertically over the window and the colors (red for top / blue for bottom) are mixed:   I checked everything via the Graphics Debugger and all the values seem to be okay, but the cube already looks strange in the vertex shader:   I thought there might be a problem with the projection matrix but it looks okay to me: m_ProjectionMatrix = XMMatrixPerspectiveFovLH(0.25f*3.14159265359, (float)m_pWindow->GetHeight() / (float)m_pWindow->GetWidth(), 1.0f, 1000.0f); Has anyone had the same problem or does anybody know how I could solve this problem? Thanks in advance, Cranberry
  6. Is your OS Windows 7? Then you just have to update the windows SDK.
  • 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!