Skip to content

Commit

Permalink
Merge pull request #1 from ww24/fix-rendering
Browse files Browse the repository at this point in the history
Fix rendering
  • Loading branch information
ww24 authored May 29, 2021
2 parents aee07ce + e666696 commit 4e53b4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 0 additions & 3 deletions gfx/shaders/basic.frag
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ uniform sampler2D texture0;
void main()
{
color = texture(texture0, TexCoord);

// discard alpha
if (color.a < 1.0) discard;

// gamma correction
color = pow(color, vec4(0.4545));
Expand Down
6 changes: 4 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,21 @@ func main() {
glfw.WindowHint(glfw.ContextVersionMinor, 1)
glfw.WindowHint(glfw.OpenGLProfile, glfw.OpenGLCoreProfile)
glfw.WindowHint(glfw.OpenGLForwardCompatible, glfw.True)
glfw.WindowHint(glfw.Samples, 8)
window, err := glfw.CreateWindow(defaultSize, defaultSize, "image widget", nil, nil)
if err != nil {
log.Fatalln("failed to create window:", err)
}

window.MakeContextCurrent()
helper.NewWindowMoveHandler(window)
helper.NewWindowCloseHandler(window, glfw.KeyEscape)

if err := gl.Init(); err != nil {
log.Fatalln("failed to init gl:", err)
}

helper.NewWindowMoveHandler(window)
helper.NewWindowCloseHandler(window, glfw.KeyEscape)
gl.Enable(gl.MULTISAMPLE)

if err := programLoop(window); err != nil {
log.Fatalln("failed to exec program loop:", err)
Expand Down

0 comments on commit 4e53b4f

Please sign in to comment.