Timeline for Opengl drawing a section of a texture stretched over a quad
Current License: CC BY-SA 3.0
10 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 25, 2012 at 2:10 | history | tweeted | twitter.com/#!/StackGameDev/status/194971615002501120 | ||
| Apr 25, 2012 at 0:01 | vote | accept | dennmat | ||
| Apr 25, 2012 at 0:01 | comment | added | House | Ah, well I was just making my comment into an answer. I guess it's moot then. Glad you solved it! | |
| Apr 25, 2012 at 0:00 | answer | added | House | timeline score: 2 | |
| Apr 24, 2012 at 23:58 | history | edited | dennmat | CC BY-SA 3.0 | added 499 characters in body |
| Apr 24, 2012 at 23:57 | comment | added | dennmat | Turns out it was another issue all together, I thought this didn't make sense cause it was mapping it to the vertices so it should stretch regardless and infact it does work right I was assigning the wrong the width and height values to the drawing routines calculations. And now I feel really stupid, thanks for the help Byte56. Sorry for taking up your time. The GL_CLAMP solution would be the correct answer if I hadn't made a huge fail. | |
| Apr 24, 2012 at 23:55 | comment | added | House | Try: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); | |
| Apr 24, 2012 at 23:49 | comment | added | dennmat | (x, y) of position in texture divided accordingly (x/width) (y/height) become x0 and y0. Then the same for with the width and height of that chunk added on become x1 and y1. Then GLfloat texture_coords[] = {x0, y0, x1, y0, x1, y1, x0, y1}; using glTexCoordPointer obviously. | |
| Apr 24, 2012 at 23:42 | comment | added | House | How are you assigning the texture coordinates to the quad? | |
| Apr 24, 2012 at 23:37 | history | asked | dennmat | CC BY-SA 3.0 |