mirror of
https://github.com/SFML/SFML.git
synced 2024-11-25 12:51:05 +08:00
* sync with sfml - Renamed Shape::GetNbPoints to Shape::GetPointsCount
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1411 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
504804a06e
commit
fd10d2abfe
@ -1,6 +1,28 @@
|
|||||||
/**
|
/*
|
||||||
*
|
* DSFML - SFML Library wrapper for the D programming language.
|
||||||
|
* Copyright (C) 2010 Andreas Hollandt
|
||||||
|
*
|
||||||
|
* This software is provided 'as-is', without any express or
|
||||||
|
* implied warranty. In no event will the authors be held
|
||||||
|
* liable for any damages arising from the use of this software.
|
||||||
|
*
|
||||||
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
|
* including commercial applications, and to alter it and redistribute
|
||||||
|
* it freely, subject to the following restrictions:
|
||||||
|
*
|
||||||
|
* 1. The origin of this software must not be misrepresented;
|
||||||
|
* you must not claim that you wrote the original software.
|
||||||
|
* If you use this software in a product, an acknowledgment
|
||||||
|
* in the product documentation would be appreciated but
|
||||||
|
* is not required.
|
||||||
|
*
|
||||||
|
* 2. Altered source versions must be plainly marked as such,
|
||||||
|
* and must not be misrepresented as being the original software.
|
||||||
|
*
|
||||||
|
* 3. This notice may not be removed or altered from any
|
||||||
|
* source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
module dsfml.graphics.irendertarget;
|
module dsfml.graphics.irendertarget;
|
||||||
|
|
||||||
import dsfml.system.vector2;
|
import dsfml.system.vector2;
|
||||||
@ -12,84 +34,84 @@ import dsfml.graphics.color;
|
|||||||
|
|
||||||
interface IRenderTarget
|
interface IRenderTarget
|
||||||
{
|
{
|
||||||
/*
|
/**
|
||||||
* Clear the entire target with a single color
|
* Clear the entire target with a single color
|
||||||
*
|
*
|
||||||
* \param color : Color to use to clear the render target
|
* \param color : Color to use to clear the render target
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void clear(Color color = Color());
|
void clear(Color color = Color());
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Draw something into the target
|
* Draw something into the target
|
||||||
*
|
*
|
||||||
* \param object : Object to draw
|
* \param object : Object to draw
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void draw(IDrawable object);
|
void draw(IDrawable object);
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Draw something into the target with a shader
|
* Draw something into the target with a shader
|
||||||
*
|
*
|
||||||
* \param object : Object to draw
|
* \param object : Object to draw
|
||||||
* \param shader : Shader to apply
|
* \param shader : Shader to apply
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void draw(IDrawable object, Shader shader);
|
void draw(IDrawable object, Shader shader);
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Get the width of the rendering region of the target
|
* Get the width of the rendering region of the target
|
||||||
*
|
*
|
||||||
* \return Width in pixels
|
* \return Width in pixels
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint getWidth();
|
uint getWidth();
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Get the height of the rendering region of the target
|
* Get the height of the rendering region of the target
|
||||||
*
|
*
|
||||||
* \return Height in pixels
|
* \return Height in pixels
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
uint getHeight();
|
uint getHeight();
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Change the current active view.
|
* Change the current active view.
|
||||||
*
|
*
|
||||||
* \param view : New view to use (pass GetDefaultView() to set the default view)
|
* \param view : New view to use (pass GetDefaultView() to set the default view)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void setView(View view);
|
void setView(View view);
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Get the current view
|
* Get the current view
|
||||||
*
|
*
|
||||||
* \return Current view active in the window
|
* \return Current view active in the window
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
View getView();
|
View getView();
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Get the default view of the window
|
* Get the default view of the window
|
||||||
*
|
*
|
||||||
* \return Default view
|
* \return Default view
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
View getDefaultView();
|
View getDefaultView();
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Get the viewport of a view applied to this target
|
* Get the viewport of a view applied to this target
|
||||||
*
|
*
|
||||||
* \param view Target view
|
* \param view Target view
|
||||||
*
|
*
|
||||||
* \return Viewport rectangle, expressed in pixels in the current target
|
* \return Viewport rectangle, expressed in pixels in the current target
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
IntRect getViewport(View view);
|
IntRect getViewport(View view);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Convert a point in target coordinates into view coordinates
|
* Convert a point in target coordinates into view coordinates
|
||||||
*
|
*
|
||||||
* \param x : X coordinate of the point to convert, relative to the target
|
* \param x : X coordinate of the point to convert, relative to the target
|
||||||
@ -98,18 +120,18 @@ interface IRenderTarget
|
|||||||
*
|
*
|
||||||
* \return Converted point
|
* \return Converted point
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Vector2f convertCoords(uint x, uint y, View view = null);
|
Vector2f convertCoords(uint x, uint y, View view = null);
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Save the current OpenGL render states and matrices
|
* Save the current OpenGL render states and matrices
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void saveGLStates();
|
void saveGLStates();
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Restore the previously saved OpenGL render states and matrices
|
* Restore the previously saved OpenGL render states and matrices
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void restoreGLStates();
|
void restoreGLStates();
|
||||||
}
|
}
|
@ -1,27 +1,27 @@
|
|||||||
/*
|
/*
|
||||||
* DSFML - SFML Library wrapper for the D programming language.
|
* DSFML - SFML Library wrapper for the D programming language.
|
||||||
* Copyright (C) 2010 Andreas Hollandt
|
* Copyright (C) 2010 Andreas Hollandt
|
||||||
*
|
*
|
||||||
* This software is provided 'as-is', without any express or
|
* This software is provided 'as-is', without any express or
|
||||||
* implied warranty. In no event will the authors be held
|
* implied warranty. In no event will the authors be held
|
||||||
* liable for any damages arising from the use of this software.
|
* liable for any damages arising from the use of this software.
|
||||||
*
|
*
|
||||||
* Permission is granted to anyone to use this software for any purpose,
|
* Permission is granted to anyone to use this software for any purpose,
|
||||||
* including commercial applications, and to alter it and redistribute
|
* including commercial applications, and to alter it and redistribute
|
||||||
* it freely, subject to the following restrictions:
|
* it freely, subject to the following restrictions:
|
||||||
*
|
*
|
||||||
* 1. The origin of this software must not be misrepresented;
|
* 1. The origin of this software must not be misrepresented;
|
||||||
* you must not claim that you wrote the original software.
|
* you must not claim that you wrote the original software.
|
||||||
* If you use this software in a product, an acknowledgment
|
* If you use this software in a product, an acknowledgment
|
||||||
* in the product documentation would be appreciated but
|
* in the product documentation would be appreciated but
|
||||||
* is not required.
|
* is not required.
|
||||||
*
|
*
|
||||||
* 2. Altered source versions must be plainly marked as such,
|
* 2. Altered source versions must be plainly marked as such,
|
||||||
* and must not be misrepresented as being the original software.
|
* and must not be misrepresented as being the original software.
|
||||||
*
|
*
|
||||||
* 3. This notice may not be removed or altered from any
|
* 3. This notice may not be removed or altered from any
|
||||||
* source distribution.
|
* source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
module dsfml.graphics.renderimage;
|
module dsfml.graphics.renderimage;
|
||||||
|
@ -131,9 +131,9 @@ public:
|
|||||||
* Returns:
|
* Returns:
|
||||||
* Total number of points
|
* Total number of points
|
||||||
*/
|
*/
|
||||||
uint getNbPoints()
|
uint getPointsCount()
|
||||||
{
|
{
|
||||||
return sfShape_GetNbPoints(m_ptr);
|
return sfShape_GetPointsCount(m_ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -289,7 +289,7 @@ private:
|
|||||||
typedef void function(void* Shape, int) pf_sfShape_EnableOutline;
|
typedef void function(void* Shape, int) pf_sfShape_EnableOutline;
|
||||||
typedef void function (void* Shape, float Width) pf_sfShape_SetOutlineWidth;
|
typedef void function (void* Shape, float Width) pf_sfShape_SetOutlineWidth;
|
||||||
typedef float function (void* Shape) pf_sfShape_GetOutlineWidth;
|
typedef float function (void* Shape) pf_sfShape_GetOutlineWidth;
|
||||||
typedef uint function (void* Shape) pf_sfShape_GetNbPoints;
|
typedef uint function (void* Shape) pf_sfShape_GetPointsCount;
|
||||||
typedef void function (void* Shape, uint Index, float* X, float* Y) pf_sfShape_GetPointPosition;
|
typedef void function (void* Shape, uint Index, float* X, float* Y) pf_sfShape_GetPointPosition;
|
||||||
typedef void function (void* Shape, uint Index, float X, float Y) pf_sfShape_SetPointPosition;
|
typedef void function (void* Shape, uint Index, float X, float Y) pf_sfShape_SetPointPosition;
|
||||||
typedef Color function (void* Shape, uint index) pf_sfShape_GetPointColor;
|
typedef Color function (void* Shape, uint index) pf_sfShape_GetPointColor;
|
||||||
@ -305,7 +305,7 @@ private:
|
|||||||
static pf_sfShape_EnableOutline sfShape_EnableOutline;
|
static pf_sfShape_EnableOutline sfShape_EnableOutline;
|
||||||
static pf_sfShape_SetOutlineWidth sfShape_SetOutlineWidth;
|
static pf_sfShape_SetOutlineWidth sfShape_SetOutlineWidth;
|
||||||
static pf_sfShape_GetOutlineWidth sfShape_GetOutlineWidth;
|
static pf_sfShape_GetOutlineWidth sfShape_GetOutlineWidth;
|
||||||
static pf_sfShape_GetNbPoints sfShape_GetNbPoints;
|
static pf_sfShape_GetPointsCount sfShape_GetPointsCount;
|
||||||
static pf_sfShape_GetPointPosition sfShape_GetPointPosition;
|
static pf_sfShape_GetPointPosition sfShape_GetPointPosition;
|
||||||
static pf_sfShape_SetPointPosition sfShape_SetPointPosition;
|
static pf_sfShape_SetPointPosition sfShape_SetPointPosition;
|
||||||
static pf_sfShape_GetPointColor sfShape_GetPointColor;
|
static pf_sfShape_GetPointColor sfShape_GetPointColor;
|
||||||
@ -329,7 +329,7 @@ private:
|
|||||||
sfShape_EnableOutline = cast(pf_sfShape_EnableOutline)dll.getSymbol("sfShape_EnableOutline");
|
sfShape_EnableOutline = cast(pf_sfShape_EnableOutline)dll.getSymbol("sfShape_EnableOutline");
|
||||||
sfShape_SetOutlineWidth = cast(pf_sfShape_SetOutlineWidth)dll.getSymbol("sfShape_SetOutlineWidth");
|
sfShape_SetOutlineWidth = cast(pf_sfShape_SetOutlineWidth)dll.getSymbol("sfShape_SetOutlineWidth");
|
||||||
sfShape_GetOutlineWidth = cast(pf_sfShape_GetOutlineWidth)dll.getSymbol("sfShape_GetOutlineWidth");
|
sfShape_GetOutlineWidth = cast(pf_sfShape_GetOutlineWidth)dll.getSymbol("sfShape_GetOutlineWidth");
|
||||||
sfShape_GetNbPoints = cast(pf_sfShape_GetNbPoints)dll.getSymbol("sfShape_GetNbPoints");
|
sfShape_GetPointsCount = cast(pf_sfShape_GetPointsCount)dll.getSymbol("sfShape_GetPointsCount");
|
||||||
sfShape_GetPointPosition = cast(pf_sfShape_GetPointPosition)dll.getSymbol("sfShape_GetPointPosition");
|
sfShape_GetPointPosition = cast(pf_sfShape_GetPointPosition)dll.getSymbol("sfShape_GetPointPosition");
|
||||||
sfShape_SetPointPosition = cast(pf_sfShape_SetPointPosition)dll.getSymbol("sfShape_SetPointPosition");
|
sfShape_SetPointPosition = cast(pf_sfShape_SetPointPosition)dll.getSymbol("sfShape_SetPointPosition");
|
||||||
sfShape_GetPointColor = cast (pf_sfShape_GetPointColor)dll.getSymbol("sfShape_GetPointColor");
|
sfShape_GetPointColor = cast (pf_sfShape_GetPointColor)dll.getSymbol("sfShape_GetPointColor");
|
||||||
|
@ -128,7 +128,7 @@ class DllLoader
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (symb is null)
|
if (symb is null)
|
||||||
report( "Symbol cannot be found in specified library", m_libPath, symbolName);
|
debug report( "Symbol cannot be found in specified library", m_libPath, symbolName);
|
||||||
|
|
||||||
return symb;
|
return symb;
|
||||||
}
|
}
|
||||||
@ -183,10 +183,10 @@ private:
|
|||||||
}
|
}
|
||||||
if (m_lib is null)
|
if (m_lib is null)
|
||||||
{
|
{
|
||||||
report("Cannot open library", m_libPath, null);
|
debug report("Cannot open library", m_libPath, null);
|
||||||
version (Windows)
|
version (Windows)
|
||||||
{
|
{
|
||||||
report("Windows error message: " ~ sysErrorString(GetLastError()), m_libPath, null);
|
debug report("Windows error message: " ~ sysErrorString(GetLastError()), m_libPath, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,17 +37,6 @@ struct Vector3(T)
|
|||||||
T y;
|
T y;
|
||||||
T z;
|
T z;
|
||||||
|
|
||||||
static Vector3 opCall(T x, T y, T z)
|
|
||||||
{
|
|
||||||
Vector3!(T) ret;
|
|
||||||
|
|
||||||
ret.x = x;
|
|
||||||
ret.y = y;
|
|
||||||
ret.z = z;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// unary (-) overload
|
/// unary (-) overload
|
||||||
Vector3 opNeg()
|
Vector3 opNeg()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user