tsoding / ded

Dramatic EDitor
MIT License
579 stars 76 forks source link

GL issues on macOS 11.7.2 #65

Open fabjan opened 1 year ago

fabjan commented 1 year ago

Caveats

I don't write many graphical programs. Perhaps macOS is always a pain and you don't want to support it. Given that build.sh contains a uname check for "Darwin" though, I'm giving it a shot.

Problem

I installed the following versions of the dependencies (latest in Homebrew):

The build went fine without warnings or errors.

Running the first build:

❯ ./ded
GL version 3.3
ARB_draw_instanced is not supported; game may not work properly!!

I added a YOLO environment variable to skip returning 1 for all those "game may not work properly" checks, to press on and see where I got.

❯ YOLO=1 ./ded
GL version 3.3
ARB_draw_instanced is not supported; game may not work properly!!
WARNING! GLEW_ARB_debug_output is not availableERROR: could not compile GL_FRAGMENT_SHADER
ERROR: 0:6: Use of undeclared identifier 'gl_FragColor'

ERROR: failed to compile `./shaders/simple_color.frag` shader file

Is the program written for a different GL version than what macOS 11.7.2 provides perhaps?

I edited each of the shaders/simple_*.frag programs to stop using gl_FragColor and instead declare out vec4 fragColor; and use that.

Solved?

It looks like everything is working for now, with two changes:

epic_file_browser

fabjan commented 1 year ago

Happy to open a PR unless you prefer some other solution (or none).

mattthhh commented 1 year ago

ty brooo i was looking how to make it works on macOS <3

maybe u know what are shortcuts to save file and go to the file manager ?

Swonkie commented 1 year ago

I installed the following versions of the dependencies (latest in Homebrew):

* sdl2 2.26.3

* freetype 2.13.0

* glew 2.2.0_1

The build went fine without warnings or errors.

Running the first build:

❯ ./ded
GL version 3.3
ARB_draw_instanced is not supported; game may not work properly!!

Same thing here on macOS 13.1

Swonkie commented 1 year ago

maybe u know what are shortcuts to save file and go to the file manager ?

"The source is the documentation." (or something like that 😉 ) -- tsoding

@mattthhh Seems to be F2 to save and F3 to open the file browser.

https://github.com/tsoding/ded/blob/759c47633d142ba37c0fc3620d472ffb40851cd7/src/main.c#L181-L350

fabjan commented 1 year ago

dlangui also solved the gl_FragColor by declaring a normal out variable https://github.com/buggins/dlangui/commit/6cfe98a4f1f665887fc4c0cccd526a8ce9f3c19c

fabjan commented 1 year ago

Ah, the YOLO flag is not longer needed after the instancing check was removed from main.c

ShazamHax commented 1 year ago

ty brooo i was looking how to make it works on macOS <3

maybe u know what are shortcuts to save file and go to the file manager ?

So it works for you? How exactly did you do it???? I can't seem to decipher what "I edited each of the shader files to stop using gl_color and instead use out vec4 color" means and how to implement the solution. Please help me because this looks like a really cool editor and I would like to use it.

fabjan commented 1 year ago

@ShazamHax see e.g. https://github.com/tsoding/ded/compare/master...fabjan:ded:big-sur-workarounds (a bit old now, not sure if it's up to date, but you should see a pattern for what is needed to be done about gl_FragColor in that diff).