ProxyRunner
ProxyRunner

Reputation: 1

Viewport namespace missing from SharpDX directive, please assist

I am using Visual Studio to build my program, I have all the necessary nugets for now, installed:

    SharpDX
    SharpDX.D3DCompiler
    SharpDX.Direct3D11
    SharpDX.DXGI

Yet I get this error for Viewport:

CS0246 The type or namespace name 'Viewport' could not be found (are you missing a using directive or an assembly reference?)

public void SetViewport(int x, int y, int width, int height)
        {
            // Set the viewport for rendering
            var viewport = new Viewport(x, y, width, height);
            d3dDeviceContext.Rasterizer.SetViewport(viewport);
        }

Please assist if possible, thanks.

P.S. I know I can just create a new file or a nested class but would rather know why Viewport is missing or if I am doing something incorrect.

I have tried re-installing the nuget packages, I combed each package for the namespace Viewport, I ensured all packages were up-to-date as well. I cleaned the solution and rebuilt to no avail.

Upvotes: 0

Views: 80

Answers (0)

Related Questions