Is that Your entire code, that you posted in first post, for GLWidget? or did You truncated it?
If yes, then You are missing a lot of important stuff, i.e. model/view matrix definition etc...
Is that Your entire code, that you posted in first post, for GLWidget? or did You truncated it?
If yes, then You are missing a lot of important stuff, i.e. model/view matrix definition etc...
In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
The advance of computerization however, has not yet wiped out nations and ethnic groups.
Yep, that's pretty much all the code I've got so far... I'm just following along with NeHe's tutorial and a Qt version of it that I found elsewhere. Hmm... I'll have to look over what I might have missed in that case. What do you mean by model and view matrix definition? I've provided the 2D quad that I want to map the texture to, isn't that the model?
P.S. After reviewing NeHe's tutorial again, I'm still failing to see what I might have missed.
I also made sure the image was a power of 2 dimension... not necessary I know but just in case.
Finally I read about the image formats... and according to what I read:
Qt Code:
glTexImage2D(GL_TEXTURE_2D, 0, 3, GLFormatImage.width(), GLFormatImage.height(), 0, GL_RGB, GL_UNSIGNED_BYTE, GLFormatImage.bits());To copy to clipboard, switch view to plain text mode
should be right... it's 24 bit which I assume to be per pixel and that also suggests to me at least that it's RGB and not RGBA... although in the attributes it does have A, but I couldn't find out what that meant.
Last edited by Atomic_Sheep; 22nd May 2012 at 13:09.
GL_RGB = GL Red Green Blue
GL_RGBA GL Red Green Blue Alpha
BMP don't support Alpha, so only mistake that You coukd make is with BPP (bits per pixel), i.e. is BMP 24bit.
Matrix'es are to describe projection (how to draw 3D scene into 2D image) and model (scene scales etc..)
I just looked at first Nehe tutorial and they create matrixes, so I don't know with tutorial You fallowed.
On nehe www they have also Qt project for (probably) each tutorial so I suggest to take a look at them.
In the near future - corporate networks reach out to the stars. Electrons and light flow throughout the universe.
The advance of computerization however, has not yet wiped out nations and ethnic groups.
Atomic_Sheep (24th May 2012)
Thanks for the advice, reviewed a lot of NeHe's tutorials... I finally got the texture to load, but it's not as I expected it to be, but I'll try to figure it out, don't have any ideas as to what is going wrong at the moment but hopefully after reviewing the graphics pipeline I'll figure it out. Well I have an idea of where in the graphics pipeline the problem lies, that's about the extent of my understanding of the problem.
Last edited by Atomic_Sheep; 23rd May 2012 at 07:19.
Bookmarks