├── OpenTK ├── OpenTK.dll ├── OpenTK.GLControl.dll └── OpenTK.Compatibility.dll ├── WpfOpenTK.v12.suo ├── OtkWpfControl ├── Automization.png ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml.cs ├── App.xaml ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Scene.cs ├── OtkWpfControl.csproj └── OtkWpfControl.cs ├── OpenGLviaFramebuffer ├── Automization.png ├── App.xaml.cs ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml ├── MainWindow.xaml ├── MainWindow.xaml.cs ├── Renderer.cs ├── OpenGLviaFramebuffer.csproj └── FrameBufferHandler.cs ├── OpenGLviaWinformsHost ├── App.config ├── Properties │ ├── Settings.settings │ ├── Settings.Designer.cs │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ └── Resources.resx ├── App.xaml.cs ├── MainWindow.xaml ├── App.xaml ├── MainWindow.xaml.cs └── OpenGLviaWinformsHost.csproj ├── .gitignore ├── README.md ├── .github └── workflows │ └── ContiniousIntegrationBuild.yml └── WpfOpenTK.sln /OpenTK/OpenTK.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freakinpenguin/OpenTK-WPF/HEAD/OpenTK/OpenTK.dll -------------------------------------------------------------------------------- /WpfOpenTK.v12.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freakinpenguin/OpenTK-WPF/HEAD/WpfOpenTK.v12.suo -------------------------------------------------------------------------------- /OpenTK/OpenTK.GLControl.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freakinpenguin/OpenTK-WPF/HEAD/OpenTK/OpenTK.GLControl.dll -------------------------------------------------------------------------------- /OpenTK/OpenTK.Compatibility.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freakinpenguin/OpenTK-WPF/HEAD/OpenTK/OpenTK.Compatibility.dll -------------------------------------------------------------------------------- /OtkWpfControl/Automization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freakinpenguin/OpenTK-WPF/HEAD/OtkWpfControl/Automization.png -------------------------------------------------------------------------------- /OpenGLviaFramebuffer/Automization.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/freakinpenguin/OpenTK-WPF/HEAD/OpenGLviaFramebuffer/Automization.png -------------------------------------------------------------------------------- /OpenGLviaFramebuffer/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace OpenGLviaFramebuffer 2 | { 3 | using System.Windows; 4 | 5 | public partial class App : Application 6 | { 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /OtkWpfControl/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /OpenGLviaFramebuffer/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /OpenGLviaWinformsHost/App.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /OtkWpfControl/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /OpenGLviaFramebuffer/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /OpenGLviaWinformsHost/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /OpenGLviaWinformsHost/App.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace OpenGLviaWinformsHost 2 | { 3 | using System.Windows; 4 | 5 | /// 6 | /// Interaktionslogik für "App.xaml" 7 | /// 8 | public partial class App : Application 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /OpenGLviaWinformsHost/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /OpenGLviaFramebuffer/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OpenGLviaWinformsHost/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /OtkWpfControl/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace OtkWpfControl 10 | { 11 | /// 12 | /// App.xaml の相互作用ロジック 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /OtkWpfControl/App.xaml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # この .gitignore ファイルは Microsoft(R) Visual Studio によって自動的に作成されました。 3 | ################################################################################ 4 | 5 | /OpenGLviaFramebuffer/bin/Debug 6 | /OpenGLviaFramebuffer/obj/Debug 7 | /OpenGLviaWinformsHost/obj/Debug 8 | /OpenGLviaWinformsHost/bin/Debug 9 | /OtkWpfControl/bin/Debug 10 | /OtkWpfControl/obj/Debug 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | OpenTK-WPF 2 | 3 | ![https://github.com/freakinpenguin/OpenTK-WPF/actions](https://github.com/freakinpenguin/OpenTK-WPF/workflows/Continious%20Integration%20Build/badge.svg) 4 | ========== 5 | Examples of how to using OpenGL via OpenTK in WPF applications 6 | 7 | This solution contains two projects. One project shows the usage of OpenTK in WPF via a WindowsFormsHost and the other by using a Framebuffer object. 8 | 9 | The Framebuffer-approach is a "pure"-WPF-approach, but the WinformsHost-approach is faster (32 vs 48fps). 10 | 11 | Feel free to improve! 12 | -------------------------------------------------------------------------------- /.github/workflows/ContiniousIntegrationBuild.yml: -------------------------------------------------------------------------------- 1 | name: Continious Integration Build 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | 11 | build: 12 | 13 | strategy: 14 | matrix: 15 | configuration: [Debug, Release] 16 | 17 | runs-on: windows-latest # For a list of available runner types, refer to 18 | # https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idruns-on 19 | 20 | env: 21 | Solution_Name: WpfOpenTK.sln 22 | 23 | steps: 24 | - name: Checkout 25 | uses: actions/checkout@v2 26 | with: 27 | fetch-depth: 0 28 | 29 | - name: Setup MSBuild Path 30 | uses: microsoft/setup-msbuild@v1 31 | 32 | - name: Build 33 | run: msbuild $Solution_Name /p:Configuration=Release 34 | 35 | -------------------------------------------------------------------------------- /OpenGLviaFramebuffer/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |