]> gitweb.factorcode.org Git - factor.git/blob - extra/bunny/fixed-pipeline/fixed-pipeline.factor
Remove with-malloc, use destructors instead
[factor.git] / extra / bunny / fixed-pipeline / fixed-pipeline.factor
1 USING: alien.c-types continuations destructors kernel
2 opengl opengl.gl bunny.model specialized-arrays.float ;
3 IN: bunny.fixed-pipeline
4
5 TUPLE: bunny-fixed-pipeline ;
6
7 : <bunny-fixed-pipeline> ( gadget -- draw )
8     drop
9     bunny-fixed-pipeline new ;
10
11 M: bunny-fixed-pipeline draw-bunny
12     drop
13     GL_LIGHTING glEnable
14     GL_LIGHT0 glEnable
15     GL_COLOR_MATERIAL glEnable
16     GL_LIGHT0 GL_POSITION float-array{ 1.0 -1.0 1.0 1.0 } underlying>> glLightfv
17     GL_FRONT_AND_BACK GL_SHININESS 100.0 glMaterialf
18     GL_FRONT_AND_BACK GL_SPECULAR glColorMaterial
19     GL_FRONT_AND_BACK GL_AMBIENT_AND_DIFFUSE glColorMaterial
20     0.6 0.5 0.5 1.0 glColor4f
21     bunny-geom ;
22
23 M: bunny-fixed-pipeline dispose
24     drop ;
25