Пример #1
0
        /// <summary>
        /// Creates a new <see cref="Window"/>.
        /// </summary>
        /// <param name="title">Title.</param>
        /// <param name="width">Width.</param>
        /// <param name="height">Height.</param>
        /// <param name="hints">Hints.</param>
        public Window(string title, int width, int height, WindowHints hints = WindowHints.Decorated | WindowHints.Resizable)
        {
            handle = KodoGLBindings.KodoGLWindowCreate(width, height, hints, title);

            KodoGLBindings.KodoGLWindowSetMouseContainedCallback(handle, WindowMouseContainedCallback);
            KodoGLBindings.KodoGLWindowSetMousePositionCallback(handle, WindowMousePositionCallback);
            KodoGLBindings.KodoGLWindowSetRefreshCallback(handle, WindowRefreshCallback);
            KodoGLBindings.KodoGLWindowSetSizeCallback(handle, WindowSizeCallback);
        }
Пример #2
0
 public void DrawQuads(Rectangle[] quads, Brush brush)
 => KodoGLBindings.KodoGLDrawingContextDrawQuads(handle, Marshal.UnsafeAddrOfPinnedArrayElement(quads, 0), quads.Length, (IntPtr)brush);
Пример #3
0
 public void DrawQuad(Rectangle quad, Brush brush)
 => KodoGLBindings.KodoGLDrawingContextDrawQuad(handle, quad, (IntPtr)brush);
Пример #4
0
 public DrawingContext(Window window)
 {
     handle = KodoGLBindings.KodoGLDrawingContextCreate((IntPtr)window);
     KodoGLBindings.KodoGLDrawingContextGetArea(handle, out area);
 }
Пример #5
0
 /// <summary>
 /// Ends a frame.
 /// </summary>
 public void EndFrame()
 {
     KodoGLBindings.KodoGLWindowFrameEnd(handle);
 }
Пример #6
0
 /// <summary>
 /// Begins a frame.
 /// </summary>
 public void BeginFrame()
 {
     KodoGLBindings.KodoGLWindowFrameBegin(handle);
 }
Пример #7
0
 /// <summary>
 /// Sets the <see cref="Window"/> swap interval.
 /// </summary>
 /// <param name="interval"></param>
 public void SwapInterval(int interval)
 {
     KodoGLBindings.KodoGLWindowSwapInterval(handle, interval);
 }
Пример #8
0
 public ColorBrush(Color color0, Color color1)
 {
     handle = KodoGLBindings.KodoGLBrushCreateGradient(color0, color1);
 }
Пример #9
0
 public Texture(string filename, bool opacityOnly)
 {
     KodoGLBindings.KodoGLTextureCreate(filename, opacityOnly);
 }
Пример #10
0
 public void Dispose()
 {
     KodoGLBindings.KodoGLTerminate();
 }
Пример #11
0
 public ColorBrush(Color color)
 {
     handle = KodoGLBindings.KodoGLBrushCreateColor(color);
 }
Пример #12
0
 public void PollEvents()
 {
     KodoGLBindings.KodoGLPollEvents();
 }
Пример #13
0
 public void WaitEvents()
 {
     KodoGLBindings.KodoGLWaitEvents();
 }
Пример #14
0
 public void SetTime(double time)
 {
     KodoGLBindings.KodoGLSetTime(time);
 }
Пример #15
0
 public double GetTime()
 {
     return(KodoGLBindings.KodoGLGetTime());
 }
Пример #16
0
 public WindowManager(KodoGLBindings.KodoGLErrorCallback errorCallback)
 {
     KodoGLBindings.KodoGLSystemCreate(errorCallback);
 }