* introduced SFMLClass type for all C pointers
* getNativePointer -> nativePointer property - IpAddress.isValid + IpAddress.None git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1459 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
6b444d338e
commit
cfedeee112
23 changed files with 317 additions and 320 deletions
|
@ -148,7 +148,7 @@ public:
|
|||
|
||||
package:
|
||||
|
||||
this(void* ptr)
|
||||
this(SFMLClass ptr)
|
||||
{
|
||||
super(ptr, true);
|
||||
}
|
||||
|
@ -157,17 +157,17 @@ private:
|
|||
static extern(C)
|
||||
{
|
||||
// sfFont
|
||||
void* function() sfFont_Create;
|
||||
void* function(cchar*) sfFont_CreateFromFile;
|
||||
void* function(ubyte*, size_t) sfFont_CreateFromMemory;
|
||||
void function(void*) sfFont_Destroy;
|
||||
void* function() sfFont_GetDefaultFont;
|
||||
SFMLClass function() sfFont_Create;
|
||||
SFMLClass function(cchar*) sfFont_CreateFromFile;
|
||||
SFMLClass function(ubyte*, size_t) sfFont_CreateFromMemory;
|
||||
void function(SFMLClass) sfFont_Destroy;
|
||||
SFMLClass function() sfFont_GetDefaultFont;
|
||||
|
||||
// DSFML2
|
||||
Glyph function(void*, uint, uint, bool) sfFont_GetGlyph;
|
||||
int function(void*, uint, uint, uint) sfFont_GetKerning;
|
||||
int function(void*, uint) sfFont_GetLineSpacing;
|
||||
void* function(void*, uint) sfFont_GetImage;
|
||||
Glyph function(SFMLClass, uint, uint, bool) sfFont_GetGlyph;
|
||||
int function(SFMLClass, uint, uint, uint) sfFont_GetKerning;
|
||||
int function(SFMLClass, uint) sfFont_GetLineSpacing;
|
||||
SFMLClass function(SFMLClass, uint) sfFont_GetImage;
|
||||
}
|
||||
|
||||
static this()
|
||||
|
@ -190,4 +190,4 @@ private:
|
|||
mixin(loadFromSharedLib("sfFont_GetImage"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -123,7 +123,7 @@ public:
|
|||
void setTexture(string name, Image texture)
|
||||
{
|
||||
m_texture = texture;
|
||||
sfShader_SetTexture(m_ptr, toStringz(name), texture is null ? null : texture.getNativePointer);
|
||||
sfShader_SetTexture(m_ptr, toStringz(name), texture is null ? null : texture.nativePointer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,17 +142,17 @@ private:
|
|||
|
||||
static extern(C)
|
||||
{
|
||||
void* function(cchar*) sfShader_CreateFromFile;
|
||||
void* function(cchar*) sfShader_CreateFromMemory;
|
||||
void function(void*) sfShader_Destroy;
|
||||
void function(void*, cchar*, float) sfShader_SetParameter1;
|
||||
void function(void*, cchar*, float, float) sfShader_SetParameter2;
|
||||
void function(void*, cchar*, float, float, float) sfShader_SetParameter3;
|
||||
void function(void*, cchar*, float, float, float, float) sfShader_SetParameter4;
|
||||
void function(void*, cchar*, void*) sfShader_SetTexture;
|
||||
SFMLClass function(cchar*) sfShader_CreateFromFile;
|
||||
SFMLClass function(cchar*) sfShader_CreateFromMemory;
|
||||
void function(SFMLClass) sfShader_Destroy;
|
||||
void function(SFMLClass, cchar*, float) sfShader_SetParameter1;
|
||||
void function(SFMLClass, cchar*, float, float) sfShader_SetParameter2;
|
||||
void function(SFMLClass, cchar*, float, float, float) sfShader_SetParameter3;
|
||||
void function(SFMLClass, cchar*, float, float, float, float) sfShader_SetParameter4;
|
||||
void function(SFMLClass, cchar*, SFMLClass) sfShader_SetTexture;
|
||||
int function() sfShader_IsAvailable;
|
||||
void function(void*) sfShader_Bind;
|
||||
void function(void*) sfShader_Unbind;
|
||||
void function(SFMLClass) sfShader_Bind;
|
||||
void function(SFMLClass) sfShader_Unbind;
|
||||
}
|
||||
|
||||
static this()
|
||||
|
|
|
@ -40,7 +40,7 @@ import dsfml.graphics.drawableimpl;
|
|||
class Shape : DrawableImpl!("sfShape")
|
||||
{
|
||||
private:
|
||||
this (void* ptr)
|
||||
this (SFMLClass ptr)
|
||||
{
|
||||
super(ptr);
|
||||
}
|
||||
|
@ -284,21 +284,21 @@ private:
|
|||
|
||||
static extern(C)
|
||||
{
|
||||
void* function(float, float, float, float, float, Color, float, Color) sfShape_CreateLine;
|
||||
void* function(float, float, float, float, Color, float, Color) sfShape_CreateRectangle;
|
||||
void* function(float, float, float, Color, float, Color) sfShape_CreateCircle;
|
||||
void function(void*, float, float, Color, Color) sfShape_AddPoint;
|
||||
void function(void*, int) sfShape_EnableFill;
|
||||
void function(void*, int) sfShape_EnableOutline;
|
||||
void function(void*, float Width) sfShape_SetOutlineWidth;
|
||||
float function(void*) sfShape_GetOutlineWidth;
|
||||
uint function(void*) sfShape_GetPointsCount;
|
||||
void function(void*, uint Index, float* X, float* Y) sfShape_GetPointPosition;
|
||||
void function(void*, uint Index, float X, float Y) sfShape_SetPointPosition;
|
||||
Color function(void*, uint index) sfShape_GetPointColor;
|
||||
void function(void*, uint index, Color color) sfShape_SetPointColor;
|
||||
Color function(void*, uint index) sfShape_GetPointOutlineColor;
|
||||
void function(void*, uint index, Color color) sfShape_SetPointOutlineColor;
|
||||
SFMLClass function(float, float, float, float, float, Color, float, Color) sfShape_CreateLine;
|
||||
SFMLClass function(float, float, float, float, Color, float, Color) sfShape_CreateRectangle;
|
||||
SFMLClass function(float, float, float, Color, float, Color) sfShape_CreateCircle;
|
||||
void function(SFMLClass, float, float, Color, Color) sfShape_AddPoint;
|
||||
void function(SFMLClass, int) sfShape_EnableFill;
|
||||
void function(SFMLClass, int) sfShape_EnableOutline;
|
||||
void function(SFMLClass, float Width) sfShape_SetOutlineWidth;
|
||||
float function(SFMLClass) sfShape_GetOutlineWidth;
|
||||
uint function(SFMLClass) sfShape_GetPointsCount;
|
||||
void function(SFMLClass, uint Index, float* X, float* Y) sfShape_GetPointPosition;
|
||||
void function(SFMLClass, uint Index, float X, float Y) sfShape_SetPointPosition;
|
||||
Color function(SFMLClass, uint index) sfShape_GetPointColor;
|
||||
void function(SFMLClass, uint index, Color color) sfShape_SetPointColor;
|
||||
Color function(SFMLClass, uint index) sfShape_GetPointOutlineColor;
|
||||
void function(SFMLClass, uint index, Color color) sfShape_SetPointOutlineColor;
|
||||
}
|
||||
|
||||
mixin(loadFromSharedLib2("csfml-graphics", "sfShape",
|
||||
|
|
|
@ -72,7 +72,7 @@ public:
|
|||
{
|
||||
super();
|
||||
m_image = img;
|
||||
sfSprite_SetImage(m_ptr, img.getNativePointer, true);
|
||||
sfSprite_SetImage(m_ptr, img.nativePointer, true);
|
||||
x = left;
|
||||
y = top;
|
||||
scaleX = scalex;
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
void setImage(Image img, bool adjustToNewSize = false)
|
||||
{
|
||||
assert(img !is null, "Trying to set a null image.");
|
||||
sfSprite_SetImage(m_ptr, img.getNativePointer, adjustToNewSize);
|
||||
sfSprite_SetImage(m_ptr, img.nativePointer, adjustToNewSize);
|
||||
m_image = img;
|
||||
}
|
||||
|
||||
|
@ -216,16 +216,16 @@ private:
|
|||
|
||||
static extern(C)
|
||||
{
|
||||
void function(void*, void*, bool) sfSprite_SetImage;
|
||||
void function(void*, IntRect) sfSprite_SetSubRect;
|
||||
void function(void*, float, float) sfSprite_Resize;
|
||||
void function(void*, int) sfSprite_FlipX;
|
||||
void function(void*, int) sfSprite_FlipY;
|
||||
void* function(void*) sfSprite_GetImage;
|
||||
IntRect function(void*) sfSprite_GetSubRect;
|
||||
float function(void*) sfSprite_GetWidth;
|
||||
float function(void*) sfSprite_GetHeight;
|
||||
Color function(void*, uint, uint) sfSprite_GetPixel;
|
||||
void function(SFMLClass, SFMLClass, bool) sfSprite_SetImage;
|
||||
void function(SFMLClass, IntRect) sfSprite_SetSubRect;
|
||||
void function(SFMLClass, float, float) sfSprite_Resize;
|
||||
void function(SFMLClass, int) sfSprite_FlipX;
|
||||
void function(SFMLClass, int) sfSprite_FlipY;
|
||||
SFMLClass function(SFMLClass) sfSprite_GetImage;
|
||||
IntRect function(SFMLClass) sfSprite_GetSubRect;
|
||||
float function(SFMLClass) sfSprite_GetWidth;
|
||||
float function(SFMLClass) sfSprite_GetHeight;
|
||||
Color function(SFMLClass, uint, uint) sfSprite_GetPixel;
|
||||
}
|
||||
|
||||
mixin(loadFromSharedLib2("csfml-graphics", "sfSprite",
|
||||
|
|
|
@ -152,7 +152,7 @@ public:
|
|||
void font(Font f)
|
||||
{
|
||||
m_font = f;
|
||||
sfText_SetFont(m_ptr, f.getNativePointer);
|
||||
sfText_SetFont(m_ptr, f.nativePointer);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -257,18 +257,18 @@ private:
|
|||
|
||||
static extern(C)
|
||||
{
|
||||
void function(void*, cchar*) sfText_SetString;
|
||||
void function(void*, cdchar*) sfText_SetUnicodeString;
|
||||
void function(void*, void*) sfText_SetFont;
|
||||
void function(void*, uint) sfText_SetCharacterSize;
|
||||
void function(void*, TextStyle) sfText_SetStyle;
|
||||
idchar* function(void*) sfText_GetUnicodeString;
|
||||
ichar* function(void*) sfText_GetString;
|
||||
void* function(void*) sfText_GetFont;
|
||||
uint function(void*) sfText_GetCharacterSize;
|
||||
TextStyle function (void*) sfText_GetStyle;
|
||||
void function(void*, size_t, float*, float*) sfText_GetCharacterPos;
|
||||
FloatRect function(void*) sfText_GetRect;
|
||||
void function(SFMLClass, cchar*) sfText_SetString;
|
||||
void function(SFMLClass, cdchar*) sfText_SetUnicodeString;
|
||||
void function(SFMLClass, SFMLClass) sfText_SetFont;
|
||||
void function(SFMLClass, uint) sfText_SetCharacterSize;
|
||||
void function(SFMLClass, TextStyle) sfText_SetStyle;
|
||||
idchar* function(SFMLClass) sfText_GetUnicodeString;
|
||||
ichar* function(SFMLClass) sfText_GetString;
|
||||
SFMLClass function(SFMLClass) sfText_GetFont;
|
||||
uint function(SFMLClass) sfText_GetCharacterSize;
|
||||
TextStyle function (SFMLClass) sfText_GetStyle;
|
||||
void function(SFMLClass, size_t, float*, float*) sfText_GetCharacterPos;
|
||||
FloatRect function(SFMLClass) sfText_GetRect;
|
||||
}
|
||||
|
||||
mixin(loadFromSharedLib2("csfml-graphics", "sfText",
|
||||
|
|
|
@ -288,7 +288,7 @@ public:
|
|||
}
|
||||
package:
|
||||
|
||||
this(void* ptr, bool preventDelete)
|
||||
this(SFMLClass ptr, bool preventDelete)
|
||||
{
|
||||
super(ptr, preventDelete);
|
||||
}
|
||||
|
@ -296,25 +296,25 @@ package:
|
|||
private:
|
||||
static extern(C)
|
||||
{
|
||||
void* function() sfView_Create;
|
||||
void* function(FloatRect) sfView_CreateFromRect;
|
||||
void function(void*) sfView_Destroy;
|
||||
void function(void*, float, float) sfView_SetCenter;
|
||||
void function(void*, float, float) sfView_SetSize;
|
||||
void function(void*, FloatRect) sfView_SetViewport;
|
||||
float function(void*) sfView_GetCenterX;
|
||||
float function(void*) sfView_GetCenterY;
|
||||
float function(void*) sfView_GetWidth;
|
||||
float function(void*) sfView_GetHeight;
|
||||
FloatRect function(void*) sfView_GetViewport;
|
||||
void function(void*, float, float) sfView_Move;
|
||||
void function(void*, float) sfView_Zoom;
|
||||
SFMLClass function() sfView_Create;
|
||||
SFMLClass function(FloatRect) sfView_CreateFromRect;
|
||||
void function(SFMLClass) sfView_Destroy;
|
||||
void function(SFMLClass, float, float) sfView_SetCenter;
|
||||
void function(SFMLClass, float, float) sfView_SetSize;
|
||||
void function(SFMLClass, FloatRect) sfView_SetViewport;
|
||||
float function(SFMLClass) sfView_GetCenterX;
|
||||
float function(SFMLClass) sfView_GetCenterY;
|
||||
float function(SFMLClass) sfView_GetWidth;
|
||||
float function(SFMLClass) sfView_GetHeight;
|
||||
FloatRect function(SFMLClass) sfView_GetViewport;
|
||||
void function(SFMLClass, float, float) sfView_Move;
|
||||
void function(SFMLClass, float) sfView_Zoom;
|
||||
|
||||
// DSFML2
|
||||
void function(void*, float) sfView_SetRotation;
|
||||
float function(void*) sfView_GetRotation;
|
||||
void function(void*, float) sfView_Rotate;
|
||||
void function(void*, FloatRect) sfView_Reset;
|
||||
void function(SFMLClass, float) sfView_SetRotation;
|
||||
float function(SFMLClass) sfView_GetRotation;
|
||||
void function(SFMLClass, float) sfView_Rotate;
|
||||
void function(SFMLClass, FloatRect) sfView_Reset;
|
||||
}
|
||||
|
||||
static this()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue