- if (!My_SDL_Init()) { return 1; }
- if (TTF_Init() < 0) { return 1; }
- if (!My_GL_Init()) { return 1; }
- if (!PreLoadTextures()) { return 1; }
- font = TTF_OpenFont("data/Vera.ttf" , 10);
- if (!font) { return 1; }
- TTF_SetFontStyle( font, 0 );
- SDL_Color color={0,1,0}, bgcolor={0xff,0xff,0xff};
- if(!(image =TTF_RenderText_Shaded(font,"Hello World!",color,bgcolor))) { return 0; }
- glGenTextures(1, &Tex_Font);
- glBindTexture(GL_TEXTURE_2D, Tex_Font);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- gluBuild2DMipmaps(GL_TEXTURE_2D, 3, image->w, image->h,GL_RGB, GL_UNSIGNED_BYTE, image->pixels);
- [ in Render-Schleife, Create_Quad meine Funktion x, y, w, h]
- glBindTexture(GL_TEXTURE_2D, Tex_Font);
- Create_Quad(1.0f, 1.0f, 5.0f, 6.0f);