mirror of
https://github.com/lloeki/ld48-29.git
synced 2025-12-06 02:54:40 +01:00
now drawing
This commit is contained in:
parent
ef7206fada
commit
40a2d5346f
2 changed files with 38 additions and 5 deletions
28
ld48-29.go
28
ld48-29.go
|
|
@ -26,13 +26,16 @@ func main() {
|
|||
}
|
||||
defer glfw.Terminate()
|
||||
|
||||
window, err := glfw.CreateWindow(640, 480, "LD48", nil, nil)
|
||||
window, err := glfw.CreateWindow(640, 480, "LD48-29", nil, nil)
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
|
||||
window.MakeContextCurrent()
|
||||
|
||||
setup()
|
||||
defer destroy()
|
||||
|
||||
for !window.ShouldClose() {
|
||||
render()
|
||||
window.SwapBuffers()
|
||||
|
|
@ -40,6 +43,25 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
func render() {
|
||||
// TODO: draw!
|
||||
func setup() {
|
||||
gl.Enable(gl.TEXTURE_2D)
|
||||
gl.Enable(gl.DEPTH_TEST)
|
||||
gl.Enable(gl.LIGHTING)
|
||||
gl.Enable(gl.CULL_FACE)
|
||||
|
||||
gl.ClearColor(0.0, 0.0, 0.5, 0)
|
||||
gl.ClearDepth(1)
|
||||
gl.DepthFunc(gl.LEQUAL)
|
||||
}
|
||||
|
||||
|
||||
func destroy() {
|
||||
// TODO: release objects
|
||||
}
|
||||
|
||||
func render() {
|
||||
gl.Clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT)
|
||||
gl.MatrixMode(gl.PROJECTION)
|
||||
gl.LoadIdentity()
|
||||
gl.Frustum(-1, 1, -1, 1, 1.0, 10.0)
|
||||
}
|
||||
|
|
|
|||
15
log.mdown
15
log.mdown
|
|
@ -4,11 +4,13 @@ All time is CEST
|
|||
|
||||
- 07:14
|
||||
|
||||
Wake up, discover the theme on Twitter. Start scrambling ideas. Take breakfast.
|
||||
Wake up, discover the theme on Twitter. Start scrambling ideas. Take
|
||||
breakfast.
|
||||
|
||||
- 08:22
|
||||
|
||||
Initialise github repo. A few ideas popping up already. Try to avoid obvious sea references.
|
||||
Initialise github repo. A few ideas popping up already. Try to avoid obvious
|
||||
sea references.
|
||||
|
||||
- 08:35
|
||||
|
||||
|
|
@ -17,3 +19,12 @@ All time is CEST
|
|||
- 08:41
|
||||
|
||||
Dev log now publicly advertised.
|
||||
|
||||
- 09:51
|
||||
|
||||
First hurdle. GL doesn't want to Clear and I have no clue.
|
||||
|
||||
- 09:55
|
||||
|
||||
Duh. Found via rubberducking I Was calling some stuff *before*
|
||||
MakeContextCurrent. 20min lost.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue