Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - yetti

Pages: [1]
1
Graphics / Enabling textures
« on: November 06, 2010, 11:09:39 pm »
Sorry to start this thread then, I missed the file ;). It works so I have an error in the rest of the code somewhere.

Thanks for the quick help and btw great work on SFML, respect to all SFML developers

2
Graphics / Enabling textures
« on: November 06, 2010, 10:56:23 pm »
well, something like this

Code: [Select]
sf::Image image = sf::Image();
// loading texture
if(!image.LoadFromFile("assets/missing.jpg")) {
 // breakpoint
}
const sf::Uint8* ptr = image.GetPixelsPtr();
GLuint tex;
glGenTextures(1, &tex);
glBindTexture(GL_TEXTURE_2D, tex);
glTexImage2D(GL_TEXTURE_2D,0,GL_RGB,256,256,0,GL_RGB,GL_UNSIGNED_BYTE,ptr);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glBindTexture(GL_TEXTURE_2D, textures[0]);


This might not be ok, but the DevIL code was working before so I wonder why it doesn't work under SFML.

3
Graphics / Enabling textures
« on: November 06, 2010, 10:19:58 pm »
Hi,
I'm trying to enable textures in SFML (OpenGL) but I simply can't get it working.

I had a project done SDL/Windows GDI, I ported it to SFML and everything works except textures.

I'm using DevIL for loading image files and it was working under SDL/GDI. I tried sf::Image but no, all objects are white (glColor works).

Can anyone provide me a simple snippet how to enable textures?

I'm sorry, I can't provide you source files.

VC2010/SFML 1.6

Thanks,
yetti

Pages: [1]