My translation so far is:
Code:
procedure Font.Draw(X,Y: Int64; Txt: String; Clr: Colour);
var
SS: pSdl_Surface;
Tex: Gluint;
begin
New(SS);
SS := TTF_RenderText_Blended(Pointer_, PChar(Txt), Clr.Sdl^);
glGenTextures(1, @Tex);
glBindTexture(GL_TEXTURE_2D, Tex);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, SS^.w, SS^.h, 0, GL_EXT_BGRA, GL_UNSIGNED_BYTE, SS^.pixels);
glBegin(GL_QUADS);
glTexCoord2d(0, 0); glVertex3d(X, Y, 0);
glTexCoord2d(1, 0); glVertex3d(X+SS^.w, Y, 0);
glTexCoord2d(1, 1); glVertex3d(X+SS^.w, Y+SS^.h, 0);
glTexCoord2d(0, 1); glVertex3d(X, Y+SS^.h, 0);
glEnd();
glDeleteTextures(1, @Tex);
sdl_freesurface(SS);
end;
And surprise surprise, it does not work...
Edit: one of the reasons behind this is that ttf_openfont does not load anything to the pointer as some extensive testing revealde. Are there any ways to get this to work? I've tried telling it the absolute path, case sensitive and etc but still no luck. has anyone else had this error?
Bookmarks