massung / r-cade

Retro Game Engine for Racket
https://r-cade.io
Other
273 stars 13 forks source link

Shader errors on mac, but program still runs? #18

Closed sjqtentacles closed 4 years ago

sjqtentacles commented 4 years ago

Hello!

REALLY LOVE THIS PROJECT PLEASE DON'T QUIT ON IT!!! 👍 🥇

I wanted to mention this issue I ran across and it keeps popping up on different tutorial programs I've ran. Here's the error:

$ racket main.rkt Failed to compile fragment shader: ERROR: 0:1: '*' does not operate on 'vec4' and 'vec2' ERROR: 0:1: Use of undeclared identifier 'texCoordInPixels' ERROR: 0:1: Use of undeclared identifier 'centerCoord' ERROR: 0:1: Use of undeclared identifier 'texCoordInPixels' ERROR: 0:1: Use of undeclared identifier 'distFromCenter' ERROR: 0:1: Use of undeclared identifier 'distFromCenter' ERROR: 0:1: Use of undeclared identifier 'Y' ERROR: 0:1: Use of undeclared identifier 'Y' ERROR: 0:1: Use of undeclared identifier 'Y' ERROR: 0:1: Use of undeclared identifier 'YY' ERROR: 0:1: Use of undeclared identifier 'YY' ERROR: 0:1: Use of undeclared identifier 'YY' ERROR: 0:1: Use of undeclared identifier 'Y' ERROR: 0:1: Use of undeclared identifier 'centerCoord' ERROR: 0:1: Use of undeclared identifier 'distFromCenter' ERROR: 0:1: Use of undeclared identifier 'centerCoord' ERROR: 0:1: Use of undeclared identifier 'distFromCenter' ERROR: 0:1: Use of undeclared identifier 'tx' ERROR: 0:1: Use of undeclared identifier 'ty' ERROR: 0:1: Use of undeclared identifier '

and that's for the tetris music program

#lang racket

(require r-cade)

;; create a song
(define theme
  (music "E4-B3C4D-CB3A-AC4E-DCB3-C4D-E-C-A3-A-.D4-FA-GFE-CE-DCB3-BC4D-E-C-A3-A-."
         #:tempo 280))

(define (game-loop)
  (text 2 2 "Playing the Tetris theme song.")
  (wait)
  (quit))

(define (start-music)
  (play-music theme))

(run game-loop 128 128 #:init start-music)

I can run the program just fine using the cli racket main.rkt but I still see all that shader nonsense printed to stdout. Just wanted to report it. Running on Mac 10.14.6 with csfml 2.5, openal-soft 1.20.1, and libsndfile 1.0.28 successfully installed via homebrew.

$ racket --version
Welcome to Racket v7.3.
massung commented 4 years ago

Thank you for this. There have been a few machines the CRT shader hasn't successfully compiled on and I've been trying to track down why. I think this is it!

I'll be able to test a fix today hopefully.

massung commented 4 years ago

Fixed with b9236af39b4213c858ef8d2281871f8f07b70c97. Thank you so much!

sjqtentacles commented 4 years ago

Confirmed fix! No more shader error printouts. Thanks