Skip to content

Instantly share code, notes, and snippets.

View NepNet's full-sized avatar
💭
Doing pointless stuff

NepuNet NepNet

💭
Doing pointless stuff
View GitHub Profile
@NepNet
NepNet / Gtk3TransparentWindow.cs
Last active September 26, 2016 18:22
Gtk# 3 semi-transparent window
using System;
using Gtk;
using Cairo;
namespace TransTest
{
class MainClass
{
public static void Main (string[] args)
{
//------------------------------------------------------------------//
// This is a modified version of Xlib class from Docky to be used--//
// to reserve screen space for dock-type apps----------------------//
//------------------------------------------------------------------//
using System;
using System.Runtime.InteropServices;
namespace Gtk
{
public static class XLib
using System;
using System.Runtime.InteropServices;
using Gtk;
using OpenToolkit.Graphics.OpenGL4;
//this is just a template, if you encounter incorrect drawing when resizing you can disable double buffering on the top level window for the widget, I couldn't find a better fix
//and will work only on Linux, to fix that you could change the bindings context that will be loaded with one that workd on another platforms like glfw
namespace OpenToolkit
{
public class GLWidget : GLArea
@NepNet
NepNet / GlxBindingsContext.cs
Last active December 26, 2024 04:19
Bindings contexts for OpenTK 4. If you need to load the bindings for windows use the wgl one, for linux glx and if you use it in a cross platform app like a gtk one use the native bindings context, it will check the platform and use either wgl or glx depending on the platform. For Mac ¯\_(ツ)_/¯ idk, I don't have a mac to test
using System;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using OpenTK;
public class GlxBindingsContext : IBindingsContext
{
[DllImport("libGL", CharSet = CharSet.Ansi)]
private static extern IntPtr glXGetProcAddress(string procName);
public IntPtr GetProcAddress(string procName)
@NepNet
NepNet / CubeGenerator.cs
Created January 6, 2023 18:55
A weird cube mesh generator for unity with option to generate only certain faces
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
public class CubeGenerator : MonoBehaviour
{
public struct Face
{
public Vector3[] vertices;