public void TestCompile() { var window = new OpenGLWindow(200, 200, "Test", false, false); new ShaderPipeline( DefaultShader.FromType(typeof(VertexPositionColor), ShaderType.Vertex), DefaultShader.FromType(typeof(VertexPositionColor), ShaderType.Fragment)); new ShaderPipeline( DefaultShader.FromType(typeof(VertexPosition3Color), ShaderType.Vertex), DefaultShader.FromType(typeof(VertexPosition3Color), ShaderType.Fragment)); new ShaderPipeline( DefaultShader.FromType(typeof(VertexPositionTexture), ShaderType.Vertex), DefaultShader.FromType(typeof(VertexPositionTexture), ShaderType.Fragment)); new ShaderPipeline( DefaultShader.FromType(typeof(VertexPosition3Texture), ShaderType.Vertex), DefaultShader.FromType(typeof(VertexPosition3Texture), ShaderType.Fragment)); new ShaderPipeline( DefaultShader.FromType(typeof(VertexPositionColorTexture), ShaderType.Vertex), DefaultShader.FromType(typeof(VertexPositionColorTexture), ShaderType.Fragment)); new ShaderPipeline( DefaultShader.FromType(typeof(VertexPosition3ColorTexture), ShaderType.Vertex), DefaultShader.FromType(typeof(VertexPosition3ColorTexture), ShaderType.Fragment)); window.Close(); window.Dispose(); }
public void Run() { PlainCoreSettings.GlfwSearchPath = Path.GetFullPath("../../../../../Native/"); var window = new OpenGLWindow(800, 600, "Hello Core!", false, false); window.OnClosed += () => Console.WriteLine("Closed!"); Setup(); while (window.IsOpen) { defaultFramebuffer.Clear(Color4.CornflowerBlue); window.PollEvents(); Draw(); window.Display(); } pipeline.Dispose(); vao.Dispose(); buffer.Dispose(); indexBuffer.Dispose(); texture.Dispose(); defaultFramebuffer.Dispose(); window.Dispose(); }
public void TestCreate() { //Dummy window for context initialization var window = new OpenGLWindow(200, 200, "Test", false, false); var tex = new RenderTexture(800, 600); window.Close(); window.Dispose(); }
private void RenderWindow() { while (true) { _openWindowSem.WaitOne(); GPU gpu = GPU.Create(500, 500, new DefaultGpuController()); _renderWindow = new OpenGLWindow(500, 500, "GPUSharp Preview Window", gpu); _renderWindow.Run(); _renderWindow.Dispose(); _renderWindow = null; if (!_isWindowOpened) { break; } _isWindowOpened = false; } }