Timeline for How do I load textures with SFML for OpenGL?
Current License: CC BY-SA 3.0
8 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Aug 7, 2016 at 19:04 | comment | added | domsson | This answer is a bit outdated. With SFML 2.0, the uploading of image data would now look like this: glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.getSize().x, image.getSize().y, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8_REV, image.getPixelsPtr()); | |
| Nov 9, 2012 at 21:44 | comment | added | danijar | Very nice explanation. You could write tutorials! | |
| Jul 8, 2012 at 8:38 | comment | added | knight666 | Yes, it turns on the 2D texture object, so it can receive texture data. You only have to enable it once on initialization, but it is often forgotten when copying code to a new project. Myself included. ;) | |
| Jul 8, 2012 at 5:42 | vote | accept | Darestium | ||
| Jul 8, 2012 at 5:42 | comment | added | Darestium | Awesome, works! Thanks! BTW, what does that function do? Enable texturing? | |
| Jul 8, 2012 at 5:17 | comment | added | knight666 | Try putting glEnable(GL_TEXTURE2D); in the init function. | |
| Jul 8, 2012 at 4:40 | comment | added | Darestium | mmm, I tried doing so and all I get is a white cube: pastebin.com/nVQFAMRJ | |
| Jul 7, 2012 at 6:38 | history | answered | knight666 | CC BY-SA 3.0 |