File: ex3.lua

package info (click to toggle)
clanlib 0.5.4-1-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 10,320 kB
  • ctags: 10,893
  • sloc: cpp: 76,056; xml: 3,281; sh: 2,961; perl: 1,204; asm: 837; makefile: 775
file content (22 lines) | stat: -rw-r--r-- 508 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- Example 3

CL_Display:set_videomode(320, 200, 16,0)

my_canvas = CL_Canvas:new(320, 200)
my_cliprect = CL_ClipRect:new(20, 20, 280, 160)
my_canvas:push_clip_rect(my_cliprect)

my_canvas:fill_rect(0, 0, 320, 200, 0.0, 0.0, 0.5, 1.0)
my_canvas:draw_line(10, 10, 300, 100, 1.0, 1.0, 1.0, 1.0)

my_canvas:pop_clip_rect()
my_surface = CL_Surface:create(my_canvas, FALSE)

my_surface:put_screen(0, 0)
CL_Display:flip_display()
CL_System:sleep(5000)

my_canvas:delete()
my_surface:delete()
my_cliprect:delete()