Page 1 of 1

Rendering works only on development platform

Posted: Tue May 23, 2017 11:43 am
by beddu
Hello everybody!
I have a Raspberry PI 3B and a Raspberry PI Zero W, each one has its own SD card, on both SD cards I have the same Raspbian Jessie image (with Pixel).
On raspi 3B I installed Code::Blocks ide and developed a simple OGLES program. Let's call the SD card with code::blocks "development" and the other one "runtime". The program i made renders a white screen with a logo in the middle. It is compiled and it works. I moved only the executable file and the logo texture file to the runtime sd card, setted the permissions, checked that the program actually opens and loads the texture file by printing info on shell, but, i get the white screen without logo. I tried booting the raspi ZeroW with the development sd card, started the program, it works well. I tried booting the raspi 3B with the runtime sd card, no logo...

I am confused, there must be something that I dont (yet) know. How is possible that two clones behave in different ways regardless the hardware below them? Is maybe code::blocks making a difference?

Help!

Re: Rendering works only on development platform

Posted: Tue May 23, 2017 11:47 am
by SkyRise
Are you in the same directory on both Pi's?
Does your code reference a relative or static path for the image?

Re: Rendering works only on development platform

Posted: Tue May 23, 2017 11:52 am
by beddu
SkyRise wrote:Are you in the same directory on both Pi's?
Does your code reference a relative or static path for the image?
The full path is not the same, but i have a folder with two folders inside: "bin" and "res". The executable is inside bin, texture inside res, and I load the texture by choosing "../res" as current path and then opening "logo.tga". Of course i start the executable file from the bin dir.

Re: Rendering works only on development platform

Posted: Tue May 23, 2017 12:01 pm
by SkyRise
Try printing out the path to the terminal just before you read the image file to debug.
You may have different environments set up which is causing the issue.

Re: Rendering works only on development platform

Posted: Tue May 23, 2017 12:17 pm
by beddu
Unfortunately I have already something similar, in case the file was not loaded correctly I print out an error message, so I am quite sure that there are no problems from that point of view. I tried to intentionally start the program from a different path and the error messages are displayed correctly. I will make a new similar test again just to be 100% sure, but I'm still thinking about what else could be... No any other idea? Usually when a "ghost" like this comes out, it's always due to a very stupid mistake... :lol:

Re: Rendering works only on development platform

Posted: Tue May 23, 2017 12:30 pm
by SkyRise
The only other thing I can think of is that perhaps you installed something on the first Pi to interpret .tga files which you haven't installed on the other. I would expect this to throw an error of some sort, but you don't seem to be getting any errors...

Re: Rendering works only on development platform

Posted: Tue May 23, 2017 12:43 pm
by Paeryn
Have you got the GPU mem set too low on the "runtime" SD? Does your program check for any OpenGLES (and EGL) errors? If the textured polygon isn't showing but otherwise the program appears to work it could be that there wasn't enough GPU memory for the texture.

Re: Rendering works only on development platform

Posted: Tue May 23, 2017 12:51 pm
by beddu
Paeryn wrote:Have you got the GPU mem set too low on the "runtime" SD? Does your program check for any OpenGLES (and EGL) errors? If the textured polygon isn't showing but otherwise the program appears to work it could be that there wasn't enough GPU memory for the texture.
You got it!! Finally!! :lol: my gpu mem was too low, on development sd I raised it, but I did not do that on runtime sd. Moreover, I am not checking for errors after texture loading... Double mistake.

Thank you guys! I am an happy man now!