i am currently in chapter10 the very first part which is suppose to display a plain particle system without gravity and texture but when i run the proj. it just display a black screen. ive checked my code many times and can’t find any mistake (i did everything in the book). i used the tracer and i find something weird, on the very last command which is to draw using glDrawArrays the mode is GL_NONE but in my code it’s clearly GL_POINTS. would openGL change it automatically to GL_NONE if it finds something wrong? please help i would like to finish this amazing book of yours, thank you.
(we resolved it over email; in case anyone else runs into issues with a black screen, one common cause is with the setup of the projection matrix. Comparing the code against here can also help to find the issue: http://pragprog.com/titles/kbogla/source_code)
I’m having the same issue. I get a black screen using a Samsung Phone and Android Studio (AS). All the previous air hockey examples in the book work fine. I’ve checked the code and pretty much copied the code over using Ctrl A and then Ctrl V into AS for every important file from the most recent code on this website.
When I run the program on page 203, it doesn’t work. When I run it on page 206, it doesn’t work either. I have a feeling it may work when I get to the end of the chapter, not sure yet.
This is a great book by the way. I’m learning so much. Please help.
Hi Kevin, I won’t have access to a pc until mid Jan, but something you could try is the full examples from the downloadable code here and see if that also shows a black screen. If not, then you would just need to compare to see where things are going wrong.
IME it’s usually the matrix but you could also see if you get any errors in your logcat about a shader compilation issue.
Please keep us posted!
HI Kevin. Thanks for the Shader tip. One thing I didn’t check was the Shaders. I had several typos in them and I was able to see the errors in Logcat. It’s now working fine. Thanks again.
No problem, I’ve run into this sort of thing often, myself. Happy Holidays and don’t hesitate to post back here if you run into any more issues. :)