Jump to content

  • Log In with Google      Sign In   
  • Create Account


Frustrations on simple things


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 tom_mai78101   Members   -  Reputation: 568

Like
0Likes
Like

Posted 05 February 2014 - 08:15 AM

Posting a thread in General Programming is never going to solve this. Well, I do have the urge, but I am fighting, for my life at it, to not to.

I am currently writing an Android program that loads a picture in OpenGL ES 2.0. Simple, right?

If you took the fact that I have been rewriting the same program for a month over and over with varying degrees of successes and failures, I seriously don't see why it is that simple enough. Can't it ever work reliably at 100%?

Either I still am not understanding the basics in loading/binding textures, shader programming, or the order of operations involving the steps required to successfully draw a textured square mesh. Whatever the case it may be, I honestly do know that rewriting the same God damn code is frustrating when it may or may not work as intended.

Starting over with the basics? I have them memorized in my head.

Order of operations? I guess I need someone to clarify this for me.

1. Create vertex shader.
2. Create fragment shader.
3. Compile codes.
4. Create program.
5. Attach and link. Validate.
6. Generate texture.
7. Bind, set parameters, and create.
8. Set up object.
9. Vertex data, texture coordinates, buffers to hold data.
10. Set vertex attribute and uniform locations, and set the pointers. Enable attributes.
11. Use program. Set components.
12. Draw.

What am I missing? If the above looks to be corrrect, then you would be frustrated like me when you see that the program is and isn't working right.

Sigh. I just need to vent this out somehow.

Sponsor:

#2 frob   Moderators   -  Reputation: 18909

Like
3Likes
Like

Posted 05 February 2014 - 08:45 AM

No, managing textures and other resources really is that hard to get right. Plus you missed some steps.

 

But there is good news:  (1) If you are doing it yourself, you only need to do it once; then you can reuse it. And also, (2) you don't have to do it yourself, many other people have written that type of code and shared it for free online.

 

 

I assume you have these in your code, but you didn't mention them. You didn't mention having a GLSurfaceView, or managing it as a part of your activity such as being suspended or changed behind your back. You didn't mention testing for compatibility of devices. You didn't mention the laundry-list of testing for possible error codes since at just about every step something can go wrong --- and it *WILL* go wrong. 

 

Then you get all the wonderful Black Screen errors to play with.

 

 

When your goal is to make a game it is generally best to not spend your time writing an engine. Other people have done all the hard parts of resource management, leverage their solutions.


Check out my personal indie blog at bryanwagstaff.com.

#3 tom_mai78101   Members   -  Reputation: 568

Like
0Likes
Like

Posted 05 February 2014 - 05:04 PM

Of course, I can use other libraries available.

And yes, I did forgot to mention that I am programming in AIDE, a restrictive integrated development environment for Android, without a single computer.

I am limited by the choice of using a library, let alone know how to import one and edit the project properties.

#4 wodinoneeye   Members   -  Reputation: 675

Like
0Likes
Like

Posted 08 February 2014 - 03:22 AM

"And also, (2) you don't have to do it yourself, many other people have written that type of code and shared it for free online."

 

at least to use as a checklist to spot missing steps (or contingency handlers) from an example close enough to what your program is doing....

 

Similarly maybe getting some simpler  pieces to substitute (shaders, textures, game loop, etc..) just to get further along

 

And are sufficient debugging tools available in this 'AIDE' ?

 

 


--------------------------------------------Ratings are Opinion, not Fact

#5 tom_mai78101   Members   -  Reputation: 568

Like
0Likes
Like

Posted 08 February 2014 - 08:01 AM

No. There aren't any sufficient debugging tools for Android that comes with AIDE. The only thing I can get is logging to AIDE Logcat and obtain the outputs, however, you can't copy the logs and post them for others to see.


Edited by tom_mai78101, 08 February 2014 - 08:02 AM.


#6 frob   Moderators   -  Reputation: 18909

Like
0Likes
Like

Posted 08 February 2014 - 04:37 PM

How unfortunate. I assume you must have some reasons for not dropping AIDE.

Shaking the bugs out of a new engine is tough. That is why most people who want to make a game will start with an existing, functioning, debugged engine.

At least with this your hardware is relatively sane. Someone wrote this gem a few years back, and as someone who survived the PS2 era, I can tell you that whatever difficulty you are facing with Android shaders is relatively small compared to the difficulties on a few other systems. (As for the PS3 era, I was the second person in our studio and first on our team who figured out how to configure them. Nasty beasts those initial boxes, they are noisy space heaters and for I while I had 3 running under my desk...) Many times the pre-release developers had no source code to compare it against, no other teams to swap notes with, no debuggers or logging systems, and no direct access to the engineers making either the hardware or the apis. Either it works or your screen is black or trashed.

In your case there are many thousand working Android apps online with source code available. It may take some work to hunt down the steps you are missing, but it is something that can be done with a bit of effort.
Check out my personal indie blog at bryanwagstaff.com.

#7 tom_mai78101   Members   -  Reputation: 568

Like
0Likes
Like

Posted 09 February 2014 - 01:30 AM


How unfortunate. I assume you must have some reasons for not dropping AIDE.

 

Because I was banned from bringing a laptop with me to play around codes, while others around me can bring iPads, iPads mini, Android phones, a Compaq laptop, Apple MacBook Pro Retina, etc. Fuck me for breaking a rule and got myself into this.

 


Someone wrote this gem a few years back, and as someone who survived the PS2 era, I can tell you that whatever difficulty you are facing with Android shaders is relatively small compared to the difficulties on a few other systems.

 

I guess I need to tinker my phone a bit more and try to find where I'm doing wrong.

 


In your case there are many thousand working Android apps online with source code available. It may take some work to hunt down the steps you are missing, but it is something that can be done with a bit of effort.

 

I really need to use a computer in order to track the problem down. Just today, 3:25AM in the morning, I finally found the problem with the aid of the computer at home, and found that I didn't put the vertex data array inside a vertex array buffer. I can't track that down without a debugger to step into/over the codes line by line.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS