Hello Guest

OpenGL texture binding VBO issues

  • 2 Replies
  • 3716 Views
OpenGL texture binding VBO issues
« on: August 11, 2014, 00:57:31 »
Hey guys,

So i have been messing around with a voxel engine trying to learn opengl context however i cant seem to get my textures to paint on the quad.
I have been looking around for common issues all over the internet and looking through example portions of code but nothing seems to be able to help me clear up my issue.

I did have them working with Color VBO's. Is it a shader issue? any help would be greatly appreciated.

Here is my code:
http://pastebin.com/EMUT0hB9

*

Offline quew8

  • *****
  • 569
  • Because Square Eyes Look More Real
Re: OpenGL texture binding VBO issues
« Reply #1 on: August 13, 2014, 12:10:56 »
Firstly, there is a lot of code there. I have glanced over what I feel to be the important bits and cannot see anything amiss but you will never get someone to trawl through that code out of the goodness of their heart because a) there is far too much of it and b) it is even less likely they'll spot a typo (which is generally the problem) in your code when you missed it. So instead I will give you advice to pin down the problem.

Start a new project and try and get a single textured quad to render using immediate mode. You must start from scratch otherwise you just copy in the same bug that is hurting you at the moment. If that does not work then you have a small snippet of code which it is perfectly possible for us to read through. However it will probably work at which point you must start replacing bits of it with the original code. Every time you replace something you check it is still working; if it works you replace something else, it it doesn't then you have what is causing the problem. If you get to the end and it is still working then it was just some typo causing the problem and you now have the full-featured, typo-free system to use.

Also you asked whether it was a shader issue, but as far as I can see you are using the fixed function pipeline and not shaders at all.

And one last note: when asking for help on a Java programming forum you will receive less abuse if your code is formatted in Java's formatting. Mainly I'm talking about variable names being lower-camel-case rather than upper-camel-case. I understand you are probably coming from C# or something similar but I'm just letting you know. 

Re: OpenGL texture binding VBO issues
« Reply #2 on: August 13, 2014, 22:15:43 »
Thanks for the heads up about typical java formatting. I will give your method a go, however i had it working on a smaller scale ( Direct type implementation glbegin ... gl end etc) it just seemed to fail when i swapped it all to VBO, I will however trawl through it looking for a typo somewhere and the way I've set it up is rather messy and i think i need to swap it out into a new project where its much cleaner. Thanks for the advice!