public static void LogThreadInfo(Thread th, string message) { if (message == th.Name) { message = ""; } Log.Info("Thread #{ThreadId} {ThreadName} {Message}", th.ManagedThreadId, th.Name, message); }
public static void DumpInfo(bool listItems) { Log.Info("Allocated Textures: {TextureCount}", ReferencedCount()); if (listItems) { lock (References) { foreach (var reference in References.Values) { RendererTexture texture; if (reference.TryGetTarget(out texture)) { Log.Info("Texture #{Handle} {Name}", texture.Handle, texture.ObjectLabel); } } } } }
private void OnRenderFrameInternal(FrameEventArgs e) { if (!RenderInitialized) { Log.Verbose("Init OpenGL Bindings"); Log.Verbose("Grab Context"); Window.MakeCurrent(); Log.Verbose("Load OpenGL Bindings"); GL.LoadBindings(new GLFWBindingsContext()); var vendor = GL.GetString(StringName.Vendor); var version = GL.GetString(StringName.Version); var shadingLanguageVersion = GL.GetString(StringName.ShadingLanguageVersion); var renderer = GL.GetString(StringName.Renderer); Log.Info($"Vendor: {vendor}, version: {version}, shadinglangVersion: {shadingLanguageVersion}, renderer: {renderer}"); EnableDebugCallback(); RenderInitialized = true; } if (!RenderThreadHasContext) { Window.MakeCurrent(); RenderThreadHasContext = true; } SetRenderThread(); RenderReady = true; if (Enabled) { RenderFrame?.Invoke(e); } }
public static Texture CreateFromFile(string sourcePath) { Log.Info("Loading: {SourcePath}", sourcePath); var imagePath = AssetManager.GetAssetsPath(sourcePath); Image bitmap = Image.Load(imagePath); var txt = new Texture(bitmap.Width, bitmap.Height) { SourcePath = sourcePath, Label = Path.GetFileName(sourcePath), AutoDisposeBitmap = true, }; txt.SetData(bitmap); return(txt); }