Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Minor documentation expansion on use of std::bind() for events. #1760

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
71e9501
Minor documentation expansion on use of std::bind() for events.
Jan 14, 2017
20877d0
Minor documentation expansion on use of std::bind() for events.
Jan 14, 2017
06d2100
Merge branch 'master' of github.com:carnalis/Urho3D
Jan 20, 2017
7d06916
Remove semicolon from shader transform (iModelMatrix) macros, as it s…
cadaver Feb 20, 2017
7451d6f
Add EndAllViewsRender event, emitted when Renderer::Render() is finis…
cadaver Feb 20, 2017
af1aba2
Travis CI: API documentation update at 2017-02-20 19:27:37 UTC.
urho3d-travis-ci Feb 20, 2017
f38487f
Add new option to control how to share resources on web platform.
weitjong Feb 22, 2017
25612d6
Bugfix for vegetation shader and instancing.
Feb 23, 2017
5ffb40b
For CI - use the new build option to reduce number of changed objects.
weitjong Feb 23, 2017
e1202b7
Add other body nodeID attribute to Constraint2D for proper body conne…
cadaver Feb 25, 2017
1760b0f
Travis CI: API documentation update at 2017-02-25 12:46:18 UTC.
urho3d-travis-ci Feb 25, 2017
779d283
Rename CheckDrawableVisibility() to CheckDrawableVisibilityWork() to …
1vanK Feb 25, 2017
5fe936e
For CI - only upload web samples when it is a master CI build.
weitjong Feb 26, 2017
d710b29
Merge pull request #1834 from 1vanK/master
cadaver Feb 27, 2017
69b7a9d
For CI - correct the "master" branch name for Web-CI build.
weitjong Feb 27, 2017
84a1f82
Minor documentation expansion on use of std::bind() for events.
Jan 14, 2017
f90dde0
64bit integer variant
rokups Jan 10, 2017
6a7a57e
More 64bit variant work, lua and angelscript bindings.
rokups Mar 1, 2017
5c299dd
Merge remote-tracking branch 'rokups/feature/int64-variant'
cadaver Mar 1, 2017
39c41dc
Shorten long long int to long long.
cadaver Mar 1, 2017
00816ef
Add XMLElement::GetInt64 & GetUInt64 for completeness.
cadaver Mar 1, 2017
70186e7
Travis CI: API documentation update at 2017-03-01 19:27:37 UTC.
urho3d-travis-ci Mar 1, 2017
f75a784
Merge branch 'master' of github.com:carnalis/Urho3D
Mar 2, 2017
0a19418
Minor documentation expansion on use of std::bind() for events.
Jan 14, 2017
873adf5
Merge branch 'master' of github.com:carnalis/Urho3D
Mar 2, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -401,6 +401,7 @@ env:
- numjobs=2
- WEB=1
- EMSCRIPTEN_SHARE_DATA=1
- EMSCRIPTEN_SHARE_JS=1
- USE_CCACHE=1
- CCACHE_SLOPPINESS=pch_defines,time_macros
- CCACHE_COMPRESS=1
Expand All @@ -420,7 +421,7 @@ before_script:
- git clone --depth 1 https://github.com/urho3d/emscripten-sdk.git && emscripten-sdk/emsdk activate --build=Release sdk-master-64bit && source emscripten-sdk/emsdk_env.sh
- export PATH=$(whereis -b ccache |grep -o '\S*lib\S*'):$PATH; for f in $EMSCRIPTEN/{emcc,em++}; do touch -d "2015-09-01 00:00:00 +0800" $f; done
- rake ci_setup_cache
script: rake ci && if [ "$URHO3D_LIB_TYPE" == "SHARED" ]; then rake ci_emscripten_samples_update; fi && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi && rake ci_timer
script: rake ci && if [[ "$TRAVIS_BRANCH" == "Web-CI" ]] && [[ "$TRAVIS_PULL_REQUEST" == "false" ]] && [[ "$URHO3D_LIB_TYPE" == "SHARED" ]]; then rake ci_emscripten_samples_update; fi && if [ $PACKAGE_UPLOAD ]; then rake ci_package_upload; fi && rake ci_timer
after_script: rake ci_teardown_cache

---
Expand Down
18 changes: 14 additions & 4 deletions CMake/Modules/Urho3D-CMake-common.cmake
Expand Up @@ -282,7 +282,8 @@ if (EMSCRIPTEN) # CMAKE_CROSSCOMPILING is always true for Emscripten
option (EMSCRIPTEN_ALLOW_MEMORY_GROWTH "Enable memory growing based on application demand (Emscripten cross-compiling build only)")
math (EXPR EMSCRIPTEN_TOTAL_MEMORY "128 * 1024 * 1024") # This option is ignored when EMSCRIPTEN_ALLOW_MEMORY_GROWTH option is set
set (EMSCRIPTEN_TOTAL_MEMORY ${EMSCRIPTEN_TOTAL_MEMORY} CACHE STRING "Specify the total size of memory to be used (Emscripten cross-compiling build only); default to 128 MB, this option is ignored when EMSCRIPTEN_ALLOW_MEMORY_GROWTH=1")
set (EMSCRIPTEN_SHARE_DATA FALSE CACHE BOOL "Enable sharing data file support (Emscripten cross-compiling build only)")
option (EMSCRIPTEN_SHARE_DATA "Enable sharing data file support (Emscripten cross-compiling build only)")
cmake_dependent_option (EMSCRIPTEN_SHARE_JS "Share the same JS file responsible to load the shared data file (Emscripten cross-compiling build only and when enabling sharing data file support only)" FALSE EMSCRIPTEN_SHARE_DATA FALSE)
set (EMSCRIPTEN_SYSTEM_LIBS "" CACHE STRING "Specify a semicolon-separated list of additional system libraries that should be pre-built using embuilder.py, by default 'dlmalloc', 'libc', 'libcxxabi', and 'gl' will be pre-built, so they should not be listed again (Emscripten cross-compiling build only); when using CMake CLI on Unix-like host systems, the semicolon may need to be properly escaped; see usage of embuilder.py to get the full list of supported system libraries")
endif ()
# Constrain the build option values in cmake-gui, if applicable
Expand Down Expand Up @@ -1314,11 +1315,17 @@ macro (setup_main_executable)
# Set the custom EMCC_OPTION property to peload the generated shared data file
if (EMSCRIPTEN_SHARE_DATA)
set (SHARED_RESOURCE_JS ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_PROJECT_NAME}.js)
list (APPEND SOURCE_FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data)
set_source_files_properties (${SHARED_RESOURCE_JS} PROPERTIES GENERATED TRUE EMCC_OPTION pre-js)
if (EMSCRIPTEN_SHARE_JS)
set (PREFIX_JS ${CMAKE_BINARY_DIR}/Source/prefix.js)
set (SHARED_JS ${SHARED_RESOURCE_JS})
else ()
set (PREFIX_JS ${SHARED_RESOURCE_JS})
endif ()
list (APPEND SOURCE_FILES ${PREFIX_JS} ${SHARED_RESOURCE_JS}.data)
set_source_files_properties (${PREFIX_JS} PROPERTIES GENERATED TRUE EMCC_OPTION pre-js)
# Need to check if the destination variable is defined first because this macro could be called by downstream project that does not wish to install anything
if (DEST_BUNDLE_DIR)
install (FILES ${SHARED_RESOURCE_JS} ${SHARED_RESOURCE_JS}.data DESTINATION ${DEST_BUNDLE_DIR})
install (FILES ${SHARED_JS} ${SHARED_RESOURCE_JS}.data DESTINATION ${DEST_BUNDLE_DIR})
endif ()
endif ()
endif ()
Expand Down Expand Up @@ -1830,6 +1837,9 @@ elseif (WEB)
string (REPLACE "<body>" "<body>\n\n<a href=\"https://urho3d.github.io\" title=\"Urho3D Homepage\"><img src=\"https://urho3d.github.io/assets/images/logo.png\" alt=\"link to https://urho3d.github.io\" height=\"80\" width=\"160\" /></a>\n" SHELL_HTML "${SHELL_HTML}")
file (WRITE ${CMAKE_BINARY_DIR}/Source/shell.html "${SHELL_HTML}")
endif ()
if (EMSCRIPTEN_SHARE_JS AND NOT EXISTS ${CMAKE_BINARY_DIR}/Source/prefix.js)
file (WRITE ${CMAKE_BINARY_DIR}/Source/prefix.js "var Module;if(typeof Module==='undefined')Module=eval('(function(){try{return Module||{}}catch(e){return{}}})()');var s=document.createElement('script');s.src='${CMAKE_PROJECT_NAME}.js';document.body.appendChild(s);Module['preRun'].push(function(){Module['addRunDependency']('${CMAKE_PROJECT_NAME}.js.loader')});s.onload=function(){Module['removeRunDependency']('${CMAKE_PROJECT_NAME}.js.loader')};")
endif ()
endif ()
else ()
# Create symbolic links in the build tree
Expand Down
8 changes: 8 additions & 0 deletions Docs/AngelScriptAPI.h
Expand Up @@ -11469,6 +11469,7 @@ Color ToColor() const;
double ToDouble() const;
float ToFloat() const;
int ToInt(int = 10) const;
int64 ToInt64(int = 10) const;
IntRect ToIntRect() const;
IntVector2 ToIntVector2() const;
IntVector3 ToIntVector3() const;
Expand All @@ -11478,6 +11479,7 @@ Matrix3x4 ToMatrix3x4() const;
Matrix4 ToMatrix4() const;
Quaternion ToQuaternion() const;
uint ToUInt(int = 10) const;
uint64 ToUInt64(int = 10) const;
String ToUpper() const;
Vector2 ToVector2() const;
Vector3 ToVector3() const;
Expand Down Expand Up @@ -13293,11 +13295,13 @@ VectorBuffer GetBuffer() const;
double GetDouble() const;
float GetFloat() const;
int GetInt() const;
int GetInt64() const;
RefCounted GetPtr() const;
ScriptObject GetScriptObject() const;
StringHash GetStringHash() const;
Array<String> GetStringVector() const;
uint GetUInt() const;
uint64 GetUInt64() const;
Array<Variant> GetVariantVector() const;
const IntRect& GetIntRect() const;
const IntVector2& GetIntVector2() const;
Expand Down Expand Up @@ -14075,6 +14079,7 @@ Color GetColor(const String&) const;
double GetDouble(const String&) const;
float GetFloat(const String&) const;
int GetInt(const String&) const;
int64 GetInt64(const String&) const;
IntRect GetIntRect(const String&) const;
IntVector2 GetIntVector2(const String&) const;
IntVector3 GetIntVector3(const String&) const;
Expand All @@ -14087,6 +14092,7 @@ Quaternion GetQuaternion(const String&) const;
ResourceRef GetResourceRef() const;
ResourceRefList GetResourceRefList() const;
uint GetUInt(const String&) const;
uint64 GetUInt64(const String&) const;
String GetValue() const;
Variant GetVariant() const;
VariantMap GetVariantMap() const;
Expand All @@ -14113,6 +14119,7 @@ bool SetColor(const String&, const Color&);
bool SetDouble(const String&, double);
bool SetFloat(const String&, float);
bool SetInt(const String&, int);
bool SetInt64(const String&, int64);
bool SetIntRect(const String&, const IntRect&);
bool SetIntVector2(const String&, const IntVector2&);
bool SetIntVector3(const String&, const IntVector3&);
Expand All @@ -14123,6 +14130,7 @@ bool SetQuaternion(const String&, const Quaternion&);
bool SetResourceRef(const String&, const ResourceRef&);
bool SetResourceRefList(const String&, const ResourceRefList&);
bool SetUInt(const String&, uint);
bool SetUInt64(const String&, uint64);
bool SetValue(const String&);
bool SetVariant(const Variant&);
bool SetVariantMap(const VariantMap&);
Expand Down
1 change: 1 addition & 0 deletions Docs/GettingStarted.dox
Expand Up @@ -164,6 +164,7 @@ A number of build options can be defined when invoking the build scripts or when
|EMSCRIPTEN_ALLOW_MEMORY_GROWTH|0|Enable memory growing based on application demand (Emscripten cross-compiling build only)|
|EMSCRIPTEN_TOTAL_MEMORY|*|Specify the total size of memory to be used (Emscripten cross-compiling build only); default to 128 MB, this option is ignored when EMSCRIPTEN_ALLOW_MEMORY_GROWTH=1|
|EMSCRIPTEN_SHARE_DATA|0|Enable sharing data file support (Emscripten cross-compiling build only)|
|EMSCRIPTEN_SHARE_JS |0|Share the same JS file responsible to load the shared data file (Emscripten cross-compiling build only and when enabling sharing data file support only)|
|EMSCRIPTEN_EMRUN_BROWSER|firefox|Specify the particular browser to be spawned by emrun during testing (Emscripten cross-compiling build only), use 'emrun --list_browsers' command to get the list of possible values|
|EMSCRIPTEN_SYSTEM_LIBS|-|Specify a semicolon-separated list of additional system libraries that should be pre-built using embuilder.py, by default 'dlmalloc', 'libc', 'libcxxabi', and 'gl' will be pre-built, so they should not be listed again (Emscripten cross-compiling build only); when using CMake CLI on Unix-like host systems, the semicolon may need to be properly escaped; see usage of embuilder.py to get the full list of supported system libraries|

Expand Down
37 changes: 23 additions & 14 deletions Docs/LuaScriptAPI.dox
Expand Up @@ -7188,6 +7188,8 @@ Methods:
- void* Get(const char* type = 0) const
- int GetInt() const
- unsigned GetUInt() const
- int GetInt64() const
- int GetUInt64() const
- StringHash GetStringHash() const
- bool GetBool() const
- float GetFloat() const
Expand Down Expand Up @@ -7677,6 +7679,8 @@ Methods:
- bool SetDouble(const String name, double value)
- bool SetUInt(const String name, unsigned value)
- bool SetInt(const String name, int value)
- bool SetUInt64(const String name, long value)
- bool SetInt64(const String name, long value)
- bool SetIntRect(const String name, const IntRect& value)
- bool SetIntVector2(const String name, const IntVector2& value)
- bool SetIntVector3(const String name, const IntVector3& value)
Expand Down Expand Up @@ -7716,6 +7720,8 @@ Methods:
- double GetDouble(const String name) const
- unsigned GetUInt(const String name) const
- int GetInt(const String name) const
- long GetUInt64(const String name) const
- long GetInt64(const String name) const
- IntRect GetIntRect(const String name) const
- IntVector2 GetIntVector2(const String name) const
- IntVector3 GetIntVector3(const String name) const
Expand Down Expand Up @@ -8362,6 +8368,7 @@ Properties:
- int VAR_STRINGVECTOR
- int VAR_RECT
- int VAR_INTVECTOR3
- int VAR_INT64
- int MAX_VAR_TYPES

### VertexElementSemantic
Expand Down Expand Up @@ -8505,9 +8512,9 @@ Properties:
- void PrintLine(const String str, bool error = false)
- int Rand()
- float RandStandardNormal()
- float Random()
- float Random(float range)
- float Random(float min, float max)
- float Random(float range)
- float Random()
- int RandomInt(int range)
- int RandomInt(int min, int max)
- float RandomNormal(float meanValue, float variance)
Expand All @@ -8526,16 +8533,17 @@ Properties:
- float Sin(float angle)
- float SmoothStep(float lhs, float rhs, float t)
- float Sqrt(float x)
- float StableRandom(float seed)
- float StableRandom(const Vector3& seed)
- float StableRandom(float seed)
- float StableRandom(const Vector2& seed)
- void SubscribeToEvent(void* sender, const String eventName, void* functionOrFunctionName)
- void SubscribeToEvent(const String eventName, void* functionOrFunctionName)
- void SubscribeToEvent(void* sender, const String eventName, void* functionOrFunctionName)
- float Tan(float angle)
- bool ToBool(const String source)
- Color ToColor(const String source)
- float ToFloat(const String source)
- int ToInt(const String source, int base = 10)
- int ToInt64(const String source, int base = 10)
- IntRect ToIntRect(const String source)
- IntVector2 ToIntVector2(const String source)
- IntVector3 ToIntVector3(const String source)
Expand All @@ -8548,41 +8556,42 @@ Properties:
- String ToString(void* value)
- String ToStringHex(unsigned value)
- unsigned ToUInt(const String source, int base = 10)
- int ToUInt64(const String source, int base = 10)
- unsigned ToUpper(unsigned ch)
- Vector2 ToVector2(const String source)
- Vector3 ToVector3(const String source)
- Vector4 ToVector4(const String source, bool allowMissingCoords = false)
- void UnsubscribeFromAllEvents()
- void UnsubscribeFromAllEventsExcept(const Vector<String>& exceptionNames)
- void UnsubscribeFromEvent(const String eventName)
- void UnsubscribeFromEvent(Object* sender, const String eventName)
- void UnsubscribeFromEvent(const String eventName)
- void UnsubscribeFromEvents(Object* sender)
- Vector2 VectorCeil(const Vector2& vec)
- Vector4 VectorCeil(const Vector4& vec)
- Vector3 VectorCeil(const Vector3& vec)
- IntVector2 VectorCeilToInt(const Vector2& vec)
- IntVector3 VectorCeilToInt(const Vector3& vec)
- Vector4 VectorFloor(const Vector4& vec)
- Vector3 VectorFloor(const Vector3& vec)
- IntVector2 VectorCeilToInt(const Vector2& vec)
- Vector2 VectorFloor(const Vector2& vec)
- IntVector3 VectorFloorToInt(const Vector3& vec)
- Vector3 VectorFloor(const Vector3& vec)
- Vector4 VectorFloor(const Vector4& vec)
- IntVector2 VectorFloorToInt(const Vector2& vec)
- IntVector3 VectorFloorToInt(const Vector3& vec)
- Vector2 VectorLerp(const Vector2& lhs, const Vector2& rhs, const Vector2& t)
- Vector3 VectorLerp(const Vector3& lhs, const Vector3& rhs, const Vector3& t)
- Vector4 VectorLerp(const Vector4& lhs, const Vector4& rhs, const Vector4& t)
- Vector3 VectorLerp(const Vector3& lhs, const Vector3& rhs, const Vector3& t)
- Vector4 VectorMax(const Vector4& lhs, const Vector4& rhs)
- IntVector3 VectorMax(const IntVector3& lhs, const IntVector3& rhs)
- Vector2 VectorMax(const Vector2& lhs, const Vector2& rhs)
- Vector3 VectorMax(const Vector3& lhs, const Vector3& rhs)
- IntVector2 VectorMax(const IntVector2& lhs, const IntVector2& rhs)
- IntVector3 VectorMax(const IntVector3& lhs, const IntVector3& rhs)
- Vector3 VectorMax(const Vector3& lhs, const Vector3& rhs)
- Vector2 VectorMin(const Vector2& lhs, const Vector2& rhs)
- IntVector3 VectorMin(const IntVector3& lhs, const IntVector3& rhs)
- Vector4 VectorMin(const Vector4& lhs, const Vector4& rhs)
- IntVector2 VectorMin(const IntVector2& lhs, const IntVector2& rhs)
- Vector3 VectorMin(const Vector3& lhs, const Vector3& rhs)
- IntVector2 VectorMin(const IntVector2& lhs, const IntVector2& rhs)
- Vector4 VectorRound(const Vector4& vec)
- Vector2 VectorRound(const Vector2& vec)
- Vector3 VectorRound(const Vector3& vec)
- Vector4 VectorRound(const Vector4& vec)
- IntVector3 VectorRoundToInt(const Vector3& vec)
- IntVector2 VectorRoundToInt(const Vector2& vec)

Expand Down
4 changes: 3 additions & 1 deletion Docs/Reference.dox
Expand Up @@ -151,7 +151,7 @@ void MyObject::OnUpdate(StringHash type, VariantMap& args)

}

SubscribeToEvent(E_UPDATE, std::bind(&MyObject::OnUpdate, this)));
SubscribeToEvent(E_UPDATE, std::bind(&MyObject::OnUpdate, this, std::placeholders::_1, std::placeholders::_2)));
\endcode

std::bind() discarding unneeded parameters:
Expand All @@ -162,6 +162,8 @@ void Class::OnUpdate(VariantMap& args)

}

using namespace std::placeholders;

SubscribeToEvent(E_UPDATE, std::bind(&Class::OnUpdate, this, _2)));
\endcode

Expand Down