fand / veda

⚡VJ / Live Coding on Atom⚡
http://veda.gl/
MIT License
509 stars 34 forks source link

Nested Loop make the pixel pass crash => #140

Closed MsieurTempeteBitch closed 4 years ago

MsieurTempeteBitch commented 5 years ago

I have a simple *.frag file i wanna make work.

If I nest a loop, for example : void main() {

gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);

for(int i = 0; i < 10; i++){ for(j = 0; j < 10; j++) { } } }

the pixel pass crash and the screen remains black.

fand commented 5 years ago

Hi @MsieurTempeteBitch ! Is that the actual code you tried? If so, j must be declared like for (int j = 0;, otherwise it fails to compile.

MsieurTempeteBitch commented 5 years ago

Hey,

No it's not the code I've made, I just put a example code.

Of course it was initialized, even with a while loop

Can you nest loop ?

If you can maybe the problem is somewhere else...

Thx !

On Fri, Jun 7, 2019, 11:29 AM Takayosi Amagi <notifications@github.com wrote:

Hi @MsieurTempeteBitch https://github.com/MsieurTempeteBitch ! Is that the actual code you tried? If so, j must be declared like for (int j = 0;, otherwise it fails to compile.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/fand/veda/issues/140?email_source=notifications&email_token=ALUZ3AXMUTDG3CLJDLEPRTDPZIS7TA5CNFSM4HVCWYX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXFKOJI#issuecomment-499820325, or mute the thread https://github.com/notifications/unsubscribe-auth/ALUZ3AUDAYKZKXKU3W4TDVTPZIS7TANCNFSM4HVCWYXQ .

fand commented 4 years ago

Sorry that i've completely forgot about this issue... I tried using nested loops and it worked without problems. https://gist.github.com/fand/8c5a31eb544b35f2eb489c4fda8dea5d