Skip to content

Commit

Permalink
Merge branch 'master' of /home/hshaw/projects/golang1.7/src/github.co…
Browse files Browse the repository at this point in the history
…m/TheGrum/renderview/

Conflicts:
	README.md
	driver/driver_gtk2.go
	examples/lsystem/demo.go
	examples/lsystem/lsystem.go
	examples/lsystem/lsystemrender.go
	examples/mandelbrot/mandelmodel.go
  • Loading branch information
TheGrum committed Aug 28, 2016
2 parents 883c132 + e0fc460 commit 492be35
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ A means to observe a subset of RenderParameters and determine if they have chang

At its most basic, using RenderView with the BasicRenderModel can be as simple as adding a few lines of code:

<<<<<<< HEAD
m := rv.NewBasicRenderModel()
m.AddParameters(DefaultParameters(false, rv.HINT_SIDEBAR, rv.OPT_AUTO_ZOOM, -10, 10, 10, -10)...)
m.InnerRender = func() {
Expand All @@ -70,6 +71,30 @@ Alternately, you can fully specify your parameters, like so:
rv.NewIntRP("cellwidth", 5),
rv.NewIntRP("mazewidth", 100),
rv.NewIntRP("mazeheight", 100))...)
=======
m := rv.NewBasicRenderModel()
m.AddParameters(DefaultParameters(false, rv.HINT_SIDEBAR, rv.OPT_AUTO_ZOOM, -10, 10, 10, -10)...)
m.InnerRender = func() {
// some number of m.Param[x].Value[Float64|Int|etc]() to gather the values your renderer needs
m.Img = your_rendering_function_here(param, param, param)
}
driver.Main(m)

Alternately, you can fully specify your parameters, like so:

m.AddParameters(
rv.SetHints(rv.HINT_HIDE,
rv.NewIntRP("width", 0),
rv.NewIntRP("height", 0),
)...)
m.AddParameters(
rv.SetHints(rv.HINT_SIDEBAR,
rv.NewIntRP("page", 0),
rv.NewIntRP("linewidth", 1),
rv.NewIntRP("cellwidth", 5),
rv.NewIntRP("mazewidth", 100),
rv.NewIntRP("mazeheight", 100))...)
>>>>>>> e0fc460b97ddda8c1fa010b4ad8573c945ecde99
See examples and cmd for more.

Expand Down
4 changes: 4 additions & 0 deletions driver/driver_gtk2.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
// Use of this source code is governed by the MIT-license
// as defined in the LICENSE file.

<<<<<<< HEAD
// +build !gotk3,linux,!android
=======
// +build linux,!android
>>>>>>> e0fc460b97ddda8c1fa010b4ad8573c945ecde99

package driver

Expand Down
3 changes: 3 additions & 0 deletions examples/lsystem/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
// Use of this source code is governed by the MIT-license
// as defined in the LICENSE file.

<<<<<<< HEAD
// +build example
// marked as an example to not build automatically,
// go build -tags 'example'
// in this directory to build

=======
>>>>>>> e0fc460b97ddda8c1fa010b4ad8573c945ecde99
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/lsystem/lsystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
// Use of this source code is governed by the MIT-license
// as defined in the LICENSE file.

<<<<<<< HEAD
// +build example

=======
>>>>>>> e0fc460b97ddda8c1fa010b4ad8573c945ecde99
package main

import (
Expand Down
3 changes: 3 additions & 0 deletions examples/lsystem/lsystemrender.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ func RenderLSystem(left float64, top float64, right float64, bottom float64, bou
state := stack[len(stack)-1]
location = state.Location
direction = state.Direction
<<<<<<< HEAD
stack = stack[:len(stack)-1]
=======
>>>>>>> e0fc460b97ddda8c1fa010b4ad8573c945ecde99
}
}
maxX = FMax(maxX, location.X)
Expand Down
4 changes: 4 additions & 0 deletions examples/mandelbrot/mandelmodel.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ package mandelbrot

import (
"math"
<<<<<<< HEAD
=======

>>>>>>> e0fc460b97ddda8c1fa010b4ad8573c945ecde99
rv "github.com/TheGrum/renderview"
)

Expand Down

0 comments on commit 492be35

Please sign in to comment.