Well, no, the minimal example works *g* I will try to find the difference
but now I have another odd problem:
The image is a png file but when I'm trying to use it as a texture it isn't transparent.
#include <vector>
#include <sstream>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
int main()
{
RenderWindow win(VideoMode(800, 600), "minimal example");
win.Show(true);
Image img;
img.LoadFromFile("/home/ankou/Pictures/001-Grassland01.png");
vector<GLshort> vertices(8);
vector<GLubyte> indices(4);
vertices[0] = 0;
vertices[1] = 0;
vertices[2] = img.GetWidth();
vertices[3] = 0;
vertices[4] = img.GetWidth();
vertices[5] = img.GetHeight();
vertices[6] = 0;
vertices[7] = img.GetHeight();
indices[0] = 0;
indices[1] = 1;
indices[2] = 2;
indices[3] = 3;
GLfloat left(0);
GLfloat right(1);
GLfloat top(0);
GLfloat bottom(1);
vector<GLfloat> tex_coords(8);
tex_coords[0] = left;
tex_coords[1] = top;
tex_coords[2] = right;
tex_coords[3] = top;
tex_coords[4] = right;
tex_coords[5] = bottom;
tex_coords[6] = left;
tex_coords[7] = bottom;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluOrtho2D(0, 800, 600, 0);
glClearColor(0, 1, 0, 0);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
while(42)
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslated(10, 10, 0);
img.Bind();
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glVertexPointer(2, GL_SHORT, 2*sizeof(GLshort), &vertices[0]);
glTexCoordPointer(2, GL_FLOAT, 2*sizeof(GLfloat), &tex_coords[0]);
glDrawElements(GL_QUADS, 4, GL_UNSIGNED_BYTE, &indices[0]);
win.Display();
}
}
But when I'm executing
String fps_drawable("some string", Font::GetDefaultFont(), 10);
win.Draw(fps_drawable);
before I render the rectangle the image is displayed correctly(with transparency)
edit: oh, I forgot an GLenable