File: gl-cube.e

package info (click to toggle)
entity 0.7.2-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,352 kB
  • ctags: 5,272
  • sloc: ansic: 61,707; sh: 7,921; makefile: 732; perl: 399
file content (37 lines) | stat: -rwxr-xr-x 940 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env entity

<object default-lang="javascript">
  <window name="main" title="Gtk GL Area Test" ondelete="entity:exit" width="400" height="300">

    <valign name="main" expand="true" height="300">
   
        <glarea expand="true" name="main">

	    
	    <glut-text text="CUBE!!!" x="40" y="50" color="#224466"/>
	    
	    <gl-matrix rotate-angle="40" rotate-x="0" rotate-y="10" rotate-z="5"
	     translate-x="20" translate-y="50" translate-z="0">
	    	<glut-cube color="#fff000" size="15.0"/>
	    </gl-matrix>

	</glarea>
 
    </valign>
    <timer interval="51" action="update_gl"/>
    <?javascript
    
    function update_gl (node)
    {
 	matrix = enode ("gl-matrix");
	matrix.attribval["rotate-angle"]+=5;
	if (matrix.attribval["rotate-angle"] >= 360)
	    matrix.attribval["rotate-angle"] = 0;
	    
	glarea = enode ("glarea.main");
	enode ("glarea.main").attrib.redraw = "true";
    }
    ?>
	
  </window>
</object>