treeform / boxy

2D GPU rendering with a tiling atlas.
MIT License
102 stars 7 forks source link

Unable to run basic_windy on X11 Linux #44

Closed ajusa closed 2 years ago

ajusa commented 2 years ago

Hello,

I'm currently trying to just use this library on my machine. My code is

import boxy, opengl, windy

let window = newWindow("Windy + Boxy", ivec2(1280, 800))
makeContextCurrent(window)

loadExtensions()

let bxy = newBoxy()

# Load the images.
bxy.addImage("bg", readImage("./uncle.png"))

var frame: int

# Called when it is time to draw a new frame.
window.onFrame = proc() =
  # Clear the screen and begin a new frame.
  bxy.beginFrame(window.size)
  # Draw the bg.
  bxy.drawImage("bg", rect = rect(vec2(0, 0), window.size.vec2))
  # End this frame, flushing the draw commands.
  bxy.endFrame()
  # Swap buffers displaying the new Boxy frame.
  window.swapBuffers()
  inc frame

while not window.closeRequested:
  pollEvents()

This leads to the following error:

Linking shaders failed:
: error: vertex shader output `color' declared as type `vec4', but fragment shader input declared as type `vec2'

This is on Fedora 35, X11 Linux, 8th gen Intel CPU (with integrated graphics). So not brand new, but not super old either. I'm hoping this issue is just me failing to install some obscure dependency rather than an actual bug in shady/boxy/windy, as I believe the examples do work on Windows?

Thanks for taking a look at this issue!

treeform commented 2 years ago

I think it's a bug with the blurs here: https://github.com/treeform/boxy/blob/cd50dfecad1febe8d3d3c04613f3ad3b5c08b6a6/src/boxy/blurs.nim#L11

I'll take a look at this later.

treeform commented 2 years ago

I have committed a change to the color shaders. If you pull HEAD can you see if that works for you now?

ajusa commented 2 years ago

Just pulled head and it works! Thank you for fixing it :)