Added Drawable module, still have the comments to add and have to test if it works, but theoretically it should be good to go.
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1677 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
85d24cbf88
commit
550289b6a8
3 changed files with 564 additions and 10 deletions
|
@ -19,18 +19,22 @@
|
|||
* 3. This notice may not be removed or altered from any
|
||||
* source distribution.
|
||||
*/
|
||||
|
||||
|
||||
#include "../../sfml-system/system/main.hpp"
|
||||
#include "main.hpp"
|
||||
#include "Color.hpp"
|
||||
|
||||
#include <SFML/Graphics.hpp>
|
||||
|
||||
VALUE globalSFMLNamespace;
|
||||
VALUE globalBlendNamespace;
|
||||
|
||||
/* External classes */
|
||||
VALUE globalVector2Class;
|
||||
VALUE globalVector3Class;
|
||||
VALUE globalWindowClass;
|
||||
|
||||
bool CheckDependencies( void )
|
||||
static bool CheckDependencies( void )
|
||||
{
|
||||
if( rb_cvar_defined( globalSFMLNamespace, rb_intern( "WindowLoaded" ) ) == Qtrue )
|
||||
{
|
||||
|
@ -40,15 +44,13 @@ bool CheckDependencies( void )
|
|||
return false;
|
||||
}
|
||||
|
||||
VALUE RetrieveSFMLClass( const char * aName )
|
||||
/* Available blending modes for drawable objects. */
|
||||
static void CreateBlendEnum( void )
|
||||
{
|
||||
ID name = rb_intern( aName );
|
||||
if( rb_cvar_defined( globalSFMLNamespace, name ) == Qfalse )
|
||||
{
|
||||
rb_raise( rb_eRuntimeError, "This module depends on SFML::%s", aName );
|
||||
}
|
||||
|
||||
return rb_cvar_get( globalSFMLNamespace, name );
|
||||
rb_define_const( globalBlendNamespace, "Alpha", INT2FIX( sf::Blend::Alpha ) );
|
||||
rb_define_const( globalBlendNamespace, "Add", INT2FIX( sf::Blend::Add ) );
|
||||
rb_define_const( globalBlendNamespace, "Multiply", INT2FIX( sf::Blend::Multiply ) );
|
||||
rb_define_const( globalBlendNamespace, "None", INT2FIX( sf::Blend::None ) );
|
||||
}
|
||||
|
||||
void Init_graphics( void )
|
||||
|
@ -63,6 +65,8 @@ void Init_graphics( void )
|
|||
globalVector3Class = RetrieveSFMLClass( "Vector3" );
|
||||
globalWindowClass = RetrieveSFMLClass( "Window" );
|
||||
|
||||
CreateBlendEnum();
|
||||
|
||||
rb_define_const(globalSFMLNamespace, "GraphicsLoaded", Qtrue);
|
||||
|
||||
Init_Color();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue