History

added comments; moved ptr init to cpp for back compat

Ge Wang committed 6 years ago

Commit 291e3d21 parent 5e02dfc2 files · +13 −6Browse files

Unified · Split

2 files
  1. src/core/chuck.cpp +9 −2
  2. src/core/chuck.h +4 −4
src/core/chuck.cpp+9−2
@@ -128,6 +128,8 @@ ChucK::ChucK() · 127 unmodified lines
128128 initDefaultParams();
129129 // did user init?
130130 m_init = FALSE;
131+ // zero out the hook
132+ m_hook = NULL; // m_hook = nullptr
131133
132134 // global init, if needed
133135 if( !o_isGlobalInit ) globalInit();
@@ -1129,9 +1131,11 @@ void ChucK::poop() · 995 unmodified lines
11291131
11301132
11311133
1134+
11321135 //-----------------------------------------------------------------------------
11331136 // name: setMainThreadHook()
1134−// desc:
1137+// desc: set a function pointer to call from the main thread loop
1138+// e.g., for graphics, MAUI, potentially from a chug-in
11351139 //-----------------------------------------------------------------------------
11361140 bool ChucK::setMainThreadHook(Chuck_DL_MainThreadHook * hook)
11371141 {
@@ -1139,9 +1143,12 @@ bool ChucK::setMainThreadHook(Chuck_DL_MainThreadHook * hook) · 1 unmodified line
11391143 return true;
11401144 }
11411145
1146+
1147+
1148+
11421149 //-----------------------------------------------------------------------------
11431150 // name: getMainThreadHook()
1144−// desc:
1151+// desc: get pointer to current function to be called from main loop
11451152 //-----------------------------------------------------------------------------
11461153 Chuck_DL_MainThreadHook * ChucK::getMainThreadHook()
11471154 {
src/core/chuck.h+4−4
@@ -122,9 +122,9 @@ public: · 121 unmodified lines
122122 public:
123123 // additional native chuck bindings/types (use with extra caution)
124124 bool bind( f_ck_query queryFunc, const std::string & name );
125−
126− bool setMainThreadHook(Chuck_DL_MainThreadHook * hook);
127−
125+ // set a function pointer to call from the main thread loop
126+ bool setMainThreadHook( Chuck_DL_MainThreadHook * hook );
127+ // get pointer to current function to be called from main loop
128128 Chuck_DL_MainThreadHook * getMainThreadHook();
129129
130130 public:
@@ -205,7 +205,7 @@ protected: · 74 unmodified lines
205205 // did user init?
206206 t_CKBOOL m_init;
207207 // main thread "hook" (if there is a main thread)
208− Chuck_DL_MainThreadHook * m_hook = nullptr;
208+ Chuck_DL_MainThreadHook * m_hook;
209209 };
210210
211211

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t