Skip to content

Help passing context from Silk.NET (GLFW window) to SkiaSharp SKSurface #1855

Answered by bmitc
bmitc asked this question in Q&A
Discussion options

You must be logged in to vote

I am no longer using Silk.NET with SkiaSharp and am instead using my own GLFW bindings with SkiaSharp. Here's what a solution looks like, which mirrors what one would need for using SkiaSharp with any GLFW-based windowing library.

open System

open SkiaSharp

open Windowing.Utilities
open Windowing.GLFW.Native.OpenGL
open Windowing.GLFW.Native.Helpers
open Windowing.GLFW.Native.Initialization
open Windowing.GLFW.Native.Context
open Windowing.GLFW.Native.Window

let initialWidth, initialHeight = 500, 500
let mutable framebufferWidth, framebufferHeight = initialWidth, initialHeight

//**********************************************************************
//***** Load the GLFW DLL and initia…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@bmitc
Comment options

Comment options

You must be logged in to vote
1 reply
@bmitc
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by bmitc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants