Skip to content

Commit

Permalink
Fixed the shaders for the GUI with emscripten. There still is a problem
Browse files Browse the repository at this point in the history
with blending most probably.

Also fixed an issue with the player name in case the game file cannot be
read
  • Loading branch information
tanis2000 committed Sep 8, 2023
1 parent 293bcf8 commit a5c0b71
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions assets/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ function on_init()

G.preferences_dir = sdl.preferences_dir("altralogica", "binocle-player")
G.player_name = sdl.load_text_file(G.preferences_dir .. G.save_filename)
if G.player_name == nil then
G.player_name = ""
end
end

function main.on_update(dt)
Expand Down
2 changes: 1 addition & 1 deletion binocle-c
9 changes: 7 additions & 2 deletions src/gui/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -922,9 +922,12 @@ void gui_setup_screen_pipeline(gui_handle_t handle, sg_shader display_shader, bo
"#version 300 es\n"
"precision mediump float;\n"
"precision mediump int;\n"
"uniform vec2 resolution;\n"
"uniform sampler2D tex0;\n"
"in vec2 uvCoord;\n"
"uniform vec2 scale;\n"
"uniform vec2 viewport;\n"
"out vec4 fragColor;\n"
"in vec2 uvCoord;\n"
"vec2 uv_iq( vec2 uv, vec2 texture_size ) {\n"
" vec2 pixel = uv * texture_size;\n"
"\n"
Expand All @@ -948,8 +951,10 @@ void gui_setup_screen_pipeline(gui_handle_t handle, sg_shader display_shader, bo
"precision mediump float;\n"
"precision mediump int;\n"
"uniform sampler2D tex0;\n"
"in vec2 uvCoord;\n"
"uniform vec2 scale;\n"
"uniform vec2 viewport;\n"
"out vec4 fragColor;\n"
"in vec2 uvCoord;\n"
"void main() {\n"
" vec4 texcolor = texture(tex0, uvCoord);\n"
" fragColor = texcolor;\n"
Expand Down

0 comments on commit a5c0b71

Please sign in to comment.