root/lang/d/amanodemo/SDL/SDL_rotozoom.d @ 6335

Revision 5572, 1.7 kB (checked in by itkz, 5 years ago)

gamedemo (amano korosu / takesako Nice boat.)

Line 
1
2/*
3
4SDL_rotozoom - rotozoomer
5
6LGPL (c) A. Schiffler
7
8*/
9
10// convert to D by shinichiro.h
11
12import SDL;
13import SDL_video;
14import SDL_types;
15
16/* Set up for C function definitions, even when using C++ */
17extern (C) {
18
19/* ---- Defines */
20
21        const int SMOOTHING_OFF = 0;
22        const int SMOOTHING_ON = 1;
23
24/* ---- Structures */
25
26    struct tColorRGBA {
27                Uint8 r;
28                Uint8 g;
29                Uint8 b;
30                Uint8 a;
31    }
32
33    struct tColorY {
34                Uint8 y;
35    }
36
37
38/*
39 
40rotozoomSurface()
41
42Rotates and zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
43'angle' is the rotation in degrees. 'zoom' a scaling factor. If 'smooth' is 1
44then the destination 32bit surface is anti-aliased. If the surface is not 8bit
45or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
46
47*/
48
49    SDL_Surface *rotozoomSurface(SDL_Surface * src, double angle, double zoom, int smooth);
50
51
52/* Returns the size of the target surface for a rotozoomSurface() call */
53
54    void rotozoomSurfaceSize(int width, int height, double angle, double zoom, int *dstwidth,
55                                                                                  int *dstheight);
56
57/*
58 
59zoomSurface()
60
61Zoomes a 32bit or 8bit 'src' surface to newly created 'dst' surface.
62'zoomx' and 'zoomy' are scaling factors for width and height. If 'smooth' is 1
63then the destination 32bit surface is anti-aliased. If the surface is not 8bit
64or 32bit RGBA/ABGR it will be converted into a 32bit RGBA format on the fly.
65
66*/
67
68    SDL_Surface *zoomSurface(SDL_Surface * src, double zoomx, double zoomy, int smooth);
69
70/* Returns the size of the target surface for a zoomSurface() call */
71
72    void zoomSurfaceSize(int width, int height, double zoomx, double zoomy, int *dstwidth, int *dstheight);
73
74
75/* Ends C function definitions when using C++ */
76}
77
Note: See TracBrowser for help on using the browser.