Skip to content

Commit

Permalink
Modified openGL shader due to forward compatibility problem
Browse files Browse the repository at this point in the history
Error message was "'function' is removed in Forward Compatible context texture2D" that updated texture2D function to texture function.
  • Loading branch information
rlj1202 committed Aug 1, 2018
1 parent 7c6cc90 commit 061cd09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/BitmapLogicSimulator/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ const (
out vec4 color;
void main() {
vec4 back = texture2D(tex, fragTexCoord);
vec4 overlay = back * texture2D(tex2, fragTexCoord);
vec4 back = texture(tex, fragTexCoord);
vec4 overlay = back * texture(tex2, fragTexCoord);
color = mix(back, overlay, 0.7);
}
Expand Down Expand Up @@ -333,7 +333,7 @@ func updateOverlayTex() {
gl.BindBuffer(gl.PIXEL_UNPACK_BUFFER, overlayPBO)
overlayPBOPtr := gl.MapBuffer(gl.PIXEL_UNPACK_BUFFER, gl.WRITE_ONLY)
if overlayPBOPtr != nil {
overlayPBOSlice := (*[1 << 30]byte)(overlayPBOPtr)[:width*height*4 : width*height*4]
overlayPBOSlice := (*[1 << 30]byte)(overlayPBOPtr)[: width*height*4 : width*height*4]

simulator.PerPixel(func(x, y int, state bool) {
index := x + y*width
Expand Down

0 comments on commit 061cd09

Please sign in to comment.