bind
This commit is contained in:
@@ -416,6 +416,21 @@ RageDisplay::RageDisplay()
|
|||||||
g_ViewStack = MatrixStack();
|
g_ViewStack = MatrixStack();
|
||||||
g_WorldStack = MatrixStack();
|
g_WorldStack = MatrixStack();
|
||||||
g_TextureStack = MatrixStack();
|
g_TextureStack = MatrixStack();
|
||||||
|
|
||||||
|
// Register with Lua.
|
||||||
|
{
|
||||||
|
Lua *L = LUA->Get();
|
||||||
|
lua_pushstring( L, "DISPLAY" );
|
||||||
|
this->PushSelf( L );
|
||||||
|
lua_settable( L, LUA_GLOBALSINDEX );
|
||||||
|
LUA->Release( L );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
RageDisplay::~RageDisplay()
|
||||||
|
{
|
||||||
|
// Unregister with Lua.
|
||||||
|
LUA->UnsetGlobal( "DISPLAY" );
|
||||||
}
|
}
|
||||||
|
|
||||||
const RageMatrix* RageDisplay::GetCentering() const
|
const RageMatrix* RageDisplay::GetCentering() const
|
||||||
@@ -955,6 +970,35 @@ void RageCompiledGeometry::Set( const vector<msMesh> &vMeshes, bool bNeedsNormal
|
|||||||
Change( vMeshes );
|
Change( vMeshes );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// lua start
|
||||||
|
#include "LuaBinding.h"
|
||||||
|
class LunaRageDisplay: public Luna<RageDisplay>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static int GetDisplayWidth( T* p, lua_State *L )
|
||||||
|
{
|
||||||
|
VideoModeParams params = p->GetActualVideoModeParams();
|
||||||
|
LuaHelpers::Push( L, params.width );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int GetDisplayHeight( T* p, lua_State *L )
|
||||||
|
{
|
||||||
|
VideoModeParams params = p->GetActualVideoModeParams();
|
||||||
|
LuaHelpers::Push( L, params.height );
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
LunaRageDisplay()
|
||||||
|
{
|
||||||
|
ADD_METHOD( GetDisplayWidth );
|
||||||
|
ADD_METHOD( GetDisplayHeight );
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LUA_REGISTER_CLASS( RageDisplay )
|
||||||
|
// lua end
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001-2004 Chris Danford, Glenn Maynard
|
* Copyright (c) 2001-2004 Chris Danford, Glenn Maynard
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ public:
|
|||||||
virtual const PixelFormatDesc *GetPixelFormatDesc( PixelFormat pf ) const = 0;
|
virtual const PixelFormatDesc *GetPixelFormatDesc( PixelFormat pf ) const = 0;
|
||||||
|
|
||||||
RageDisplay();
|
RageDisplay();
|
||||||
virtual ~RageDisplay() { }
|
virtual ~RageDisplay();
|
||||||
|
|
||||||
virtual RString Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer ) = 0;
|
virtual RString Init( const VideoModeParams &p, bool bAllowUnacceleratedRenderer ) = 0;
|
||||||
|
|
||||||
@@ -378,6 +378,9 @@ public:
|
|||||||
RageSurface *CreateSurfaceFromPixfmt( PixelFormat pixfmt, void *pixels, int width, int height, int pitch );
|
RageSurface *CreateSurfaceFromPixfmt( PixelFormat pixfmt, void *pixels, int width, int height, int pitch );
|
||||||
PixelFormat FindPixelFormat( int bpp, int Rmask, int Gmask, int Bmask, int Amask, bool realtime=false );
|
PixelFormat FindPixelFormat( int bpp, int Rmask, int Gmask, int Bmask, int Amask, bool realtime=false );
|
||||||
|
|
||||||
|
// Lua
|
||||||
|
void PushSelf( lua_State *L );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
RageMatrix GetPerspectiveMatrix( float fovy, float aspect, float zNear, float zFar );
|
RageMatrix GetPerspectiveMatrix( float fovy, float aspect, float zNear, float zFar );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user