public WidgetShader(Device device) { byte[] vsbytes = File.ReadAllBytes("Shaders\\WidgetVS.cso"); byte[] psbytes = File.ReadAllBytes("Shaders\\WidgetPS.cso"); vs = new VertexShader(device, vsbytes); ps = new PixelShader(device, psbytes); SceneVars = new GpuVarsBuffer <WidgetShaderSceneVars>(device); Vertices = new GpuCBuffer <WidgetShaderVertex>(device, 150); //should be more than needed.... }
GpuCBuffer <VertexTypePC> vertices; //for selection polys/lines use public PathShader(Device device) { byte[] boxvsbytes = File.ReadAllBytes("Shaders\\PathBoxVS.cso"); byte[] boxpsbytes = File.ReadAllBytes("Shaders\\PathBoxPS.cso"); byte[] dynvsbytes = File.ReadAllBytes("Shaders\\PathDynVS.cso"); byte[] vsbytes = File.ReadAllBytes("Shaders\\PathVS.cso"); byte[] psbytes = File.ReadAllBytes("Shaders\\PathPS.cso"); boxvs = new VertexShader(device, boxvsbytes); boxps = new PixelShader(device, boxpsbytes); dynvs = new VertexShader(device, dynvsbytes); vs = new VertexShader(device, vsbytes); ps = new PixelShader(device, psbytes); VSSceneVars = new GpuVarsBuffer <PathShaderVSSceneVars>(device); layout = new InputLayout(device, vsbytes, VertexTypePC.GetLayout()); cube = new UnitCube(device, boxvsbytes, true, false, true); vertices = new GpuCBuffer <VertexTypePC>(device, 1000); //should be more than needed.... }