small medium large xlarge

Generic-user-small
17 Feb 2014, 22:06
jerseh reynolds (1 post)

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.

Generic-user-small
14 Jun 2014, 00:48
Kevin Brothaler (47 posts)

(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)

Generic-user-small
29 Dec 2016, 05:46
Kevin Hamill (2 posts)

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.

Generic-user-small
29 Dec 2016, 11:55
Kevin Brothaler (47 posts)

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!

Generic-user-small
29 Dec 2016, 20:52
Kevin Hamill (2 posts)

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.

Generic-user-small
30 Dec 2016, 12:36
Kevin Brothaler (47 posts)

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. :)

You must be logged in to comment