mirror of
https://github.com/encounter/rust-sdl2.git
synced 2026-07-10 21:18:41 -07:00
Merge pull request #1 from netvl/master
Adapted to the latest Rust and ported to Cargo
This commit is contained in:
@@ -13,3 +13,5 @@
|
||||
build/
|
||||
bin/
|
||||
lib/
|
||||
target/
|
||||
.*.swp
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "sdl2_gfx"
|
||||
version = "0.1.0"
|
||||
authors = ["ShuYu Wang <andelf@gmail.com>"]
|
||||
|
||||
[dependencies.sdl2]
|
||||
git = "https://github.com/AngryLawyer/rust-sdl2"
|
||||
|
||||
[[lib]]
|
||||
name = "sdl2_gfx"
|
||||
path = "src/sdl2_gfx/lib.rs"
|
||||
+45
-45
@@ -14,73 +14,73 @@ mod ll {
|
||||
pub fn SDL_imageFilterMMXdetect() -> c_int;
|
||||
pub fn SDL_imageFilterMMXoff();
|
||||
pub fn SDL_imageFilterMMXon();
|
||||
pub fn SDL_imageFilterAdd(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterMean(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterSub(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterAbsDiff(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) ->
|
||||
pub fn SDL_imageFilterAdd(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterMean(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterSub(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterAbsDiff(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) ->
|
||||
c_int;
|
||||
pub fn SDL_imageFilterMult(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterMultNor(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) ->
|
||||
pub fn SDL_imageFilterMult(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterMultNor(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) ->
|
||||
c_int;
|
||||
pub fn SDL_imageFilterMultDivby2(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) ->
|
||||
pub fn SDL_imageFilterMultDivby2(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) ->
|
||||
c_int;
|
||||
pub fn SDL_imageFilterMultDivby4(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) ->
|
||||
pub fn SDL_imageFilterMultDivby4(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) ->
|
||||
c_int;
|
||||
pub fn SDL_imageFilterBitAnd(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterBitOr(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterDiv(Src1: *u8, Src2: *u8,
|
||||
Dest: *u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterBitNegation(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterBitAnd(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterBitOr(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterDiv(Src1: *mut u8, Src2: *mut u8,
|
||||
Dest: *mut u8, length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterBitNegation(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterAddByte(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterAddByte(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, C: u8) -> c_int;
|
||||
pub fn SDL_imageFilterAddUint(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterAddUint(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, C: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterAddByteToHalf(Src1: *u8,
|
||||
Dest: *u8, length: c_uint,
|
||||
pub fn SDL_imageFilterAddByteToHalf(Src1: *mut u8,
|
||||
Dest: *mut u8, length: c_uint,
|
||||
C: u8) -> c_int;
|
||||
pub fn SDL_imageFilterSubByte(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterSubByte(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, C: u8) -> c_int;
|
||||
pub fn SDL_imageFilterSubUint(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterSubUint(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, C: c_uint) -> c_int;
|
||||
pub fn SDL_imageFilterShiftRight(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterShiftRight(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, N: u8) -> c_int;
|
||||
pub fn SDL_imageFilterShiftRightUint(Src1: *u8,
|
||||
Dest: *u8, length: c_uint,
|
||||
pub fn SDL_imageFilterShiftRightUint(Src1: *mut u8,
|
||||
Dest: *mut u8, length: c_uint,
|
||||
N: u8) -> c_int;
|
||||
pub fn SDL_imageFilterMultByByte(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterMultByByte(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, C: u8) -> c_int;
|
||||
pub fn SDL_imageFilterShiftRightAndMultByByte(Src1: *u8,
|
||||
Dest: *u8,
|
||||
pub fn SDL_imageFilterShiftRightAndMultByByte(Src1: *mut u8,
|
||||
Dest: *mut u8,
|
||||
length: c_uint, N: u8,
|
||||
C: u8) -> c_int;
|
||||
pub fn SDL_imageFilterShiftLeftByte(Src1: *u8,
|
||||
Dest: *u8, length: c_uint,
|
||||
pub fn SDL_imageFilterShiftLeftByte(Src1: *mut u8,
|
||||
Dest: *mut u8, length: c_uint,
|
||||
N: u8) -> c_int;
|
||||
pub fn SDL_imageFilterShiftLeftUint(Src1: *u8,
|
||||
Dest: *u8, length: c_uint,
|
||||
pub fn SDL_imageFilterShiftLeftUint(Src1: *mut u8,
|
||||
Dest: *mut u8, length: c_uint,
|
||||
N: u8) -> c_int;
|
||||
pub fn SDL_imageFilterShiftLeft(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterShiftLeft(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, N: u8) -> c_int;
|
||||
pub fn SDL_imageFilterBinarizeUsingThreshold(Src1: *u8,
|
||||
Dest: *u8,
|
||||
pub fn SDL_imageFilterBinarizeUsingThreshold(Src1: *mut u8,
|
||||
Dest: *mut u8,
|
||||
length: c_uint, T: u8)
|
||||
-> c_int;
|
||||
pub fn SDL_imageFilterClipToRange(Src1: *u8, Dest: *u8,
|
||||
pub fn SDL_imageFilterClipToRange(Src1: *mut u8, Dest: *mut u8,
|
||||
length: c_uint, Tmin: u8,
|
||||
Tmax: u8) -> c_int;
|
||||
pub fn SDL_imageFilterNormalizeLinear(Src: *u8,
|
||||
Dest: *u8, length: c_uint,
|
||||
pub fn SDL_imageFilterNormalizeLinear(Src: *mut u8,
|
||||
Dest: *mut u8, length: c_uint,
|
||||
Cmin: c_int, Cmax: c_int,
|
||||
Nmin: c_int, Nmax: c_int) -> c_int;
|
||||
}
|
||||
|
||||
@@ -2,12 +2,6 @@
|
||||
A binding for SDL2_gfx.
|
||||
*/
|
||||
|
||||
#![crate_id="sdl2_gfx#sdl2_gfx:0.1"]
|
||||
#![crate_type = "lib"]
|
||||
#![desc = "SDL2_gfx bindings and wrappers"]
|
||||
#![comment = "SDL2_gfx bindings and wrappers"]
|
||||
#![license = "MIT"]
|
||||
|
||||
#![feature(globs, macro_rules)]
|
||||
|
||||
extern crate libc;
|
||||
|
||||
+67
-67
@@ -18,161 +18,161 @@ mod ll {
|
||||
use sdl2::render::ll::SDL_Renderer;
|
||||
use sdl2::surface::ll::SDL_Surface;
|
||||
extern "C" {
|
||||
pub fn pixelColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn pixelColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
color: uint32_t) -> c_int;
|
||||
pub fn pixelRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn pixelRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn hlineColor(renderer: *SDL_Renderer, x1: int16_t, x2: int16_t,
|
||||
pub fn hlineColor(renderer: *const SDL_Renderer, x1: int16_t, x2: int16_t,
|
||||
y: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn hlineRGBA(renderer: *SDL_Renderer, x1: int16_t, x2: int16_t,
|
||||
pub fn hlineRGBA(renderer: *const SDL_Renderer, x1: int16_t, x2: int16_t,
|
||||
y: int16_t, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) ->
|
||||
c_int;
|
||||
pub fn vlineColor(renderer: *SDL_Renderer, x: int16_t, y1: int16_t,
|
||||
pub fn vlineColor(renderer: *const SDL_Renderer, x: int16_t, y1: int16_t,
|
||||
y2: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn vlineRGBA(renderer: *SDL_Renderer, x: int16_t, y1: int16_t,
|
||||
pub fn vlineRGBA(renderer: *const SDL_Renderer, x: int16_t, y1: int16_t,
|
||||
y2: int16_t, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) ->
|
||||
c_int;
|
||||
pub fn rectangleColor(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn rectangleColor(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn rectangleRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn rectangleRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn roundedRectangleColor(renderer: *SDL_Renderer, x1: int16_t,
|
||||
pub fn roundedRectangleColor(renderer: *const SDL_Renderer, x1: int16_t,
|
||||
y1: int16_t, x2: int16_t, y2: int16_t,
|
||||
rad: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn roundedRectangleRGBA(renderer: *SDL_Renderer, x1: int16_t,
|
||||
pub fn roundedRectangleRGBA(renderer: *const SDL_Renderer, x1: int16_t,
|
||||
y1: int16_t, x2: int16_t, y2: int16_t,
|
||||
rad: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn boxColor(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn boxColor(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn boxRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn boxRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn roundedBoxColor(renderer: *SDL_Renderer, x1: int16_t,
|
||||
pub fn roundedBoxColor(renderer: *const SDL_Renderer, x1: int16_t,
|
||||
y1: int16_t, x2: int16_t, y2: int16_t, rad: int16_t,
|
||||
color: uint32_t) -> c_int;
|
||||
pub fn roundedBoxRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn roundedBoxRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, rad: int16_t, r: uint8_t,
|
||||
g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn lineColor(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn lineColor(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn lineRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn lineRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn aalineColor(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn aalineColor(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn aalineRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn aalineRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn thickLineColor(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn thickLineColor(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, width: uint8_t, color: uint32_t)
|
||||
-> c_int;
|
||||
pub fn thickLineRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn thickLineRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, width: uint8_t, r: uint8_t,
|
||||
g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn circleColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn circleColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn circleRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn circleRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) ->
|
||||
c_int;
|
||||
pub fn arcColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn arcColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, start: int16_t, end: int16_t, color: uint32_t) ->
|
||||
c_int;
|
||||
pub fn arcRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn arcRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, start: int16_t, end: int16_t, r: uint8_t,
|
||||
g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn aacircleColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn aacircleColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn aacircleRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn aacircleRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t)
|
||||
-> c_int;
|
||||
pub fn filledCircleColor(renderer: *SDL_Renderer, x: int16_t,
|
||||
pub fn filledCircleColor(renderer: *const SDL_Renderer, x: int16_t,
|
||||
y: int16_t, r: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn filledCircleRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn filledCircleRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn ellipseColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn ellipseColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rx: int16_t, ry: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn ellipseRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn ellipseRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rx: int16_t, ry: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn aaellipseColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn aaellipseColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rx: int16_t, ry: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn aaellipseRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn aaellipseRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rx: int16_t, ry: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn filledEllipseColor(renderer: *SDL_Renderer, x: int16_t,
|
||||
pub fn filledEllipseColor(renderer: *const SDL_Renderer, x: int16_t,
|
||||
y: int16_t, rx: int16_t, ry: int16_t,
|
||||
color: uint32_t) -> c_int;
|
||||
pub fn filledEllipseRGBA(renderer: *SDL_Renderer, x: int16_t,
|
||||
pub fn filledEllipseRGBA(renderer: *const SDL_Renderer, x: int16_t,
|
||||
y: int16_t, rx: int16_t, ry: int16_t, r: uint8_t,
|
||||
g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn pieColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn pieColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, start: int16_t, end: int16_t, color: uint32_t) ->
|
||||
c_int;
|
||||
pub fn pieRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn pieRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, start: int16_t, end: int16_t, r: uint8_t,
|
||||
g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn filledPieColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn filledPieColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, start: int16_t, end: int16_t,
|
||||
color: uint32_t) -> c_int;
|
||||
pub fn filledPieRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn filledPieRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
rad: int16_t, start: int16_t, end: int16_t, r: uint8_t,
|
||||
g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn trigonColor(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn trigonColor(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, x3: int16_t, y3: int16_t,
|
||||
color: uint32_t) -> c_int;
|
||||
pub fn trigonRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn trigonRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, x3: int16_t, y3: int16_t,
|
||||
r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn aatrigonColor(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn aatrigonColor(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, x3: int16_t, y3: int16_t,
|
||||
color: uint32_t) -> c_int;
|
||||
pub fn aatrigonRGBA(renderer: *SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
pub fn aatrigonRGBA(renderer: *const SDL_Renderer, x1: int16_t, y1: int16_t,
|
||||
x2: int16_t, y2: int16_t, x3: int16_t, y3: int16_t,
|
||||
r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn filledTrigonColor(renderer: *SDL_Renderer, x1: int16_t,
|
||||
pub fn filledTrigonColor(renderer: *const SDL_Renderer, x1: int16_t,
|
||||
y1: int16_t, x2: int16_t, y2: int16_t, x3: int16_t,
|
||||
y3: int16_t, color: uint32_t) -> c_int;
|
||||
pub fn filledTrigonRGBA(renderer: *SDL_Renderer, x1: int16_t,
|
||||
pub fn filledTrigonRGBA(renderer: *const SDL_Renderer, x1: int16_t,
|
||||
y1: int16_t, x2: int16_t, y2: int16_t, x3: int16_t,
|
||||
y3: int16_t, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn polygonColor(renderer: *SDL_Renderer, vx: *int16_t, vy: *int16_t,
|
||||
pub fn polygonColor(renderer: *const SDL_Renderer, vx: *const int16_t, vy: *const int16_t,
|
||||
n: c_int, color: uint32_t) -> c_int;
|
||||
pub fn polygonRGBA(renderer: *SDL_Renderer, vx: *int16_t, vy: *int16_t,
|
||||
pub fn polygonRGBA(renderer: *const SDL_Renderer, vx: *const int16_t, vy: *const int16_t,
|
||||
n: c_int, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) ->
|
||||
c_int;
|
||||
pub fn aapolygonColor(renderer: *SDL_Renderer, vx: *int16_t,
|
||||
vy: *int16_t, n: c_int, color: uint32_t) -> c_int;
|
||||
pub fn aapolygonRGBA(renderer: *SDL_Renderer, vx: *int16_t,
|
||||
vy: *int16_t, n: c_int, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
pub fn aapolygonColor(renderer: *const SDL_Renderer, vx: *const int16_t,
|
||||
vy: *const int16_t, n: c_int, color: uint32_t) -> c_int;
|
||||
pub fn aapolygonRGBA(renderer: *const SDL_Renderer, vx: *const int16_t,
|
||||
vy: *const int16_t, n: c_int, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn filledPolygonColor(renderer: *SDL_Renderer, vx: *int16_t,
|
||||
vy: *int16_t, n: c_int, color: uint32_t) -> c_int;
|
||||
pub fn filledPolygonRGBA(renderer: *SDL_Renderer, vx: *int16_t,
|
||||
vy: *int16_t, n: c_int, r: uint8_t, g: uint8_t,
|
||||
pub fn filledPolygonColor(renderer: *const SDL_Renderer, vx: *const int16_t,
|
||||
vy: *const int16_t, n: c_int, color: uint32_t) -> c_int;
|
||||
pub fn filledPolygonRGBA(renderer: *const SDL_Renderer, vx: *const int16_t,
|
||||
vy: *const int16_t, n: c_int, r: uint8_t, g: uint8_t,
|
||||
b: uint8_t, a: uint8_t) -> c_int;
|
||||
pub fn texturedPolygon(renderer: *SDL_Renderer, vx: *int16_t,
|
||||
vy: *int16_t, n: c_int, texture: *SDL_Surface,
|
||||
pub fn texturedPolygon(renderer: *const SDL_Renderer, vx: *const int16_t,
|
||||
vy: *const int16_t, n: c_int, texture: *mut SDL_Surface,
|
||||
texture_dx: c_int, texture_dy: c_int) -> c_int;
|
||||
pub fn bezierColor(renderer: *SDL_Renderer, vx: *int16_t, vy: *int16_t,
|
||||
pub fn bezierColor(renderer: *const SDL_Renderer, vx: *const int16_t, vy: *const int16_t,
|
||||
n: c_int, s: c_int, color: uint32_t) -> c_int;
|
||||
pub fn bezierRGBA(renderer: *SDL_Renderer, vx: *int16_t, vy: *int16_t,
|
||||
pub fn bezierRGBA(renderer: *const SDL_Renderer, vx: *const int16_t, vy: *const int16_t,
|
||||
n: c_int, s: c_int, r: uint8_t, g: uint8_t, b: uint8_t,
|
||||
a: uint8_t) -> c_int;
|
||||
pub fn gfxPrimitivesSetFont(fontdata: *c_void, cw: uint32_t, ch: uint32_t);
|
||||
pub fn gfxPrimitivesSetFont(fontdata: *const c_void, cw: uint32_t, ch: uint32_t);
|
||||
pub fn gfxPrimitivesSetFontRotation(rotation: uint32_t);
|
||||
pub fn characterColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn characterColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
c: c_char, color: uint32_t) -> c_int;
|
||||
pub fn characterRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
pub fn characterRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
c: c_char, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t)
|
||||
-> c_int;
|
||||
pub fn stringColor(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
s: *c_char, color: uint32_t) -> c_int;
|
||||
pub fn stringRGBA(renderer: *SDL_Renderer, x: int16_t, y: int16_t,
|
||||
s: *c_char, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) ->
|
||||
pub fn stringColor(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
s: *mut c_char, color: uint32_t) -> c_int;
|
||||
pub fn stringRGBA(renderer: *const SDL_Renderer, x: int16_t, y: int16_t,
|
||||
s: *mut c_char, r: uint8_t, g: uint8_t, b: uint8_t, a: uint8_t) ->
|
||||
c_int;
|
||||
}
|
||||
}
|
||||
@@ -483,7 +483,7 @@ impl<P> DrawRenderer for Renderer<P> {
|
||||
fn string<C: ToColor>(&self, x: i16, y: i16, s: &str, color: C) -> SdlResult<()> {
|
||||
let ret = unsafe {
|
||||
s.with_c_str(|buf| {
|
||||
ll::stringColor(self.raw(), x, y, buf as *i8, color.as_u32())
|
||||
ll::stringColor(self.raw(), x, y, buf as *mut i8, color.as_u32())
|
||||
})
|
||||
};
|
||||
if ret == 0 { Ok(()) }
|
||||
@@ -498,7 +498,7 @@ pub fn set_font(fontdata: Option<&[u8]>, cw: uint, ch: uint) {
|
||||
Some(v) => v.as_ptr()
|
||||
};
|
||||
unsafe {
|
||||
ll::gfxPrimitivesSetFont(actual_fontdata as *c_void, cw as u32, ch as u32)
|
||||
ll::gfxPrimitivesSetFont(actual_fontdata as *const c_void, cw as u32, ch as u32)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+24
-24
@@ -12,27 +12,27 @@ mod ll {
|
||||
use libc::*;
|
||||
use sdl2::surface::ll::SDL_Surface;
|
||||
extern "C" {
|
||||
pub fn rotozoomSurface(src: *SDL_Surface, angle: c_double,
|
||||
zoom: c_double, smooth: c_int) -> *SDL_Surface;
|
||||
pub fn rotozoomSurfaceXY(src: *SDL_Surface, angle: c_double,
|
||||
pub fn rotozoomSurface(src: *const SDL_Surface, angle: c_double,
|
||||
zoom: c_double, smooth: c_int) -> *const SDL_Surface;
|
||||
pub fn rotozoomSurfaceXY(src: *const SDL_Surface, angle: c_double,
|
||||
zoomx: c_double, zoomy: c_double, smooth: c_int)
|
||||
-> *SDL_Surface;
|
||||
-> *const SDL_Surface;
|
||||
pub fn rotozoomSurfaceSize(width: c_int, height: c_int, angle: c_double,
|
||||
zoom: c_double, dstwidth: *c_int,
|
||||
dstheight: *c_int);
|
||||
zoom: c_double, dstwidth: *mut c_int,
|
||||
dstheight: *mut c_int);
|
||||
pub fn rotozoomSurfaceSizeXY(width: c_int, height: c_int, angle: c_double,
|
||||
zoomx: c_double, zoomy: c_double,
|
||||
dstwidth: *c_int, dstheight: *c_int);
|
||||
pub fn zoomSurface(src: *SDL_Surface, zoomx: c_double,
|
||||
zoomy: c_double, smooth: c_int) -> *SDL_Surface;
|
||||
dstwidth: *mut c_int, dstheight: *mut c_int);
|
||||
pub fn zoomSurface(src: *const SDL_Surface, zoomx: c_double,
|
||||
zoomy: c_double, smooth: c_int) -> *const SDL_Surface;
|
||||
pub fn zoomSurfaceSize(width: c_int, height: c_int, zoomx: c_double,
|
||||
zoomy: c_double, dstwidth: *c_int,
|
||||
dstheight: *c_int);
|
||||
pub fn shrinkSurface(src: *SDL_Surface, factorx: c_int,
|
||||
factory: c_int) -> *SDL_Surface;
|
||||
pub fn rotateSurface90Degrees(src: *SDL_Surface,
|
||||
zoomy: c_double, dstwidth: *mut c_int,
|
||||
dstheight: *mut c_int);
|
||||
pub fn shrinkSurface(src: *const SDL_Surface, factorx: c_int,
|
||||
factory: c_int) -> *const SDL_Surface;
|
||||
pub fn rotateSurface90Degrees(src: *const SDL_Surface,
|
||||
numClockwiseTurns: c_int) ->
|
||||
*SDL_Surface;
|
||||
*const SDL_Surface;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,22 +104,22 @@ impl RotozoomSurface for Surface {
|
||||
}
|
||||
|
||||
pub fn get_zoom_size(width: int, height: int, zoomx: f64, zoomy: f64) -> (int, int) {
|
||||
let w = 0;
|
||||
let h = 0;
|
||||
unsafe { ll::zoomSurfaceSize(width as c_int, height as c_int, zoomx, zoomy, &w, &h) }
|
||||
let mut w: c_int = 0;
|
||||
let mut h: c_int = 0;
|
||||
unsafe { ll::zoomSurfaceSize(width as c_int, height as c_int, zoomx, zoomy, &mut w, &mut h) }
|
||||
(w as int, h as int)
|
||||
}
|
||||
|
||||
pub fn get_rotozoom_size(width: int, height: int, angle: f64, zoom: f64) -> (int, int) {
|
||||
let w = 0;
|
||||
let h = 0;
|
||||
unsafe { ll::rotozoomSurfaceSize(width as c_int, height as c_int, angle, zoom, &w, &h) }
|
||||
let mut w: c_int = 0;
|
||||
let mut h: c_int = 0;
|
||||
unsafe { ll::rotozoomSurfaceSize(width as c_int, height as c_int, angle, zoom, &mut w, &mut h) }
|
||||
(w as int, h as int)
|
||||
}
|
||||
|
||||
pub fn get_rotozoom_xy_size(width: int, height: int, angle: f64, zoomx: f64, zoomy: f64) -> (int, int) {
|
||||
let w = 0;
|
||||
let h = 0;
|
||||
unsafe { ll::rotozoomSurfaceSizeXY(width as c_int, height as c_int, angle, zoomx, zoomy, &w, &h) }
|
||||
let mut w: c_int = 0;
|
||||
let mut h: c_int = 0;
|
||||
unsafe { ll::rotozoomSurfaceSizeXY(width as c_int, height as c_int, angle, zoomx, zoomy, &mut w, &mut h) }
|
||||
(w as int, h as int)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user