diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/core.h | 2 | ||||
| -rw-r--r-- | include/lua_core.h | 158 | ||||
| -rw-r--r-- | include/main.h | 1 |
3 files changed, 92 insertions, 69 deletions
diff --git a/include/core.h b/include/core.h index e196446..0813268 100644 --- a/include/core.h +++ b/include/core.h @@ -85,6 +85,8 @@ int lcoreSetShaderValueMatrix( lua_State* L ); int lcoreSetShaderValueTexture( lua_State* L ); int lcoreSetShaderValue( lua_State* L ); int lcoreSetShaderValueV( lua_State* L ); +int lcoreSetShaderValueWithBuffer( lua_State* L ); +int lcoreSetShaderValueVWithBuffer( lua_State* L ); int lcoreUnloadShader( lua_State* L ); /* Screen-space-related functions. */ int lcoreGetScreenToWorldRay( lua_State* L ); diff --git a/include/lua_core.h b/include/lua_core.h index b3d637c..161c39a 100644 --- a/include/lua_core.h +++ b/include/lua_core.h @@ -1,5 +1,27 @@ #pragma once +// Function specifiers in case library is build/used as a shared library +// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll +// NOTE: visibility("default") attribute makes symbols "visible" when compiled with -fvisibility=hidden +#if defined( _WIN32 ) + #if defined( __TINYC__ ) + #define __declspec(x) __attribute__( (x) ) + #endif + #if defined( EXPOSE_API_SYMBOLS ) + #define REILUAPI __declspec( dllexport ) // We are building the library as a Win32 shared library (.dll) + #elif defined( USE_LIBTYPE_SHARED ) + #define REILUAPI __declspec( dllimport ) // We are using the library as a Win32 shared library (.dll) + #endif +#else + #if defined( EXPOSE_API_SYMBOLS ) + #define REILUAPI __attribute__( ( visibility( "default" ) ) ) // We are building as a Unix shared library (.so/.dylib) + #endif +#endif + +#ifndef REILUAPI + #define REILUAPI // Functions defined as 'extern' by default (implicit specifiers) +#endif + enum BufferType { BUFFER_UNSIGNED_CHAR, BUFFER_UNSIGNED_SHORT, @@ -35,75 +57,75 @@ void luaRegister(); void platformDefineGlobals(); void luaPlatformRegister(); /* Lua get types. */ -bool uluaGetBoolean( lua_State* L, int index ); -Color uluaGetColor( lua_State* L, int index ); -Vector2 uluaGetVector2( lua_State* L, int index ); -Vector3 uluaGetVector3( lua_State* L, int index ); -Vector4 uluaGetVector4( lua_State* L, int index ); -Rectangle uluaGetRectangle( lua_State* L, int index ); -Quaternion uluaGetQuaternion( lua_State* L, int index ); -Matrix uluaGetMatrix( lua_State* L, int index ); -BoundingBox uluaGetBoundingBox( lua_State* L, int index ); -Ray uluaGetRay( lua_State* L, int index ); -NPatchInfo uluaGetNPatchInfo( lua_State* L, int index ); -BoneInfo uluaGetBoneInfo( lua_State* L, int index ); -Transform uluaGetTransform( lua_State* L, int index ); -Buffer* uluaGetBuffer( lua_State* L, int index ); -Image* uluaGetImage( lua_State* L, int index ); -Texture* uluaGetTexture( lua_State* L, int index ); -RenderTexture* uluaGetRenderTexture( lua_State* L, int index ); -Shader* uluaGetShader( lua_State* L, int index ); -Mesh* uluaGetMesh( lua_State* L, int index ); -Camera2D* uluaGetCamera2D( lua_State* L, int index ); -Camera3D* uluaGetCamera3D( lua_State* L, int index ); -Font* uluaGetFont( lua_State* L, int index ); -GlyphInfo* uluaGetGlyphInfo( lua_State* L, int index ); -Wave* uluaGetWave( lua_State* L, int index ); -Sound* uluaGetSound( lua_State* L, int index ); -Music* uluaGetMusic( lua_State* L, int index ); -Light* uluaGetLight( lua_State* L, int index ); -Material* uluaGetMaterial( lua_State* L, int index ); -Model* uluaGetModel( lua_State* L, int index ); -ModelAnimation* uluaGetModelAnimation( lua_State* L, int index ); -rlRenderBatch* uluaGetRLRenderBatch( lua_State* L, int index ); -AutomationEvent* uluaGetAutomationEvent( lua_State* L, int index ); -AutomationEventList* uluaGetAutomationEventList( lua_State* L, int index ); +REILUAPI bool uluaGetBoolean( lua_State* L, int index ); +REILUAPI Color uluaGetColor( lua_State* L, int index ); +REILUAPI Vector2 uluaGetVector2( lua_State* L, int index ); +REILUAPI Vector3 uluaGetVector3( lua_State* L, int index ); +REILUAPI Vector4 uluaGetVector4( lua_State* L, int index ); +REILUAPI Rectangle uluaGetRectangle( lua_State* L, int index ); +REILUAPI Quaternion uluaGetQuaternion( lua_State* L, int index ); +REILUAPI Matrix uluaGetMatrix( lua_State* L, int index ); +REILUAPI BoundingBox uluaGetBoundingBox( lua_State* L, int index ); +REILUAPI Ray uluaGetRay( lua_State* L, int index ); +REILUAPI NPatchInfo uluaGetNPatchInfo( lua_State* L, int index ); +REILUAPI BoneInfo uluaGetBoneInfo( lua_State* L, int index ); +REILUAPI Transform uluaGetTransform( lua_State* L, int index ); +REILUAPI Buffer* uluaGetBuffer( lua_State* L, int index ); +REILUAPI Image* uluaGetImage( lua_State* L, int index ); +REILUAPI Texture* uluaGetTexture( lua_State* L, int index ); +REILUAPI RenderTexture* uluaGetRenderTexture( lua_State* L, int index ); +REILUAPI Shader* uluaGetShader( lua_State* L, int index ); +REILUAPI Mesh* uluaGetMesh( lua_State* L, int index ); +REILUAPI Camera2D* uluaGetCamera2D( lua_State* L, int index ); +REILUAPI Camera3D* uluaGetCamera3D( lua_State* L, int index ); +REILUAPI Font* uluaGetFont( lua_State* L, int index ); +REILUAPI GlyphInfo* uluaGetGlyphInfo( lua_State* L, int index ); +REILUAPI Wave* uluaGetWave( lua_State* L, int index ); +REILUAPI Sound* uluaGetSound( lua_State* L, int index ); +REILUAPI Music* uluaGetMusic( lua_State* L, int index ); +REILUAPI Light* uluaGetLight( lua_State* L, int index ); +REILUAPI Material* uluaGetMaterial( lua_State* L, int index ); +REILUAPI Model* uluaGetModel( lua_State* L, int index ); +REILUAPI ModelAnimation* uluaGetModelAnimation( lua_State* L, int index ); +REILUAPI rlRenderBatch* uluaGetRLRenderBatch( lua_State* L, int index ); +REILUAPI AutomationEvent* uluaGetAutomationEvent( lua_State* L, int index ); +REILUAPI AutomationEventList* uluaGetAutomationEventList( lua_State* L, int index ); -void getVector2Array( lua_State* L, int index, Vector2 points[] ); +REILUAPI void getVector2Array( lua_State* L, int index, Vector2 points[] ); /* Lua push types. */ -void uluaPushColor( lua_State* L, Color color ); -void uluaPushVector2( lua_State* L, Vector2 vector ); -void uluaPushVector3( lua_State* L, Vector3 vector ); -void uluaPushVector4( lua_State* L, Vector4 vector ); -void uluaPushRectangle( lua_State* L, Rectangle rect ); -void uluaPushQuaternion( lua_State* L, Quaternion quaternion ); -void uluaPushMatrix( lua_State* L, Matrix matrix ); -void uluaPushRay( lua_State* L, Ray ray ); -void uluaPushRayCollision( lua_State* L, RayCollision rayCol ); -void uluaPushBoundingBox( lua_State* L, BoundingBox box ); -void uluaPushBoneInfo( lua_State* L, BoneInfo boneInfo ); -void uluaPushTransform( lua_State* L, Transform transform ); +REILUAPI void uluaPushColor( lua_State* L, Color color ); +REILUAPI void uluaPushVector2( lua_State* L, Vector2 vector ); +REILUAPI void uluaPushVector3( lua_State* L, Vector3 vector ); +REILUAPI void uluaPushVector4( lua_State* L, Vector4 vector ); +REILUAPI void uluaPushRectangle( lua_State* L, Rectangle rect ); +REILUAPI void uluaPushQuaternion( lua_State* L, Quaternion quaternion ); +REILUAPI void uluaPushMatrix( lua_State* L, Matrix matrix ); +REILUAPI void uluaPushRay( lua_State* L, Ray ray ); +REILUAPI void uluaPushRayCollision( lua_State* L, RayCollision rayCol ); +REILUAPI void uluaPushBoundingBox( lua_State* L, BoundingBox box ); +REILUAPI void uluaPushBoneInfo( lua_State* L, BoneInfo boneInfo ); +REILUAPI void uluaPushTransform( lua_State* L, Transform transform ); // void uluaPushAutomationEvent( lua_State* L, AutomationEvent event ); -void uluaPushBuffer( lua_State* L, Buffer buffer ); -void uluaPushImage( lua_State* L, Image image ); -void uluaPushTexture( lua_State* L, Texture texture ); -void uluaPushRenderTexture( lua_State* L, RenderTexture renderTexture ); -void uluaPushCamera2D( lua_State* L, Camera2D camera ); -void uluaPushCamera3D( lua_State* L, Camera3D camera ); -void uluaPushShader( lua_State* L, Shader shader ); -void uluaPushFont( lua_State* L, Font font ); -void uluaPushGlyphInfo( lua_State* L, GlyphInfo glyph ); -void uluaPushWave( lua_State* L, Wave wave ); -void uluaPushSound( lua_State* L, Sound sound ); -void uluaPushMusic( lua_State* L, Music music ); -void uluaPushLight( lua_State* L, Light light ); -void uluaPushMaterial( lua_State* L, Material material ); -void uluaPushMesh( lua_State* L, Mesh mesh ); -void uluaPushModel( lua_State* L, Model model ); -void uluaPushModelAnimation( lua_State* L, ModelAnimation modelAnimation ); -void uluaPushRLRenderBatch( lua_State* L, rlRenderBatch renderBatch ); -void uluaPushAutomationEvent( lua_State* L, AutomationEvent event ); -void uluaPushAutomationEventList( lua_State* L, AutomationEventList eventList ); +REILUAPI void uluaPushBuffer( lua_State* L, Buffer buffer ); +REILUAPI void uluaPushImage( lua_State* L, Image image ); +REILUAPI void uluaPushTexture( lua_State* L, Texture texture ); +REILUAPI void uluaPushRenderTexture( lua_State* L, RenderTexture renderTexture ); +REILUAPI void uluaPushCamera2D( lua_State* L, Camera2D camera ); +REILUAPI void uluaPushCamera3D( lua_State* L, Camera3D camera ); +REILUAPI void uluaPushShader( lua_State* L, Shader shader ); +REILUAPI void uluaPushFont( lua_State* L, Font font ); +REILUAPI void uluaPushGlyphInfo( lua_State* L, GlyphInfo glyph ); +REILUAPI void uluaPushWave( lua_State* L, Wave wave ); +REILUAPI void uluaPushSound( lua_State* L, Sound sound ); +REILUAPI void uluaPushMusic( lua_State* L, Music music ); +REILUAPI void uluaPushLight( lua_State* L, Light light ); +REILUAPI void uluaPushMaterial( lua_State* L, Material material ); +REILUAPI void uluaPushMesh( lua_State* L, Mesh mesh ); +REILUAPI void uluaPushModel( lua_State* L, Model model ); +REILUAPI void uluaPushModelAnimation( lua_State* L, ModelAnimation modelAnimation ); +REILUAPI void uluaPushRLRenderBatch( lua_State* L, rlRenderBatch renderBatch ); +REILUAPI void uluaPushAutomationEvent( lua_State* L, AutomationEvent event ); +REILUAPI void uluaPushAutomationEventList( lua_State* L, AutomationEventList eventList ); /* Utils. */ -int uluaGetTableLen( lua_State* L, int index ); -bool uluaIsNil( lua_State* L, int index ); +REILUAPI int uluaGetTableLen( lua_State* L, int index ); +REILUAPI bool uluaIsNil( lua_State* L, int index ); diff --git a/include/main.h b/include/main.h index 55344a5..6fcda26 100644 --- a/include/main.h +++ b/include/main.h @@ -37,7 +37,6 @@ #include "rcamera.h" #endif - #ifdef LUAJIT #ifdef SHARED #include <lua.h> |
