sfml_opengl3\main: extraneous lines break the program
crolando opened this issue · 5 comments
this file:
nuklear-master\demo\sfml_opengl3\main.cpp
basically doesn't compile at the moment because there are 2 garbage lines in the source file. If you delete these out, the program compiles and runs great.
The first is on line 174, the one reading:
float bg[4];
This line causes the version of "bg" on line 109 to be occluded since it's in a previous stack frame. It also causes the line on 178 to have syntax errors, which ultimately kills the compile:
glClearColor(bg.r, bg.g, bg.b, bg.a);
The errors being of course, you can't use the period operator to access float array indexes. Note, 178 is correct and needs to stay.
The second garbage line is the one on 176, because the second argument to the function there, "background", is undefined:
nk_color_fv(bg, background);
Looking at the code, this seems to be conceptually related to the other garbage line, but doesn't make sense because we've spent lines 152-155 loading the nk_colorf bg (from line 110) with colors, so why would we need to do it again?
Anyway, we should just delete 174 and 176 and call it a day.
Make a pull with reference to this issue and I'll be more than happy to merge it :winki:.
just noticed that sfml opengl2 demo has a similar issue, so I just lumped that change into the pull request as well.
shit, this is redundant with #817. Prefer we use this that one, it has a broader scope.
Thanks for pointing this again out and sorry for the delay. I've merged the other one. Feel free to close this one.
No worries, that was my first pull request, so I'm just learning the ropes. Lesson learned: look for existing pull requests haha.