42 lines
No EOL
1.2 KiB
C#
42 lines
No EOL
1.2 KiB
C#
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) {
|
|
|
|
}
|
|
} |