summary refs log tree commit diff stats
path: root/compiler/sinkparameter_inference.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/sinkparameter_inference.nim')
0 files changed, 0 insertions, 0 deletions
Andreas Rumpf <andreas@andi> 2008-06-22 16:14:11 +0200 Initial import' href='/ahoang/Nim/commit/tests/sdltest.nim?h=devel&id=405b86068e6a3d39970b9129ceec0a9108464b28'>405b86068
1a3b730bf ^
6f4bd5174 ^

1a3b730bf ^
6f4bd5174 ^
1a3b730bf ^
6f4bd5174 ^
1a3b730bf ^
6f4bd5174 ^

405b86068
6f4bd5174 ^
1a3b730bf ^
6f4bd5174 ^
1a3b730bf ^
6f4bd5174 ^


405b86068
6f4bd5174 ^


1a3b730bf ^
6f4bd5174 ^



1a3b730bf ^
6f4bd5174 ^



1a3b730bf ^


6f4bd5174 ^
1a3b730bf ^


6f4bd5174 ^

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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52


                          
                         

    

                             

                               
 
                          

                                   
                                                            
                 
                        
 
                              

                                
      
                                                     
                                        
                    
                  


        
 


                 
                                     



                        
                                                          



                          


                                                       
 


                       

                       
# Test the SDL interface:

import
  sdl, sdl_image, colors

var
  screen, greeting: PSurface
  r: TRect
  event: TEvent
  bgColor = colChocolate.int32

if init(INIT_VIDEO) != 0:
  quit "SDL failed to initialize!"

screen = setVideoMode(640, 480, 16, SWSURFACE or ANYFORMAT)
if screen.isNil:
  quit($sdl.getError())

greeting = imgLoad("tux.png")
if greeting.isNil:
  echo "Failed to load tux.png"
else:
  ## convert the image to alpha and free the old one
  var s = greeting.displayFormatAlpha()
  swap(greeting, s)
  s.freeSurface()

r.x = 0
r.y = 0

block game_loop:
  while true:
    
    while pollEvent(addr event) > 0:
      case event.kind
      of QUITEV:
        break game_loop
      of KEYDOWN:
        if evKeyboard(addr event).keysym.sym == K_ESCAPE:
          break game_loop
      else:
        discard
    
    discard fillRect(screen, nil, bgColor) 
    discard blitSurface(greeting, nil, screen, addr r)
    discard flip(screen)

greeting.freeSurface()
screen.freeSurface()
sdl.quit()

## fowl wuz here 10/2012