Wpf System test
This commit is contained in:
parent
af9c782c1e
commit
9ad4bc1c69
17 changed files with 746 additions and 12 deletions
42
WpfMapView2D/MainWindow.xaml.cs
Normal file
42
WpfMapView2D/MainWindow.xaml.cs
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
using OpenTK.Graphics.OpenGL4;
|
||||
using OpenTK.Mathematics;
|
||||
using OpenTK.Wpf;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using WpfMapView2D.Common;
|
||||
|
||||
namespace WpfMapView2D;
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window {
|
||||
public Camera _camera;
|
||||
public MainWindow() {
|
||||
InitializeComponent();
|
||||
var settings = new GLWpfControlSettings {
|
||||
MajorVersion = 4,
|
||||
MinorVersion = 0
|
||||
};
|
||||
|
||||
_camera = new Camera(Vector3.UnitY * 300, (float)this.Width / (float)this.Height);
|
||||
_camera.Fov = 60;
|
||||
|
||||
OpenTkControl.Start(settings);
|
||||
}
|
||||
private void OpenTkControl_OnRender(TimeSpan delta) {
|
||||
GL.ClearColor(Color4.Blue);
|
||||
GL.Clear(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
|
||||
}
|
||||
|
||||
private void OpenTkControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) {
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue